mirror of https://github.com/apache/lucene.git
SOLR-2279: move to beforeClass, so a test doesn't disable it for subsequent tests in the same jvm
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1130063 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
402c76d700
commit
8b6be652b2
|
@ -341,6 +341,14 @@ public abstract class LuceneTestCase extends Assert {
|
||||||
random.setSeed(staticSeed);
|
random.setSeed(staticSeed);
|
||||||
tempDirs.clear();
|
tempDirs.clear();
|
||||||
stores = Collections.synchronizedMap(new IdentityHashMap<MockDirectoryWrapper,StackTraceElement[]>());
|
stores = Collections.synchronizedMap(new IdentityHashMap<MockDirectoryWrapper,StackTraceElement[]>());
|
||||||
|
|
||||||
|
// 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();
|
savedCodecProvider = CodecProvider.getDefault();
|
||||||
if ("random".equals(TEST_CODECPROVIDER)) {
|
if ("random".equals(TEST_CODECPROVIDER)) {
|
||||||
if ("randomPerField".equals(TEST_CODEC)) {
|
if ("randomPerField".equals(TEST_CODEC)) {
|
||||||
|
@ -620,12 +628,6 @@ public abstract class LuceneTestCase extends Assert {
|
||||||
for (Thread t : Thread.getAllStackTraces().keySet()) {
|
for (Thread t : Thread.getAllStackTraces().keySet()) {
|
||||||
rogueThreads.put(t, true);
|
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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,6 +32,8 @@ public class MultiCoreEmbeddedTest extends MultiCoreExampleTestBase {
|
||||||
|
|
||||||
@Override public void setUp() throws Exception
|
@Override public void setUp() throws Exception
|
||||||
{
|
{
|
||||||
|
// TODO: fix this test to use MockDirectoryFactory
|
||||||
|
System.clearProperty("solr.directoryFactory");
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
File home = new File( getSolrHome() );
|
File home = new File( getSolrHome() );
|
||||||
|
|
Loading…
Reference in New Issue