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 2013/01/21 16:02:54 UTC
svn commit: r1436398 -
/lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
Author: rmuir
Date: Mon Jan 21 15:02:54 2013
New Revision: 1436398
URL: http://svn.apache.org/viewvc?rev=1436398&view=rev
Log:
add docvalues to testThreadInterruptDeadlock
Modified:
lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
Modified: lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=1436398&r1=1436397&r2=1436398&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java Mon Jan 21 15:02:54 2013
@@ -34,9 +34,12 @@ import org.apache.lucene.analysis.tokena
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
+import org.apache.lucene.document.BinaryDocValuesField;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.LongDocValuesField;
+import org.apache.lucene.document.SortedBytesDocValuesField;
import org.apache.lucene.document.StoredField;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
@@ -1017,10 +1020,16 @@ public class TestIndexWriter extends Luc
Document doc = new Document();
doc.add(newStringField(random, "id", "500", Field.Store.NO));
doc.add(newField(random, "field", "some prepackaged text contents", storedTextType));
+ doc.add(new BinaryDocValuesField("binarydv", new BytesRef("500")));
+ doc.add(new LongDocValuesField("numericdv", 500));
+ doc.add(new SortedBytesDocValuesField("sorteddv", new BytesRef("500")));
w.addDocument(doc);
doc = new Document();
doc.add(newStringField(random, "id", "501", Field.Store.NO));
doc.add(newField(random, "field", "some more contents", storedTextType));
+ doc.add(new BinaryDocValuesField("binarydv", new BytesRef("501")));
+ doc.add(new LongDocValuesField("numericdv", 501));
+ doc.add(new SortedBytesDocValuesField("sorteddv", new BytesRef("501")));
w.addDocument(doc);
w.deleteDocuments(new Term("id", "500"));
w.close();
@@ -1045,10 +1054,19 @@ public class TestIndexWriter extends Luc
Document doc = new Document();
Field idField = newStringField(random, "id", "", Field.Store.NO);
+ Field binaryDVField = new BinaryDocValuesField("binarydv", new BytesRef());
+ Field numericDVField = new LongDocValuesField("numericdv", 0);
+ Field sortedDVField = new SortedBytesDocValuesField("sorteddv", new BytesRef());
doc.add(idField);
doc.add(newField(random, "field", "some text contents", storedTextType));
+ doc.add(binaryDVField);
+ doc.add(numericDVField);
+ doc.add(sortedDVField);
for(int i=0;i<100;i++) {
idField.setStringValue(Integer.toString(i));
+ binaryDVField.setBytesValue(new BytesRef(idField.stringValue()));
+ numericDVField.setLongValue(i);
+ sortedDVField.setBytesValue(new BytesRef(idField.stringValue()));
int action = random.nextInt(100);
if (action == 17) {
w.addIndexes(adder);
@@ -1149,7 +1167,6 @@ public class TestIndexWriter extends Luc
}
}
- //nocommit: make this tests DV2.0
public void testThreadInterruptDeadlock() throws Exception {
IndexerThreadInterrupt t = new IndexerThreadInterrupt();
t.setDaemon(true);