예제 #1
0
 private void expectKeysSearch(BTree btree, int[] values) {
   int lastValue = Integer.MIN_VALUE;
   for (int i = 0; i < values.length; i++) {
     if (values[i] != lastValue) {
       final ExpectingVisitor expectingVisitor =
           ExpectingVisitor.createExpectingVisitor(
               values[i], IntArrays4.occurences(values, values[i]));
       BTreeRange range = fieldIndexKeySearch(trans(), btree, new Integer(values[i]));
       BTreeAssert.traverseKeys(
           range,
           new Visitor4() {
             public void visit(Object obj) {
               FieldIndexKey fik = (FieldIndexKey) obj;
               expectingVisitor.visit(fik.value());
             }
           });
       expectingVisitor.assertExpectations();
       lastValue = values[i];
     }
   }
 }
예제 #2
0
 public void testTraverseValues() {
   StoredField field = storedField();
   ExpectingVisitor expectingVisitor = new ExpectingVisitor(IntArrays4.toObjectArray(FOOS));
   field.traverseValues(expectingVisitor);
   expectingVisitor.assertExpectations();
 }