Search in sources :

Example 1 with Alt

use of org.apache.jena.rdf.model.Alt in project jena by apache.

the class TestContainerConstructors method testCreateNamedAlt.

public void testCreateNamedAlt() {
    final String uri = "http://aldabaran/sirius";
    final Alt tv = model.createAlt(uri);
    Assert.assertEquals(uri, tv.getURI());
    Assert.assertTrue(model.contains(tv, RDF.type, RDF.Alt));
}
Also used : Alt(org.apache.jena.rdf.model.Alt)

Example 2 with Alt

use of org.apache.jena.rdf.model.Alt in project jena by apache.

the class SecuredSeqTest method testGetAlt.

@Test
public void testGetAlt() {
    try {
        final Alt a = getSecuredSeq().getAlt(1);
        Assert.assertTrue("Should be a secured Alt", a instanceof SecuredAlt);
        if (!securityEvaluator.evaluate(Action.Read)) {
            Assert.fail("Should have thrown ReadDeniedException Exception");
        }
    } catch (final ReadDeniedException e) {
        if (securityEvaluator.evaluate(Action.Read)) {
            Assert.fail(String.format("Should not have thrown ReadDeniedException Exception: %s - %s", e, e.getTriple()));
        }
    }
}
Also used : ReadDeniedException(org.apache.jena.shared.ReadDeniedException) SecuredAlt(org.apache.jena.permissions.model.SecuredAlt) Alt(org.apache.jena.rdf.model.Alt) SecuredAlt(org.apache.jena.permissions.model.SecuredAlt) Test(org.junit.Test)

Example 3 with Alt

use of org.apache.jena.rdf.model.Alt in project jena by apache.

the class TestContainerConstructors method testCreateAnonAlt.

public void testCreateAnonAlt() {
    final Alt tv = model.createAlt();
    Assert.assertTrue(tv.isAnon());
    Assert.assertTrue(model.contains(tv, RDF.type, RDF.Alt));
}
Also used : Alt(org.apache.jena.rdf.model.Alt)

Aggregations

Alt (org.apache.jena.rdf.model.Alt)3 SecuredAlt (org.apache.jena.permissions.model.SecuredAlt)1 ReadDeniedException (org.apache.jena.shared.ReadDeniedException)1 Test (org.junit.Test)1