diff --git a/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java index 4a58023d466..655d81b092a 100644 --- a/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java @@ -341,6 +341,14 @@ public abstract class LuceneTestCase extends Assert { random.setSeed(staticSeed); tempDirs.clear(); stores = Collections.synchronizedMap(new IdentityHashMap()); + + // enable this by default, for IDE consistency with ant tests (as its the default from ant) + // TODO: really should be in solr base classes, but some extend LTC directly. + // we do this in beforeClass, because some tests currently disable it + if (System.getProperty("solr.directoryFactory") == null) { + System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockDirectoryFactory"); + } + savedCodecProvider = CodecProvider.getDefault(); if ("random".equals(TEST_CODECPROVIDER)) { if ("randomPerField".equals(TEST_CODEC)) { @@ -620,12 +628,6 @@ public abstract class LuceneTestCase extends Assert { for (Thread t : Thread.getAllStackTraces().keySet()) { rogueThreads.put(t, true); } - - // enable this by default, for IDE consistency with ant tests (as its the default from ant) - // TODO: really should be in solr base classes, but some extend LTC directly. - if (System.getProperty("solr.directoryFactory") == null) { - System.setProperty("solr.directoryFactory", "org.apache.solr.core.MockDirectoryFactory"); - } } /** diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java index be95da03555..ede29c58afd 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/MultiCoreEmbeddedTest.java @@ -32,6 +32,8 @@ public class MultiCoreEmbeddedTest extends MultiCoreExampleTestBase { @Override public void setUp() throws Exception { + // TODO: fix this test to use MockDirectoryFactory + System.clearProperty("solr.directoryFactory"); super.setUp(); File home = new File( getSolrHome() );