Search in sources :

Example 6 with TableDesc

use of org.apache.jena.sdb.store.TableDesc in project jena by apache.

the class TestStoreUpdateBase method dupeSuppressed.

@Test
public void dupeSuppressed() {
    TableDesc desc = store.getTripleTableDesc();
    loader.startBulkUpdate();
    loader.addTuple(desc, node("F"), node("A"), node("F"));
    loader.addTuple(desc, node("F"), node("A"), node("F"));
    loader.finishBulkUpdate();
    assertEquals("Store added only one item", 1, size(desc));
    assertEquals("Store added correct number of nodes", 2, size(nodeT));
    loader.startBulkUpdate();
    loader.addTuple(desc, node("G"), node("A"), node("F"));
    loader.finishBulkUpdate();
    loader.startBulkUpdate();
    loader.addTuple(desc, node("G"), node("A"), node("F"));
    loader.finishBulkUpdate();
    assertEquals("Store added only one item", 2, size(desc));
    assertEquals("Store added correct number of nodes", 3, size(nodeT));
}
Also used : TableDesc(org.apache.jena.sdb.store.TableDesc) Test(org.junit.Test)

Example 7 with TableDesc

use of org.apache.jena.sdb.store.TableDesc in project jena by apache.

the class TestStoreUpdateBase method loadOneRemoveOne.

@Test
public void loadOneRemoveOne() {
    TableDesc desc = store.getTripleTableDesc();
    loader.startBulkUpdate();
    loader.addTuple(desc, node("B"), node("B"), node("C"));
    loader.finishBulkUpdate();
    assertEquals("Added one triple", 1, size(desc));
    assertEquals("Store added correct number of nodes", 2, size(nodeT));
    loader.startBulkUpdate();
    loader.deleteTuple(desc, node("B"), node("B"), node("C"));
    loader.finishBulkUpdate();
    assertEquals("Back to the start", 0, size(desc));
}
Also used : TableDesc(org.apache.jena.sdb.store.TableDesc) Test(org.junit.Test)

Example 8 with TableDesc

use of org.apache.jena.sdb.store.TableDesc in project jena by apache.

the class TestStoreUpdateBase method sizes.

@Test
public void sizes() {
    TableDesc desc = store.getTripleTableDesc();
    loader.startBulkUpdate();
    loader.addTuple(desc, node("A"), node("A"), node("A"));
    loader.addTuple(desc, node("B"), node("B"), node("B"));
    loader.finishBulkUpdate();
    desc = store.getQuadTableDesc();
    loader.startBulkUpdate();
    loader.addTuple(desc, node("A"), node("A"), node("A"), node("A"));
    loader.addTuple(desc, node("B"), node("A"), node("A"), node("A"));
    loader.addTuple(desc, node("B"), node("B"), node("B"), node("B"));
    loader.addTuple(desc, node("B"), node("C"), node("C"), node("C"));
    loader.finishBulkUpdate();
    assertEquals("Triple size right", 2l, store.getSize());
    assertEquals("Quad size right", 1l, store.getSize(node("A")));
    assertEquals("Quad size (2) right", 3l, store.getSize(node("B")));
}
Also used : TableDesc(org.apache.jena.sdb.store.TableDesc) Test(org.junit.Test)

Example 9 with TableDesc

use of org.apache.jena.sdb.store.TableDesc in project jena by apache.

the class TestStoreUpdateBase method loadOneRemoveOneQ.

@Test
public void loadOneRemoveOneQ() {
    TableDesc desc = store.getQuadTableDesc();
    loader.startBulkUpdate();
    loader.addTuple(desc, node("B"), node("B"), node("C"), node("D"));
    loader.finishBulkUpdate();
    assertEquals("Added one triple", 1, size(desc));
    assertEquals("Store added correct number of nodes", 3, size(nodeT));
    loader.startBulkUpdate();
    loader.deleteTuple(desc, node("B"), node("B"), node("C"), node("D"));
    loader.finishBulkUpdate();
    assertEquals("Back to the start", 0, size(desc));
}
Also used : TableDesc(org.apache.jena.sdb.store.TableDesc) Test(org.junit.Test)

Aggregations

TableDesc (org.apache.jena.sdb.store.TableDesc)9 Test (org.junit.Test)8 Store (org.apache.jena.sdb.Store)1 TupleTable (org.apache.jena.sdb.store.TupleTable)1