use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParamsChoose method params_choose_new_persist_1.
@Test
public void params_choose_new_persist_1() {
// new database, app defined.
Location loc = Location.create(DIR);
FileOps.clearAll(loc.getDirectoryPath());
// Clear.
StoreParams p = Build.decideStoreParams(loc, true, pApp, null, pDft);
// Check location now has a pLoc.
String fn = loc.getPath(StoreParamsConst.TDB_CONFIG_FILE);
assertTrue(FileOps.exists(fn));
StoreParams pLoc2 = StoreParamsCodec.read(loc);
assertTrue(StoreParams.sameValues(pLoc2, p));
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParams method store_params_22.
// Modify
@Test
public void store_params_22() {
StoreParams params1 = StoreParams.builder().blockReadCacheSize(0).blockWriteCacheSize(1).build();
StoreParams params2 = StoreParams.builder().blockReadCacheSize(5).build();
StoreParams params3 = StoreParamsBuilder.modify(params1, params2);
assertFalse(params2.isSetBlockWriteCacheSize());
assertTrue(params3.isSetBlockReadCacheSize());
assertTrue(params3.isSetBlockWriteCacheSize());
// From params2
assertEquals(5, params3.getBlockReadCacheSize().intValue());
// From params1, not params2(unset)
assertEquals(1, params3.getBlockWriteCacheSize().intValue());
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParams method store_params_02.
@Test
public void store_params_02() {
StoreParams input = StoreParams.getDftStoreParams();
StoreParams sp = StoreParams.builder(input).build();
assertEqualsStoreParams(StoreParams.getDftStoreParams(), sp);
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParams method store_params_03.
@Test
public void store_params_03() {
StoreParams sp = StoreParams.builder().build();
assertEqualsStoreParams(StoreParams.getDftStoreParams(), sp);
}
use of org.apache.jena.tdb.setup.StoreParams in project jena by apache.
the class TestStoreParams method store_params_13.
@Test
public void store_params_13() {
String xs = "{ \"tdb.triple_indexes\" : [ \"POS\" , \"PSO\"] } ";
JsonObject x = JSON.parse(xs);
StoreParams params = StoreParamsCodec.decode(x);
String[] expected = { "POS", "PSO" };
assertArrayEquals(expected, params.getTripleIndexes());
}
Aggregations