SimpleText codec doesn't have to be added by LuceneTestCase

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1027036 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-10-25 10:40:52 +00:00
parent 40214cf103
commit e69d35f095
2 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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);
}