Search in sources :

Example 1 with DatasetControlMRSW

use of org.apache.jena.tdb.sys.DatasetControlMRSW in project jena by apache.

the class TestPrefixMappingTDB method persistent2.

// Persistent.
@Test
public void persistent2() {
    String dir = ConfigTest.getTestingDir();
    FileOps.clearDirectory(dir);
    DatasetPrefixesTDB prefixes = createTesting(Location.create(dir), new DatasetControlMRSW());
    PrefixMapping pmap1 = prefixes.getPrefixMapping();
    pmap1.setNsPrefix("x", "http://foo/");
    prefixes.close();
    prefixes = createTesting(Location.create(dir), new DatasetControlMRSW());
    assertEquals("http://foo/", pmap1.getNsPrefixURI("x"));
    prefixes.close();
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) DatasetControlMRSW(org.apache.jena.tdb.sys.DatasetControlMRSW) DatasetPrefixesTDB(org.apache.jena.tdb.store.DatasetPrefixesTDB) ConfigTest(org.apache.jena.tdb.ConfigTest)

Example 2 with DatasetControlMRSW

use of org.apache.jena.tdb.sys.DatasetControlMRSW in project jena by apache.

the class TestPrefixMappingTDB method persistent1.

// Persistent.
@Test
public void persistent1() {
    String dir = ConfigTest.getTestingDir();
    FileOps.clearDirectory(dir);
    DatasetPrefixesTDB prefixes = createTesting(Location.create(dir), new DatasetControlMRSW());
    PrefixMapping pmap1 = prefixes.getPrefixMapping();
    String x = pmap1.getNsPrefixURI("x");
    assertNull(x);
    prefixes.close();
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) DatasetControlMRSW(org.apache.jena.tdb.sys.DatasetControlMRSW) DatasetPrefixesTDB(org.apache.jena.tdb.store.DatasetPrefixesTDB) ConfigTest(org.apache.jena.tdb.ConfigTest)

Example 3 with DatasetControlMRSW

use of org.apache.jena.tdb.sys.DatasetControlMRSW in project jena by apache.

the class TestPrefixMappingTDB1 method persistent1.

// Persistent.
@Test
public void persistent1() {
    String dir = ConfigTest.getTestingDir();
    FileOps.clearDirectory(dir);
    DatasetPrefixesTDB prefixes = createTesting(Location.create(dir), new DatasetControlMRSW());
    PrefixMapping pmap1 = getPrefixMapping();
    String x = pmap1.getNsPrefixURI("x");
    assertNull(x);
    prefixes.close();
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) DatasetControlMRSW(org.apache.jena.tdb.sys.DatasetControlMRSW) DatasetPrefixesTDB(org.apache.jena.tdb.store.DatasetPrefixesTDB) ConfigTest(org.apache.jena.tdb.ConfigTest)

Example 4 with DatasetControlMRSW

use of org.apache.jena.tdb.sys.DatasetControlMRSW in project jena by apache.

the class TestPrefixMappingTDB1 method persistent2.

// Persistent.
@Test
public void persistent2() {
    String dir = ConfigTest.getTestingDir();
    FileOps.clearDirectory(dir);
    DatasetPrefixesTDB prefixes = createTesting(Location.create(dir), new DatasetControlMRSW());
    PrefixMapping pmap1 = getPrefixMapping();
    pmap1.setNsPrefix("x", "http://foo/");
    prefixes.close();
    prefixes = createTesting(Location.create(dir), new DatasetControlMRSW());
    PrefixMapping pmap2 = getPrefixMapping();
    String uri = pmap2.getNsPrefixURI("x");
    assertEquals("http://foo/", uri);
    prefixes.close();
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) DatasetControlMRSW(org.apache.jena.tdb.sys.DatasetControlMRSW) DatasetPrefixesTDB(org.apache.jena.tdb.store.DatasetPrefixesTDB) ConfigTest(org.apache.jena.tdb.ConfigTest)

Aggregations

PrefixMapping (org.apache.jena.shared.PrefixMapping)4 ConfigTest (org.apache.jena.tdb.ConfigTest)4 DatasetPrefixesTDB (org.apache.jena.tdb.store.DatasetPrefixesTDB)4 DatasetControlMRSW (org.apache.jena.tdb.sys.DatasetControlMRSW)4