Skip to content

Apache Lucene open-source search software

SimpleText codec doesn't have to be added by LuceneTestCase

Michael McCandlesse69d35f095c1
diff --git a/lucene/src/java/org/apache/lucene/index/codecs/CodecProvider.java b/lucene/src/java/org/apache/lucene/index/codecs/CodecProvider.java
index 98b31a7885f..136b7d0cd73 100644
--- a/lucene/src/java/org/apache/lucene/index/codecs/CodecProvider.java
+++ b/lucene/src/java/org/apache/lucene/index/codecs/CodecProvider.java
@@ -26,6 +26,7 @@ import org.apache.lucene.index.SegmentWriteState;
import org.apache.lucene.index.codecs.preflex.PreFlexCodec;
import org.apache.lucene.index.codecs.pulsing.PulsingCodec;
import org.apache.lucene.index.codecs.standard.StandardCodec;
+import org.apache.lucene.index.codecs.simpletext.SimpleTextCodec;
/** Holds a set of codecs, keyed by name. You subclass
* this, instantiate it, and register your codecs, then
@@ -45,7 +46,7 @@ public abstract class CodecProvider {
private static String defaultCodec = "Standard";
- public final static String[] CORE_CODECS = new String[] {"Standard", "Pulsing", "PreFlex"};
+ public final static String[] CORE_CODECS = new String[] {"Standard", "Pulsing", "PreFlex", "SimpleText"};
public synchronized void register(Codec codec) {
if (codec.name == null) {
@@ -116,6 +117,7 @@ class DefaultCodecProvider extends CodecProvider {
register(new StandardCodec());
register(new PreFlexCodec());
register(new PulsingCodec(1));
+ register(new SimpleTextCodec());
}
@Override
diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
index 95f0094e60c..6461486621b 100644
--- a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
@@ -35,7 +35,6 @@ import org.apache.lucene.index.codecs.mocksep.MockSepCodec;
import org.apache.lucene.index.codecs.preflex.PreFlexCodec;
import org.apache.lucene.index.codecs.preflexrw.PreFlexRWCodec;
import org.apache.lucene.index.codecs.pulsing.PulsingCodec;
-import org.apache.lucene.index.codecs.simpletext.SimpleTextCodec;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.FieldCache.CacheEntry;
@@ -56,8 +55,6 @@ import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.junit.runner.manipulation.Filter;
import org.junit.runner.manipulation.NoTestsRemainException;
-import org.junit.runner.notification.Failure;
-import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
@@ -193,7 +190,7 @@ public abstract class LuceneTestCase extends Assert {
private static Map<MockDirectoryWrapper,StackTraceElement[]> stores;
- private static final String[] TEST_CODECS = new String[] {"MockSep", "MockFixedIntBlock", "MockVariableIntBlock", "SimpleText"};
+ private static final String[] TEST_CODECS = new String[] {"MockSep", "MockFixedIntBlock", "MockVariableIntBlock"};
private static void swapCodec(Codec c) {
final CodecProvider cp = CodecProvider.getDefault();
@@ -246,7 +243,6 @@ public abstract class LuceneTestCase extends Assert {
swapCodec(new MockFixedIntBlockCodec(codecHasParam && "MockFixedIntBlock".equals(codec) ? codecParam : _TestUtil.nextInt(random, 1, 2000)));
// baseBlockSize cannot be over 127:
swapCodec(new MockVariableIntBlockCodec(codecHasParam && "MockVariableIntBlock".equals(codec) ? codecParam : _TestUtil.nextInt(random, 1, 127)));
- swapCodec(new SimpleTextCodec());
return cp.lookup(codec);
}