use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class ExtHashTestBase method check.
public static void check(ExtHash extHash, int... recs) {
extHash.check();
for (int i : recs) {
Record r = intToRecordKey(i);
assertNotNull(extHash.find(r));
}
List<Integer> y = unique(asList(recs));
int x = (int) extHash.size();
assertEquals(y.size(), x);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class AbstractTestIndex method index_find_1.
@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);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class AbstractTestIndex method index_find_2.
@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);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class IndexTestLib method testDelete.
public static void testDelete(Index index, int[] vals) {
long size1 = index.size();
int count = 0;
count = delete(index, vals);
List<Record> x = intToRecord(vals, RecordLib.TestRecordLength);
for (Record r : x) {
boolean b = index.delete(r);
if (b)
count++;
}
for (Record r : x) BaseTest.assertFalse(index.contains(r));
long size2 = index.size();
assertEquals(size1 - count, size2);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class TestBPTreeRecords method bpt_shift_1.
@Test
public void bpt_shift_1() {
BPTreeRecords bpr1 = make();
BPTreeRecords bpr2 = make();
insert(bpr1, 10);
Record r = bpr1.shiftRight(bpr2, null);
assertNull(r);
//assertTrue(Record.keyEQ(r, RecordTestLib.intToRecord(10))) ;
contains(bpr1);
contains(bpr2, 10);
bpr1.release();
bpr2.release();
}
Aggregations