lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1362064 - /lucene/dev/branches/lucene_solr_3_6/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java
Date Mon, 16 Jul 2012 14:33:32 GMT
Author: rmuir
Date: Mon Jul 16 14:33:31 2012
New Revision: 1362064

URL: http://svn.apache.org/viewvc?rev=1362064&view=rev
Log:
LUCENE-4221: backport this test, just to ensure 3.x is not affected

Modified:
    lucene/dev/branches/lucene_solr_3_6/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java

Modified: lucene/dev/branches/lucene_solr_3_6/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java?rev=1362064&r1=1362063&r2=1362064&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java
(original)
+++ lucene/dev/branches/lucene_solr_3_6/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java
Mon Jul 16 14:33:31 2012
@@ -25,7 +25,9 @@ import java.util.ArrayList;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.analysis.CannedTokenStream;
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.analysis.Token;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.util.Constants;
@@ -89,6 +91,21 @@ public class TestCheckIndex extends Luce
     assertTrue(checker.checkIndex(onlySegments).clean == true);
     dir.close();
   }
+  
+  // LUCENE-4221: we have to let these thru, for now
+  public void testBogusTermVectors() throws IOException {
+    Directory dir = newDirectory();
+    IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, null));
+    Document doc = new Document();
+    Field field = new Field("foo", "", Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_OFFSETS);
+    field.setTokenStream(new CannedTokenStream(
+        new Token("bar", 5, 10), new Token("bar", 1, 4)
+    ));
+    doc.add(field);
+    iw.addDocument(doc);
+    iw.close();
+    dir.close(); // checkindex
+  }
 
   public void testLuceneConstantVersion() throws IOException {
     // common-build.xml sets lucene.version



Mime
View raw message