use of org.apache.jena.assembler.assemblers.FileManagerAssembler in project jena by apache.
the class TestFileManagerAssembler method testCreatesFileManagerWIthHandlers.
/**
Can't just test for equality of locators list, since locators don't support
equality. Weak hack: check that the sizes are the same. TODO improve.
*/
public void testCreatesFileManagerWIthHandlers() {
Resource root = resourceInModel("f rdf:type ja:FileManager");
Assembler a = new FileManagerAssembler();
FileManager f = (FileManager) a.open(null, root);
List<Locator> wanted = IteratorCollection.iteratorToList(standardLocators());
List<Locator> obtained = IteratorCollection.iteratorToList(f.locators());
assertEquals(wanted.size(), obtained.size());
assertEquals(wanted, obtained);
}
use of org.apache.jena.assembler.assemblers.FileManagerAssembler in project jena by apache.
the class TestFileManagerAssembler method testCreatesFileManager.
public void testCreatesFileManager() {
Resource root = resourceInModel("r rdf:type ja:FileManager");
Assembler a = new FileManagerAssembler();
Object x = a.open(root);
assertInstanceOf(FileManager.class, x);
}
use of org.apache.jena.assembler.assemblers.FileManagerAssembler in project jena by apache.
the class TestFileManagerAssembler method testCreatesFileManagerWithLocationMapper.
public void testCreatesFileManagerWithLocationMapper() {
Resource root = resourceInModel("f rdf:type ja:FileManager; f ja:locationMapper r");
LocationMapper mapper = new LocationMapper();
Assembler mock = new NamedObjectAssembler(resource("r"), mapper);
Assembler a = new FileManagerAssembler();
Object x = a.open(mock, root);
assertInstanceOf(FileManager.class, x);
assertSame(mapper, ((FileManager) x).getLocationMapper());
}
Aggregations