use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperURLtoFile.
public void testLocationMapperURLtoFile() {
LocationMapper locMap = new LocationMapper(mapping);
String alt = locMap.altMapping("http://example.org/file");
assertNotNull(alt);
assertEquals(alt, "file:" + testingDir + "/location-mapping-test-file");
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperToModel2.
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 testLocationMapperEquals1.
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 testLocationMapper.
public void testLocationMapper() {
LocationMapper locMap = new LocationMapper(mapping);
String alt = locMap.altMapping(filename1);
assertNotNull(alt);
assertEquals(alt, filename2);
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperClone2.
@Test
public void testLocationMapperClone2() {
LocationMapper locMap1 = new LocationMapper(mapping);
// See testLocationMapperURLtoFile
// String alt = locMap.altMapping("http://example.org/file") ;
// assertNotNull(alt) ;
// assertEquals(alt, "file:"+testingDir+"/location-mapping-test-file") ;
LocationMapper locMap2 = new LocationMapper(locMap1);
// Change this one
locMap2.addAltPrefix("http://example.org/OTHER", "file:OTHER");
{
String alt = locMap2.altMapping("http://example.org/OTHER/f");
assertNotNull(alt);
assertEquals("file:OTHER/f", alt);
}
// Not the other
{
String alt = locMap1.altMapping("http://example.org/OTHER/f");
assertNotNull(alt);
// Did not change
assertEquals("http://example.org/OTHER/f", alt);
}
}
Aggregations