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:
Adrien Grand 2013-02-01 11:39:58 +00:00
parent a7c49eeb8c
commit 6ae5a4e52d
1 changed files with 3 additions and 2 deletions

View File

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