Search in sources :

Example 1 with Mode

use of org.apache.jena.assembler.Mode in project jena by apache.

the class TestAssemblerGroup method testPassesSelfIn.

public void testPassesSelfIn() {
    final AssemblerGroup group = AssemblerGroup.create();
    final Object result = new Object();
    Assembler fake = new AssemblerBase() {

        @Override
        public Object open(Assembler a, Resource root, Mode irrelevant) {
            assertSame("nested call should pass in assembler group:", group, a);
            return result;
        }
    };
    group.implementWith(JA.Object, fake);
    assertSame(result, group.open(resourceInModel("x rdf:type ja:Object")));
}
Also used : Mode(org.apache.jena.assembler.Mode) Resource(org.apache.jena.rdf.model.Resource) ExpandingAssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup) AssemblerGroup(org.apache.jena.assembler.assemblers.AssemblerGroup) Assembler(org.apache.jena.assembler.Assembler) InfModelAssembler(org.apache.jena.assembler.assemblers.InfModelAssembler) AssemblerBase(org.apache.jena.assembler.assemblers.AssemblerBase)

Example 2 with Mode

use of org.apache.jena.assembler.Mode in project jena by apache.

the class TestMode method testConstantsExist.

public void testConstantsExist() {
    Mode a = Mode.CREATE, b = Mode.DEFAULT;
    Mode c = Mode.REUSE, d = Mode.ANY;
    assertDiffer(Mode.CREATE, Mode.DEFAULT);
    assertDiffer(Mode.CREATE, Mode.REUSE);
    assertDiffer(Mode.CREATE, Mode.ANY);
    assertDiffer(Mode.DEFAULT, Mode.REUSE);
    assertDiffer(Mode.DEFAULT, Mode.ANY);
    assertDiffer(Mode.REUSE, Mode.ANY);
}
Also used : Mode(org.apache.jena.assembler.Mode)

Aggregations

Mode (org.apache.jena.assembler.Mode)2 Assembler (org.apache.jena.assembler.Assembler)1 AssemblerBase (org.apache.jena.assembler.assemblers.AssemblerBase)1 AssemblerGroup (org.apache.jena.assembler.assemblers.AssemblerGroup)1 ExpandingAssemblerGroup (org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup)1 InfModelAssembler (org.apache.jena.assembler.assemblers.InfModelAssembler)1 Resource (org.apache.jena.rdf.model.Resource)1