use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperToModel2.
@Test
public void testLocationMapperToModel2() {
LocationMapper locMap1 = new LocationMapper(mapping);
LocationMapper locMap2 = new LocationMapper(mapping);
locMap1 = new LocationMapper(locMap1.toModel());
locMap2.addAltEntry("file:nowhere", "file:somewhere");
assertFalse(locMap1.equals(locMap2));
assertFalse(locMap2.equals(locMap1));
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapper.
@Test
public void testLocationMapper() {
LocationMapper locMap = new LocationMapper(mapping);
String alt = locMap.altMapping(filename1);
assertNotNull(alt);
assertEquals(filename2, alt);
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperEquals1.
@Test
public void testLocationMapperEquals1() {
LocationMapper locMap1 = new LocationMapper(mapping);
LocationMapper locMap2 = new LocationMapper(mapping);
assertEquals(locMap1, locMap2);
assertEquals(locMap1.hashCode(), locMap2.hashCode());
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperFromModel.
@Test
public void testLocationMapperFromModel() {
Model model = RDFDataMgr.loadModel(testingDir + "/location-mapping-test.ttl");
LocationMapper loc = new LocationMapper(model);
// Light test that the two location mappers are "the same"
LocationMapper locMap = new LocationMapper(mapping);
for (Iterator<String> iter = loc.listAltEntries(); iter.hasNext(); ) {
String e = iter.next();
String v1 = locMap.getAltEntry(e);
String v2 = loc.getAltEntry(e);
assertEquals("Different entries", v1, v2);
}
for (Iterator<String> iter = loc.listAltPrefixes(); iter.hasNext(); ) {
String e = iter.next();
String v1 = locMap.getAltPrefix(e);
String v2 = loc.getAltPrefix(e);
assertEquals("Different entries", v1, v2);
}
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperEquals2.
@Test
public void testLocationMapperEquals2() {
LocationMapper locMap1 = new LocationMapper(mapping);
LocationMapper locMap2 = new LocationMapper(mapping);
locMap2.addAltEntry("file:nowhere", "file:somewhere");
assertFalse(locMap1.equals(locMap2));
assertFalse(locMap2.equals(locMap1));
}
Aggregations