use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_ins_2_04.
@Test
public void tree_ins_2_04() {
int[] keys = { 0, 9, 2, 7, 4, 5, 6, 3, 8, 1 };
RangeIndex rIndex = makeRangeIndex(2);
testInsert(rIndex, keys);
assertEquals(0, r(rIndex.minKey()));
assertEquals(9, r(rIndex.maxKey()));
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_del_0_2.
@Test
public void tree_del_0_2() {
int[] keys1 = { 0, 1, 2 };
int[] keys2 = { 2, 1, 0 };
RangeIndex rIndex = makeRangeIndex(2);
testInsertDelete(rIndex, keys1, keys2);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_del_2_03.
@Test
public void tree_del_2_03() {
int[] keys1 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int[] keys2 = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 };
RangeIndex rIndex = makeRangeIndex(2);
testInsertDelete(rIndex, keys1, keys2);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_del_2_01.
@Test
public void tree_del_2_01() {
int[] keys1 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int[] keys2 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
RangeIndex rIndex = makeRangeIndex(2);
testInsertDelete(rIndex, keys1, keys2);
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class IndexTestLib method testIndexContents.
public static void testIndexContents(Index index, int... records) {
List<Integer> x = toIntList(index.iterator());
// Make a unique list of expected records. Remove duplicates
List<Integer> y = unique(asList(records));
assertEquals("Expected records size and tree size different", y.size(), index.size());
assertEquals("Expected records size and iteration over all keys are of different sizes", y.size(), x.size());
if (index instanceof RangeIndex) {
// Check sorted order
for (int i = 0; i < x.size() - 2; i++) {
if (x.get(i) > x.get(i + 1)) {
fail("check failed: " + strings(records));
return;
}
}
}
// Check each expected record is in the tree
for (int k : y) {
Record rec = intToRecord(k);
Record r2 = index.find(rec);
assertNotNull(r2);
}
}
Aggregations