Search in sources :

Example 16 with StoreParams

use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.

the class TestStoreParams method store_params_10.

// ----
@Test
public void store_params_10() {
    StoreParams params = StoreParams.builder().fileMode(FileMode.direct).blockSize(1024).build();
    StoreParams params2 = roundTrip(params);
    assertEqualsStoreParams(params, params2);
    assertEquals(params.getFileMode(), params2.getFileMode());
    assertEquals(params.getBlockSize(), params2.getBlockSize());
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 17 with StoreParams

use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.

the class TestStoreParams method store_params_12.

@Test
public void store_params_12() {
    String xs = "{ \"tdb.file_mode\": \"direct\" , \"tdb.block_size\": 2048 }";
    JsonObject x = JSON.parse(xs);
    StoreParams paramsExpected = StoreParams.builder().blockSize(2048).fileMode(FileMode.direct).build();
    StoreParams paramsActual = StoreParamsCodec.decode(x);
    assertEqualsStoreParams(paramsExpected, paramsActual);
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) JsonObject(org.apache.jena.atlas.json.JsonObject) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 18 with StoreParams

use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.

the class TestStoreParams method store_params_21.

@Test
public void store_params_21() {
    StoreParams params1 = StoreParams.builder().blockReadCacheSize(0).build();
    assertTrue(params1.isSetBlockReadCacheSize());
    assertFalse(params1.isSetBlockWriteCacheSize());
    StoreParams params2 = StoreParams.builder(params1).blockWriteCacheSize(0).build();
    assertTrue(params2.isSetBlockReadCacheSize());
    assertTrue(params2.isSetBlockWriteCacheSize());
    assertFalse(params2.isSetNodeMissCacheSize());
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 19 with StoreParams

use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.

the class TestStoreParams method store_params_14.

@Test(expected = TDBException.class)
public void store_params_14() {
    // Misspelt. 
    String xs = "{ \"tdb.triples_indexes\" : [ \"POS\" , \"PSO\"] } ";
    JsonObject x = JSON.parse(xs);
    StoreParams params = StoreParamsCodec.decode(x);
    String[] expected = { "POS", "PSO" };
    assertArrayEquals(expected, params.getTripleIndexes());
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) JsonObject(org.apache.jena.atlas.json.JsonObject) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 20 with StoreParams

use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.

the class TestStoreParams method store_params_04.

@Test
public void store_params_04() {
    StoreParams params = StoreParams.builder().build();
    StoreParams params2 = roundTrip(params);
    assertEqualsStoreParams(params, params2);
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Aggregations

StoreParams (org.apache.jena.tdb.setup.StoreParams)27 BaseTest (org.apache.jena.atlas.junit.BaseTest)26 Test (org.junit.Test)26 ConfigTest (org.apache.jena.tdb.ConfigTest)15 JsonObject (org.apache.jena.atlas.json.JsonObject)5 Location (org.apache.jena.tdb.base.file.Location)3