Search in sources :

Example 31 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor in project jena by apache.

the class TestAuth method graphstore_with_auth_04.

@Test(expected = HttpException.class)
public void graphstore_with_auth_04() throws URISyntaxException {
    // Correct auth credentials scoped to wrong URI
    DatasetAccessor accessor = DatasetAccessorFactory.createHTTP(authServiceREST, withBasicAuth(new AuthScope("example.org", authPort), "allowed", "password"));
    accessor.getModel();
}
Also used : AuthScope(org.apache.http.auth.AuthScope) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test)

Example 32 with DatasetAccessor

use of org.apache.jena.query.DatasetAccessor in project jena by apache.

the class TestAuth method graphstore_with_auth_05.

@Test
public void graphstore_with_auth_05() throws URISyntaxException {
    // Correct auth credentials scoped to correct URI
    DatasetAccessor accessor = DatasetAccessorFactory.createHTTP(authServiceREST, withBasicAuth(new AuthScope("localhost", authPort), "allowed", "password"));
    accessor.getModel();
}
Also used : AuthScope(org.apache.http.auth.AuthScope) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test)

Aggregations

DatasetAccessor (org.apache.jena.query.DatasetAccessor)32 Test (org.junit.Test)31 AbstractFusekiTest (org.apache.jena.fuseki.AbstractFusekiTest)21 FusekiTest (org.apache.jena.fuseki.FusekiTest)21 Model (org.apache.jena.rdf.model.Model)20 AuthScope (org.apache.http.auth.AuthScope)2