Search in sources :

Example 6 with StoreParams

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

the class TestStoreParamsCreate method params_create_02.

@Test
public void params_create_02() {
    StoreConnection.make(loc, pApp);
    // Check.  Custom setup.
    assertTrue("DB directory", Files.exists(db));
    assertTrue("Config file not found", Files.exists(cfg));
    StoreParams pLoc = StoreParamsCodec.read(loc);
    assertTrue(StoreParams.sameValues(pLoc, pApp));
}
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)

Example 7 with StoreParams

use of org.apache.jena.tdb.setup.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;
}
Also used : StoreParams(org.apache.jena.tdb.setup.StoreParams) JsonObject(org.apache.jena.atlas.json.JsonObject)

Example 8 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_persist_2.

@Test
public void params_choose_new_persist_2() {
    // new database, location defined.
    Location loc = Location.create(DIR);
    FileOps.clearAll(loc.getDirectoryPath());
    StoreParamsCodec.write(loc, pLoc);
    // Clear.
    StoreParams p = Build.decideStoreParams(loc, true, null, 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);
    assertTrue(StoreParams.sameValues(pLoc, 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 9 with StoreParams

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

the class TestStoreParamsChoose method params_choose_new_3.

@Test
public void params_choose_new_3() {
    StoreParams p = Build.decideStoreParams(Location.mem(), true, null, pLoc, pDft);
    // New store, pLoc, no pApp, so pLoc is the entire settings.
    assertEquals(0, p.getBlockSize().intValue());
    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 10 with StoreParams

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

the class TestStoreParamsChoose method params_choose_existing_1.

@Test
public void params_choose_existing_1() {
    StoreParams p = Build.decideStoreParams(Location.mem(), false, null, null, pDft);
    // p is 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)

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