use of org.apache.jena.shared.PrefixMapping 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();
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class TestPrefixMappingTDB method multiple2.
@Test
public void multiple2() {
DatasetPrefixesTDB prefixes = createTestingMem();
// Same
PrefixMapping pmap1 = prefixes.getPrefixMapping("http://graph/");
PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/");
pmap1.setNsPrefix("x", "http://foo/");
assertNotNull(pmap2.getNsPrefixURI("x"));
assertNotNull(pmap1.getNsPrefixURI("x"));
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class TestPrefixMappingTDB method multiple1.
@Test
public void multiple1() {
DatasetPrefixesTDB prefixes = createTestingMem();
PrefixMapping pmap1 = prefixes.getPrefixMapping();
PrefixMapping pmap2 = prefixes.getPrefixMapping("http://graph/");
pmap1.setNsPrefix("x", "http://foo/");
assertNull(pmap2.getNsPrefixURI("x"));
assertNotNull(pmap1.getNsPrefixURI("x"));
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testRemovePrefix.
public void testRemovePrefix() {
String hURI = "http://test.remove.prefixes/prefix#";
String bURI = "http://other.test.remove.prefixes/prefix#";
PrefixMapping A = getMapping();
A.setNsPrefix("hr", hURI);
A.setNsPrefix("br", bURI);
A.removeNsPrefix("hr");
assertEquals(null, A.getNsPrefixURI("hr"));
assertEquals(bURI, A.getNsPrefixURI("br"));
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testClear.
public void testClear() {
String hURI = "http://test.remove.prefixes/prefix#";
String bURI = "http://other.test.remove.prefixes/prefix#";
PrefixMapping A = getMapping();
A.setNsPrefix("hr", hURI);
A.setNsPrefix("br", bURI);
A.clearNsPrefixMap();
assertEquals(null, A.getNsPrefixURI("hr"));
assertEquals(null, A.getNsPrefixURI("br"));
assertEquals(null, A.getNsURIPrefix(hURI));
assertEquals(null, A.getNsURIPrefix(bURI));
}
Aggregations