You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/08/07 15:17:37 UTC
svn commit: r1370241 -
/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
Author: rmuir
Date: Tue Aug 7 13:17:37 2012
New Revision: 1370241
URL: http://svn.apache.org/viewvc?rev=1370241&view=rev
Log:
add test for when fixed dv is not really fixed length
Modified:
lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java?rev=1370241&r1=1370240&r2=1370241&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java Tue Aug 7 13:17:37 2012
@@ -1025,4 +1025,21 @@ public class TestDocValuesIndexing exten
w.close();
d.close();
}
+
+ public void testFixedLengthNotReallyFixed() throws IOException {
+ Directory d = newDirectory();
+ IndexWriter w = new IndexWriter(d, new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
+ Document doc = new Document();
+ doc.add(new DerefBytesDocValuesField("foo", new BytesRef("bar"), true));
+ w.addDocument(doc);
+ doc = new Document();
+ doc.add(new DerefBytesDocValuesField("foo", new BytesRef("bazz"), true));
+ try {
+ w.addDocument(doc);
+ } catch (IllegalArgumentException expected) {
+ // expected
+ }
+ w.close();
+ d.close();
+ }
}