Search in sources :

Example 26 with DatasetAccessor

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

the class TestDatasetAccessorHTTP method delete_01.

@Test
public void delete_01() {
    DatasetAccessor du = connectToService();
    du.deleteDefault();
}
Also used : DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 27 with DatasetAccessor

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

the class TestDatasetAccessorHTTP method get_03.

// Dataset direct, not using the service endpoint.  
@Test
public void get_03() {
    DatasetAccessor du = connectToDataset();
    Model graph = du.getModel();
    assertTrue(graph.isEmpty());
}
Also used : Model(org.apache.jena.rdf.model.Model) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 28 with DatasetAccessor

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

the class TestDatasetAccessorHTTP method delete_04.

@Test
public void delete_04() {
    DatasetAccessor du = connectToDataset();
    du.deleteModel(gn1);
    boolean exists = du.containsModel(gn1);
    assertFalse("Expected gn1 not to exist", exists);
}
Also used : DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 29 with DatasetAccessor

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

the class TestDatasetAccessorHTTP method put_04.

@Test
public void put_04() {
    DatasetAccessor du = connectToDataset();
    du.putModel(model1);
    Model graph = du.getModel();
    assertTrue(graph.isIsomorphicWith(model1));
    // Empty it.
    du.deleteDefault();
    graph = du.getModel();
    assertTrue(graph.isEmpty());
}
Also used : Model(org.apache.jena.rdf.model.Model) DatasetAccessor(org.apache.jena.query.DatasetAccessor) Test(org.junit.Test) AbstractFusekiTest(org.apache.jena.fuseki.AbstractFusekiTest) FusekiTest(org.apache.jena.fuseki.FusekiTest)

Example 30 with DatasetAccessor

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

the class TestAuth method graphstore_with_auth_03.

@Test
public void graphstore_with_auth_03() {
    // Correct auth credentials
    DatasetAccessor accessor = DatasetAccessorFactory.createHTTP(authServiceREST, withBasicAuth(ANY, "allowed", "password"));
    Model m = accessor.getModel();
    Assert.assertTrue(m.isEmpty());
}
Also used : Model(org.apache.jena.rdf.model.Model) 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