Search in sources :

Example 1 with FileManagerAssembler

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);
}
Also used : FileManagerAssembler(org.apache.jena.assembler.assemblers.FileManagerAssembler) Resource(org.apache.jena.rdf.model.Resource) FileManagerAssembler(org.apache.jena.assembler.assemblers.FileManagerAssembler)

Example 2 with FileManagerAssembler

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);
}
Also used : FileManagerAssembler(org.apache.jena.assembler.assemblers.FileManagerAssembler) Resource(org.apache.jena.rdf.model.Resource) FileManagerAssembler(org.apache.jena.assembler.assemblers.FileManagerAssembler)

Example 3 with FileManagerAssembler

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());
}
Also used : FileManagerAssembler(org.apache.jena.assembler.assemblers.FileManagerAssembler) Resource(org.apache.jena.rdf.model.Resource) FileManagerAssembler(org.apache.jena.assembler.assemblers.FileManagerAssembler)

Aggregations

FileManagerAssembler (org.apache.jena.assembler.assemblers.FileManagerAssembler)3 Resource (org.apache.jena.rdf.model.Resource)3