SOLR-5865: Un@Ignore test again.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1579679 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2014-03-20 16:30:28 +00:00
parent 9994f6d7a1
commit 5c20f7dfba
2 changed files with 38 additions and 16 deletions

View File

@ -44,7 +44,6 @@ import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -52,9 +51,10 @@ import org.slf4j.LoggerFactory;
/**
* Test of the MiniSolrCloudCluster functionality. This doesn't derive from
* LuceneTestCase, as the MiniSolrCloudCluster is designed to be used outside of the
* lucene test hierarchy.
* lucene test hierarchy. Because of this, normal checks are not applied to this test
* to ensure it does not do things like pollute future tests that will run in this JVM.
* *Please be very careful*.
*/
@Ignore
public class TestMiniSolrCloudCluster {
private static Logger log = LoggerFactory.getLogger(MiniSolrCloudCluster.class);
@ -76,6 +76,14 @@ public class TestMiniSolrCloudCluster {
miniCluster.shutdown();
}
miniCluster = null;
System.clearProperty("solr.tests.mergePolicy");
System.clearProperty("solr.tests.maxBufferedDocs");
System.clearProperty("solr.tests.maxIndexingThreads");
System.clearProperty("solr.tests.ramBufferSizeMB");
System.clearProperty("solr.tests.mergeScheduler");
System.clearProperty("solr.directoryFactory");
System.clearProperty("solr.solrxml.location");
System.clearProperty("zkHost");
}
@Test

View File

@ -17,14 +17,6 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.commons.io.IOUtils;
import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooDefs;
import org.eclipse.jetty.servlet.ServletHolder;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
@ -33,12 +25,26 @@ import java.util.LinkedList;
import java.util.List;
import java.util.SortedMap;
import com.google.common.io.Files;
import org.apache.commons.io.IOUtils;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooDefs;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.Rule;
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
import com.google.common.io.Files;
public class MiniSolrCloudCluster {
@Rule
public TestRule testRules =
RuleChain.outerRule(new SystemPropertiesRestoreRule());
private static Logger log = LoggerFactory.getLogger(MiniSolrCloudCluster.class);
private ZkTestServer zkServer;
@ -135,10 +141,18 @@ public class MiniSolrCloudCluster {
* Shut down the cluster, including all Solr nodes and ZooKeeper
*/
public void shutdown() throws Exception {
for (int i = jettys.size() - 1; i >= 0; --i) {
stopJettySolrRunner(i);
try {
for (int i = jettys.size() - 1; i >= 0; --i) {
stopJettySolrRunner(i);
}
} finally {
try {
zkServer.shutdown();
} finally {
System.clearProperty("solr.solrxml.location");
System.clearProperty("zkHost");
}
}
zkServer.shutdown();
}
private static String getHostContextSuitableForServletContext(String ctx) {