mirror of https://github.com/apache/lucene.git
add docvalues to testThreadInterruptDeadlock
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1436398 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4b71fcbf72
commit
2eee425da2
|
@ -34,9 +34,12 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
|
|||
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 LuceneTestCase {
|
|||
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 LuceneTestCase {
|
|||
|
||||
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 LuceneTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
//nocommit: make this tests DV2.0
|
||||
public void testThreadInterruptDeadlock() throws Exception {
|
||||
IndexerThreadInterrupt t = new IndexerThreadInterrupt();
|
||||
t.setDaemon(true);
|
||||
|
|
Loading…
Reference in New Issue