use of org.apache.jena.tdb2.params.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());
}
use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.
the class TestStoreParams method roundTrip.
// --------
private static StoreParams roundTrip(StoreParams params) {
JsonObject obj = StoreParamsCodec.encodeToJson(params);
StoreParams params2 = StoreParamsCodec.decode(obj);
return params2;
}
use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.
the class TestStoreParams method store_params_20.
// Check that setting gets recorded and propagated.
@Test
public void store_params_20() {
StoreParams params = StoreParams.builder().blockReadCacheSize(0).build();
assertTrue(params.isSetBlockReadCacheSize());
assertFalse(params.isSetBlockWriteCacheSize());
}
use of org.apache.jena.tdb2.params.StoreParams in project jena by apache.
the class TestStoreParams method store_params_11.
@Test
public void store_params_11() {
String xs = "{ \"tdb.block_size\": 2048 }";
JsonObject x = JSON.parse(xs);
StoreParams paramsExpected = StoreParams.builder().blockSize(2048).build();
StoreParams paramsActual = StoreParamsCodec.decode(x);
assertEqualsStoreParams(paramsExpected, paramsActual);
}
use of org.apache.jena.tdb2.params.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());
}
Aggregations