Search in sources :

Example 1 with StoreParams

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

the class TestStoreParamsChoose method params_choose_existing_3.

@Test
public void params_choose_existing_3() {
    StoreParams p = Build.decideStoreParams(Location.mem(), false, null, pLoc, pDft);
    // p is pLoc
    assertTrue(StoreParams.sameValues(p, pLoc));
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb.ConfigTest)

Example 2 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_4.

@Test
public void params_choose_new_4() {
    StoreParams p = Build.decideStoreParams(Location.mem(), true, pApp, pLoc, pDft);
    // New store, pLoc, no pApp, so pLoc is the entire settings.
    assertFalse(StoreParams.sameValues(p, pApp));
    assertFalse(StoreParams.sameValues(p, pLoc));
    assertFalse(StoreParams.sameValues(p, pDft));
    assertEquals(0, p.getBlockSize().intValue());
    assertEquals(12, p.getNodeMissCacheSize().intValue());
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb.ConfigTest)

Example 3 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_persist_3.

@Test
public void params_choose_new_persist_3() {
    // new database, location defined, application modified.
    Location loc = Location.create(DIR);
    FileOps.clearAll(loc.getDirectoryPath());
    StoreParamsCodec.write(loc, pLoc);
    // Clear.
    StoreParams p = Build.decideStoreParams(loc, true, pApp, pLoc, pDft);
    // Check location still has a pLoc.
    String fn = loc.getPath(StoreParamsConst.TDB_CONFIG_FILE);
    assertTrue(FileOps.exists(fn));
    StoreParams pLoc2 = StoreParamsCodec.read(loc);
    assertFalse(StoreParams.sameValues(pLoc, p));
    // Location
    assertEquals(0, p.getBlockSize().intValue());
    // Application
    assertEquals(12, p.getNodeMissCacheSize().intValue());
}
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 4 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_1.

@Test
public void params_choose_new_1() {
    StoreParams p = Build.decideStoreParams(Location.mem(), true, null, null, pDft);
    // New store, no pLoc, no pApp so pDft.
    assertTrue(StoreParams.sameValues(p, pDft));
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb.ConfigTest)

Example 5 with StoreParams

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

the class TestStoreParamsCreate method params_reconnect_01.

// Defaults
@Test
public void params_reconnect_01() {
    // Create.
    StoreConnection.make(loc, null);
    // Drop.
    StoreConnection.expel(loc, true);
    // Reconnect
    StoreConnection.make(loc, null);
    StoreParams pLoc = StoreParamsCodec.read(loc);
    assertNull(pLoc);
    StoreParams pDB = StoreConnection.getExisting(loc).getBaseDataset().getConfig().params;
    assertNotNull(pDB);
    // Should be the default setup.
    assertTrue(StoreParams.sameValues(pDft, pDB));
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) Test(org.junit.Test) ConfigTest(org.apache.jena.tdb.ConfigTest) BaseTest(org.apache.jena.atlas.junit.BaseTest)

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