From b3174c271eceeca75fb28197b2faed697fbbee5e Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sun, 12 Aug 2012 11:29:32 +0000 Subject: [PATCH] fix test bug git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1372069 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/src/test/org/apache/lucene/index/TestPayloads.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java b/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java index e2ffa153588..8a514036370 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPayloads.java @@ -596,7 +596,9 @@ public class TestPayloads extends LuceneTestCase { /** some docs have payload att, some not */ public void testMixupDocs() throws Exception { Directory dir = newDirectory(); - RandomIndexWriter writer = new RandomIndexWriter(random(), dir); + IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, null); + iwc.setMergePolicy(newLogMergePolicy()); + RandomIndexWriter writer = new RandomIndexWriter(random(), dir, iwc); Document doc = new Document(); Field field = new TextField("field", "", Field.Store.NO); TokenStream ts = new MockTokenizer(new StringReader("here we go"), MockTokenizer.WHITESPACE, true); @@ -615,7 +617,7 @@ public class TestPayloads extends LuceneTestCase { field.setTokenStream(ts); writer.addDocument(doc); DirectoryReader reader = writer.getReader(); - SegmentReader sr = getOnlySegmentReader(reader); + AtomicReader sr = reader.getSequentialSubReaders().get(0); DocsAndPositionsEnum de = sr.termPositionsEnum(null, "field", new BytesRef("withPayload")); de.nextDoc(); de.nextPosition();