Apache Lucene open-source search software
SOLR-2282: use solr home properly in the test
Koji Sekiguchi3478bb935862
diff --git a/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java b/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.javaindex 1b815b2cb0d..51c9726d95f 100644--- a/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java+++ b/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java@@ -26,6 +26,12 @@ import org.junit.Ignore;public class DistributedClusteringComponentTest extendsBaseDistributedSearchTestCase {+ @Override+ public String getSolrHome() {+ // TODO: this should work with just "solr-clustering"...+ return getFile("solr-clustering").getAbsolutePath();+ }+@Overridepublic void doTest() throws Exception {del("*:*");diff --git a/solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.javaindex 945d54da3e1..33839c86c3d 100644--- a/solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java+++ b/solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java@@ -124,12 +124,21 @@ public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 {return randVals;}+ /**+ * Subclasses can override this to change a test's solr home+ * (default is in test-files)+ */+ public String getSolrHome() {+ return SolrTestCaseJ4.TEST_HOME;+ }+@Overridepublic void setUp() throws Exception {SolrTestCaseJ4.resetExceptionIgnores(); // ignore anything with ignore_exception in itsuper.setUp();System.setProperty("solr.test.sys.prop1", "propone");System.setProperty("solr.test.sys.prop2", "proptwo");+ System.setProperty("solr.solr.home", getSolrHome());testDir = new File(TEMP_DIR,getClass().getName() + "-" + System.currentTimeMillis());testDir.mkdirs();