Search in sources :

Example 11 with StoreParams

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));
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) Location(org.apache.jena.tdb.base.file.Location) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb.ConfigTest)

Example 12 with StoreParams

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());
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 13 with StoreParams

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);
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 14 with StoreParams

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);
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 15 with StoreParams

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());
}
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)

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