Search in sources :

Example 11 with RecordBuffer

use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.

the class TestRecordBuffer method recBuffer12.

// Copy, duplicate, clear
@Test
public void recBuffer12() {
    RecordBuffer rb = make(5, 5);
    contains(rb, 2, 4, 6, 8, 10);
    RecordBuffer rb2 = rb.duplicate();
    rb2.set(1, r(99));
    contains(rb, 2, 4, 6, 8, 10);
    contains(rb2, 2, 99, 6, 8, 10);
}
Also used : RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 12 with RecordBuffer

use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.

the class TestRecordBuffer method recBuffer09.

// Errors
@Test(expected = BufferException.class)
public void recBuffer09() {
    RecordBuffer rb = make(4, 5);
    contains(rb, 2, 4, 6, 8);
    rb.shiftDown(4);
}
Also used : RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 13 with RecordBuffer

use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.

the class TestRecordBuffer method recBufferIterate01.

@Test
public void recBufferIterate01() {
    RecordBuffer rb = make(5, 5);
    same(rb.iterator(), 2, 4, 6, 8, 10);
}
Also used : RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 14 with RecordBuffer

use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.

the class TestRecordBuffer method recBufferIterate04.

@Test
public void recBufferIterate04() {
    RecordBuffer rb = make(3, 5);
    Iterator<Record> iter = rb.iterator(intToRecord(3), null);
    same(iter, 4, 6);
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RecordLib.intToRecord(org.apache.jena.tdb.base.record.RecordLib.intToRecord) RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 15 with RecordBuffer

use of org.apache.jena.tdb.base.buffer.RecordBuffer in project jena by apache.

the class TestRecordBuffer method recBufferIterate10.

@Test
public void recBufferIterate10() {
    RecordBuffer rb = make(5, 5);
    Iterator<Record> iter = rb.iterator(intToRecord(4), intToRecord(8));
    same(iter, 4, 6);
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RecordLib.intToRecord(org.apache.jena.tdb.base.record.RecordLib.intToRecord) RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Aggregations

RecordBuffer (org.apache.jena.tdb.base.buffer.RecordBuffer)34 BaseTest (org.apache.jena.atlas.junit.BaseTest)26 Test (org.junit.Test)26 Record (org.apache.jena.tdb.base.record.Record)14 RecordLib.intToRecord (org.apache.jena.tdb.base.record.RecordLib.intToRecord)11 PtrBuffer (org.apache.jena.tdb.base.buffer.PtrBuffer)3 ByteBuffer (java.nio.ByteBuffer)2 IOException (java.io.IOException)1 RecordBufferPage (org.apache.jena.tdb.base.recordbuffer.RecordBufferPage)1