SOLR-5486: cleanup DeleteInactiveReplicaTest

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1544033 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-11-21 04:56:22 +00:00
parent 8def69cd7f
commit cd3f22f76b
1 changed files with 22 additions and 10 deletions

View File

@ -17,6 +17,11 @@ package org.apache.solr.cloud;
* limitations under the License. * limitations under the License.
*/ */
import static org.apache.solr.common.cloud.ZkNodeProps.makeMap;
import java.net.URL;
import java.util.Map;
import org.apache.solr.client.solrj.embedded.JettySolrRunner; import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.CloudSolrServer; import org.apache.solr.client.solrj.impl.CloudSolrServer;
import org.apache.solr.client.solrj.impl.HttpSolrServer; import org.apache.solr.client.solrj.impl.HttpSolrServer;
@ -27,24 +32,32 @@ import org.apache.solr.common.cloud.Slice;
import org.apache.solr.common.cloud.ZkStateReader; import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.MapSolrParams; import org.apache.solr.common.params.MapSolrParams;
import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.NamedList;
import org.junit.After;
import java.net.URL; import org.junit.Before;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.Future;
import static org.apache.solr.common.cloud.ZkNodeProps.makeMap;
public class DeleteInactiveReplicaTest extends DeleteReplicaTest{ public class DeleteInactiveReplicaTest extends DeleteReplicaTest{
private CloudSolrServer client;
@Override @Override
public void doTest() throws Exception { public void doTest() throws Exception {
deleteInactiveReplicaTest(); deleteInactiveReplicaTest();
} }
@Before
public void setUp() throws Exception {
super.setUp();
client = createCloudClient(null);
}
@After
public void tearDown() throws Exception {
super.tearDown();
client.shutdown();
}
private void deleteInactiveReplicaTest() throws Exception{ private void deleteInactiveReplicaTest() throws Exception{
String COLL_NAME = "delDeadColl"; String COLL_NAME = "delDeadColl";
CloudSolrServer client = createCloudClient(null);
createCloudClient(null);
createColl(COLL_NAME, client); createColl(COLL_NAME, client);
boolean stopped = false; boolean stopped = false;
@ -105,7 +118,6 @@ public class DeleteInactiveReplicaTest extends DeleteReplicaTest{
} }
log.info("removed_replicas {}/{} ",shard1.getName(),replica1.getName()); log.info("removed_replicas {}/{} ",shard1.getName(),replica1.getName());
removeAndWaitForReplicaGone(COLL_NAME, client, replica1, shard1.getName()); removeAndWaitForReplicaGone(COLL_NAME, client, replica1, shard1.getName());
client.shutdown();
ChaosMonkey.start(stoppedJetty); ChaosMonkey.start(stoppedJetty);
log.info("restarted jetty"); log.info("restarted jetty");