use of org.apache.jena.sparql.algebra.op.OpBGP in project jena by apache.
the class OpRewriterTest method testBGPNoReadAccess.
@Test
public void testBGPNoReadAccess() {
SecurityEvaluator securityEvaluator = new MockSecurityEvaluator(true, true, false, true, true, true, true);
rewriter = new OpRewriter(securityEvaluator, "http://example.com/dummy");
Triple[] triples = { new Triple(NodeFactory.createVariable("foo"), RDF.type.asNode(), NodeFactory.createURI("http://example.com/class")), new Triple(NodeFactory.createVariable("foo"), NodeFactory.createBlankNode(), NodeFactory.createVariable("bar")), new Triple(NodeFactory.createVariable("bar"), NodeFactory.createBlankNode(), NodeFactory.createVariable("baz")) };
try {
rewriter.visit(new OpBGP(BasicPattern.wrap(Arrays.asList(triples))));
Assert.fail("Should have thrown AccessDeniedException");
} catch (ReadDeniedException e) {
// expected
}
}
Aggregations