mirror of https://github.com/apache/lucene.git
Fix test bug (used to rely on internal doc IDs).
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1441395 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a7c49eeb8c
commit
6ae5a4e52d
|
@ -618,11 +618,12 @@ public abstract class BaseTermVectorsFormatTestCase extends LuceneTestCase {
|
|||
final Directory dir = newDirectory();
|
||||
final RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
|
||||
for (int i = 0; i < numDocs; ++i) {
|
||||
writer.addDocument(docs[i].toDocument());
|
||||
writer.addDocument(addId(docs[i].toDocument(), ""+i));
|
||||
}
|
||||
final IndexReader reader = writer.getReader();
|
||||
for (int i = 0; i < numDocs; ++i) {
|
||||
assertEquals(docs[i], reader.getTermVectors(i));
|
||||
final int docID = docID(reader, ""+i);
|
||||
assertEquals(docs[i], reader.getTermVectors(docID));
|
||||
}
|
||||
reader.close();
|
||||
writer.close();
|
||||
|
|
Loading…
Reference in New Issue