Facading facading = FacadingFactory.createFacading(connectionRDF);
// test individual resource
URI u_hans_meier = connectionRDF.getValueFactory().createURI("http://localhost:8080/LMF/resource/hans_meier");
Person hans_meier = facading.createFacade(u_hans_meier,Person.class);
Assert.assertNull(hans_meier.getNick());
// set nick name and check if it is now set
hans_meier.setNick("hansi");
Assert.assertNotNull(hans_meier.getNick());
Assert.assertEquals("hansi",hans_meier.getNick());
// check in triple store if the triple is there
URI p_foaf_nick = connectionRDF.getValueFactory().createURI(Namespaces.NS_FOAF + "nick");
RepositoryResult<Statement> nicknames = connectionRDF.getStatements(u_hans_meier,p_foaf_nick,null,true);
Assert.assertTrue(nicknames.hasNext());
Assert.assertEquals("hansi",nicknames.next().getObject().stringValue());
nicknames.close();
// test creating a completely new resource
URI u_fritz_fischer = connectionRDF.getValueFactory().createURI("http://localhost:8080/LMF/resource/fritz_fischer");
Person fritz_fischer = facading.createFacade(u_fritz_fischer,Person.class);
fritz_fischer.setName("Fritz Fischer");
Assert.assertEquals("Fritz Fischer", fritz_fischer.getName());
// test if it is now there
URI p_foaf_name = connectionRDF.getValueFactory().createURI(Namespaces.NS_FOAF + "name");
RepositoryResult<Statement> names = connectionRDF.getStatements(u_fritz_fischer,p_foaf_name,null,true);
Assert.assertTrue(names.hasNext());