LUCENE-5708: fix test bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1598497 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-05-30 08:43:41 +00:00
parent 43be0a77b5
commit 19b80d1afe
1 changed files with 4 additions and 2 deletions

View File

@ -22,11 +22,11 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType; import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField; 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.IndexOptions;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.IndexWriter; 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.OpenMode;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
@ -35,6 +35,7 @@ import org.apache.lucene.util.TestUtil;
/** /**
* Tests special cases of BlockPostingsFormat * Tests special cases of BlockPostingsFormat
*/ */
public class TestBlockPostingsFormat2 extends LuceneTestCase { public class TestBlockPostingsFormat2 extends LuceneTestCase {
Directory dir; Directory dir;
RandomIndexWriter iw; RandomIndexWriter iw;
@ -54,6 +55,7 @@ public class TestBlockPostingsFormat2 extends LuceneTestCase {
iw.shutdown(); iw.shutdown();
TestUtil.checkIndex(dir); // for some extra coverage, checkIndex before we forceMerge TestUtil.checkIndex(dir); // for some extra coverage, checkIndex before we forceMerge
IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())); IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
iwc.setCodec(TestUtil.alwaysPostingsFormat(new Lucene41PostingsFormat()));
iwc.setOpenMode(OpenMode.APPEND); iwc.setOpenMode(OpenMode.APPEND);
IndexWriter iw = new IndexWriter(dir, iwc); IndexWriter iw = new IndexWriter(dir, iwc);
iw.forceMerge(1); iw.forceMerge(1);