예제 #1
0
 @Test
 public void index_find_2() {
   int[] keys = {1, 2, 3, 4, 5, 6, 7, 8, 9};
   Index index = test(keys);
   Record r = intToRecord(20, RecordLib.TestRecordLength);
   r = index.find(r);
   assertNull(r);
 }
예제 #2
0
 @Test
 public void index_find_1() {
   int[] keys = {1};
   Index index = test(keys);
   Record r = intToRecord(1, RecordLib.TestRecordLength);
   r = index.find(r);
   assertNotNull(r);
 }
예제 #3
0
  private Index test(int[] insKeys, int[] delKeys, int[] expected) {
    index = makeIndex(4, 0);
    testInsert(index, insKeys);
    long x = index.size();
    if (x >= 0) assertEquals(insKeys.length, x);

    if (delKeys != null) {
      testDelete(index, delKeys);
    }

    if (expected != null) testIndexContents(index, expected);
    return index;
  }
예제 #4
0
 @After
 public void afterTest() {
   if (index != null) index.close();
   index = null;
 }