Package org.apache.marmotta.commons.sesame.facading.builder.model

Examples of org.apache.marmotta.commons.sesame.facading.builder.model.ExampleFacade


    }

    @Test
    public void testPredicateBuilder() throws RepositoryException {
        final URI u = connection.getValueFactory().createURI("http://localhost/repository/testResource1");
        ExampleFacade f = facading.createFacade(u, ExampleFacade.class);

        String title = "Example Title";
        Set<String> tags = new HashSet<String>();
        tags.add("Foo");
        tags.add("Bar");

        f.setTitle(title);
        f.setTags(tags);

        checkStatement(u, ExampleFacade.NS + "title", title);
        checkStatement(u, ExampleFacade.NS + "tag", "Foo");
        checkStatement(u, ExampleFacade.NS + "tag", "Bar");

        Assert.assertEquals(f.getTitle(), title);
        Assert.assertThat(f.getTags(), allOf(hasItem("Foo"), hasItem("Bar")));

        f.addTag("FooBar");
        checkStatement(u, ExampleFacade.NS + "tag", "FooBar");
        Assert.assertThat(f.getTags(), allOf(hasItem("FooBar"), hasItem("Foo"), hasItem("Bar")));

    }
View Full Code Here


    }

    @Test
    public void testPredicateBuilder() throws RepositoryException {
        final URI u = connection.getValueFactory().createURI("http://localhost/repository/testResource1");
        ExampleFacade f = facading.createFacade(u, ExampleFacade.class);

        String title = "Example Title";
        Set<String> tags = new HashSet<String>();
        tags.add("Foo");
        tags.add("Bar");

        f.setTitle(title);
        f.setTags(tags);

        checkStatement(u, ExampleFacade.NS + "title", title);
        checkStatement(u, ExampleFacade.NS + "tag", "Foo");
        checkStatement(u, ExampleFacade.NS + "tag", "Bar");

        Assert.assertEquals(f.getTitle(), title);
        Assert.assertThat(f.getTags(), allOf(hasItem("Foo"), hasItem("Bar")));

        f.addTag("FooBar");
        checkStatement(u, ExampleFacade.NS + "tag", "FooBar");
        Assert.assertThat(f.getTags(), allOf(hasItem("FooBar"), hasItem("Foo"), hasItem("Bar")));

    }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.commons.sesame.facading.builder.model.ExampleFacade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.