use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testNumPrefixes.
public void testNumPrefixes() {
String hURI = "http://test.prefixes/prefix#";
PrefixMapping A = getMapping();
assertEquals(0, A.numPrefixes());
A.setNsPrefix("hr", hURI);
assertEquals(1, A.numPrefixes());
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method getCrispyRope.
private PrefixMapping getCrispyRope() {
PrefixMapping ns = getMapping();
ns.setNsPrefix("crisp", crispURI);
ns.setNsPrefix("rope", ropeURI);
return ns;
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testNoQNameNoPrefix.
public void testNoQNameNoPrefix() {
PrefixMapping ns = getMapping();
String alphaURI = "http://seasonal.song/preamble/";
ns.setNsPrefix("alpha", alphaURI);
assertEquals(null, ns.qnameFor("eg:rowboat"));
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testAddMap.
/**
as for testAddOtherPrefixMapping, except that it's a plain Map
we're adding.
*/
public void testAddMap() {
PrefixMapping b = getMapping();
Map<String, String> map = new HashMap<>();
map.put("crisp", crispURI);
map.put("rope", ropeURI);
b.setNsPrefix("butter", butterURI);
b.setNsPrefixes(map);
checkContainsMapping(b);
}
use of org.apache.jena.shared.PrefixMapping in project jena by apache.
the class AbstractTestPrefixMapping method testSecondPrefixRetainsExistingMap.
public void testSecondPrefixRetainsExistingMap() {
PrefixMapping A = getMapping();
A.setNsPrefix("a", crispURI);
A.setNsPrefix("b", crispURI);
assertEquals(crispURI, A.getNsPrefixURI("a"));
assertEquals(crispURI, A.getNsPrefixURI("b"));
}
Aggregations