assertEquals(null,index.getTerm(t1, revNum));
}
public void checkTwoInserts(long revNum) {
long doc0, doc1, doc2;
QueryNode s;
QueryNode allTerms = index.getRange(new Range(ArrayBytes.EMPTY_BYTES, null, null, true, true), revNum);
s = index.getTerm(t1, revNum);
assertTrue(s.next());
doc0 = s.doc();
assertFalse(s.next());
allTerms.seek(doc0, ArrayBytes.EMPTY_BYTES);
assertEquals(0, allTerms.term().compareTo(t1));
assertEquals(NextStatus.NEXT_TERM, allTerms.nextTerm());
assertEquals(0, allTerms.term().compareTo(t2));
assertEquals(NextStatus.NEXT_TERM, allTerms.nextTerm());
assertEquals(0, allTerms.term().compareTo(t4));
assertEquals(NextStatus.NEXT_TERM, allTerms.nextTerm());
assertEquals(0, allTerms.term().compareTo(t5));
assertEquals(NextStatus.AT_END, allTerms.nextTerm());
s = index.getTerm(t1, revNum);
doc1 = s.doc();
assertTrue(s.next());
doc2 = s.doc();
assertFalse(s.next());
assertTrue(doc1 < doc2);
allTerms = index.getRange(new Range(ArrayBytes.EMPTY_BYTES, null, null, true, true), revNum);
allTerms.seek(doc1, ArrayBytes.EMPTY_BYTES);
assertEquals(0, allTerms.term().compareTo(t1));
assertEquals(NextStatus.NEXT_TERM, allTerms.nextTerm());
assertEquals(0, allTerms.term().compareTo(t3));
assertEquals(NextStatus.NEXT_DOC, allTerms.nextTerm());
s = index.getRange(new Range(t0, t3, t4, false, false), revNum);
assertNull(s);
s = index.getRange(new Range(t0, t3, t4, false, true), revNum);
assertNotNull(s);
assertFalse(s.next());
s = index.getRange(new Range(t0, t3, t4, true, false), revNum);
assertNotNull(s);
assertFalse(s.next());
s = index.getRange(new Range(t0, t3, t4, true, true), revNum);
assertNotNull(s);
assertTrue(s.next());
assertFalse(s.next());
allTerms = index.getRange(new Range(ArrayBytes.EMPTY_BYTES, null, null, true, true), revNum);
Range r = new Range(t1, null, null, true, true);
s = allTerms.specialize(r);
assertNotNull(s);
r = new Range(t3, t3, t3, true, true);
s = allTerms.specialize(r);
// could be null (no results expected)
if (s != null) { // if not null, make sure no results match
do {
assertFalse(r.matches(s.term()));
} while(s.nextTerm() != NextStatus.AT_END);