lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject svn commit: r1441395 - /lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
Date Fri, 01 Feb 2013 11:39:59 GMT
Author: jpountz
Date: Fri Feb  1 11:39:58 2013
New Revision: 1441395

URL: http://svn.apache.org/viewvc?rev=1441395&view=rev
Log:
Fix test bug (used to rely on internal doc IDs).

Modified:
    lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java?rev=1441395&r1=1441394&r2=1441395&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
Fri Feb  1 11:39:58 2013
@@ -618,11 +618,12 @@ public abstract class BaseTermVectorsFor
     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();



Mime
View raw message