From 19b80d1afe2c12b1cac3bfad2d709d587cbfdd9f Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Fri, 30 May 2014 08:43:41 +0000 Subject: [PATCH] LUCENE-5708: fix test bug git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1598497 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/codecs/lucene41/TestBlockPostingsFormat2.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene41/TestBlockPostingsFormat2.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene41/TestBlockPostingsFormat2.java index 7e9afbfe306..1f2cebb1cf7 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene41/TestBlockPostingsFormat2.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene41/TestBlockPostingsFormat2.java @@ -22,11 +22,11 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.TextField; -import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.FieldInfo.IndexOptions; +import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig.OpenMode; +import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.LuceneTestCase; @@ -35,6 +35,7 @@ import org.apache.lucene.util.TestUtil; /** * Tests special cases of BlockPostingsFormat */ + public class TestBlockPostingsFormat2 extends LuceneTestCase { Directory dir; RandomIndexWriter iw; @@ -54,6 +55,7 @@ public class TestBlockPostingsFormat2 extends LuceneTestCase { iw.shutdown(); TestUtil.checkIndex(dir); // for some extra coverage, checkIndex before we forceMerge IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())); + iwc.setCodec(TestUtil.alwaysPostingsFormat(new Lucene41PostingsFormat())); iwc.setOpenMode(OpenMode.APPEND); IndexWriter iw = new IndexWriter(dir, iwc); iw.forceMerge(1);