use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestFileManager method testLocationMappingURLtoFileOpen.
@Test
public void testLocationMappingURLtoFileOpen() {
LocationMapper locMap = new LocationMapper(TestLocationMapper.mapping);
FileManager fileManager = FileManager.create(locMap);
fileManager.addLocatorFile();
InputStream in = fileManager.open("http://example.org/file");
assertNotNull(in);
closeInputStream(in);
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperMiss.
@Test
public void testLocationMapperMiss() {
LocationMapper locMap = new LocationMapper(mapping);
String alt = locMap.altMapping(notFilename);
assertNotNull(alt);
assertEquals(notFilename, alt);
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperURLtoFile.
@Test
public void testLocationMapperURLtoFile() {
LocationMapper locMap = new LocationMapper(mapping);
String alt = locMap.altMapping("http://example.org/file");
assertNotNull(alt);
assertEquals("file:" + testingDir + "/location-mapping-test-file", alt);
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperToModel1.
@Test
public void testLocationMapperToModel1() {
LocationMapper locMap1 = new LocationMapper(mapping);
LocationMapper locMap2 = new LocationMapper(locMap1.toModel());
assertEquals(locMap1, locMap2);
assertEquals(locMap1.hashCode(), locMap2.hashCode());
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestLocationMapper method testLocationMapperClone1.
@Test
public void testLocationMapperClone1() {
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);
// Remove from original
locMap1.removeAltEntry("http://example.org/file");
String alt = locMap2.altMapping("http://example.org/file");
assertNotNull(alt);
assertEquals("file:" + testingDir + "/location-mapping-test-file", alt);
}
Aggregations