use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestFileManager method testLocationMappingURLtoFileOpenNotFound.
@Test
public void testLocationMappingURLtoFileOpenNotFound() {
LocationMapper locMap = new LocationMapper(TestLocationMapper.mapping);
FileManager fileManager = FileManager.create(locMap);
fileManager.addLocatorClassLoader(fileManager.getClass().getClassLoader());
try {
InputStream in = fileManager.open("http://example.org/file");
closeInputStream(in);
assertNull("Found nont-existant URL", null);
} catch (NotFoundException ex) {
}
}
use of org.apache.jena.util.LocationMapper in project jena by apache.
the class TestGenericRules method testIncludeRedirect.
/**
* Test that @include supports fileManger redirections
*/
public void testIncludeRedirect() {
assertFalse(checkIncludeFound("file:testing/reasoners/importTest.rules"));
LocationMapper lm = FileManager.getInternal().getLocationMapper();
lm.addAltEntry("file:testing/reasoners/includeAlt.rules", "file:testing/reasoners/include.rules");
assertTrue(checkIncludeFound("file:testing/reasoners/importTest.rules"));
lm.removeAltEntry("file:testing/reasoners/includeAlt.rules");
}
Aggregations