use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestDatasetAccessorHTTP method get_01.
@Test
public void get_01() {
DatasetAccessor du = connectToService();
Model graph = du.getModel();
assertTrue(graph.isEmpty());
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestAuth method graphstore_with_auth_02.
@Test(expected = HttpException.class)
public void graphstore_with_auth_02() {
// Incorrect auth credentials
DatasetAccessor accessor = DatasetAccessorFactory.createHTTP(authServiceREST, withBasicAuth(ANY, "allowed", "incorrect"));
accessor.getModel();
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestFileUpload method dataset_accessor_02.
@Test
public void dataset_accessor_02() {
FileSender x = new FileSender(ServerCtl.urlDataset());
x.add("D.nq", "<http://example/s> <http://example/p> <http://example/o-456> <http://example/g> .", "application/n-quads");
x.send("PUT");
DatasetAccessor du = DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP());
Model m = du.getModel("http://example/g");
assertEquals(1, m.size());
m = du.getModel();
assertEquals(0, m.size());
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestAuth method graphstore_with_auth_01.
@Test(expected = HttpException.class)
public void graphstore_with_auth_01() {
// No auth credentials
DatasetAccessor accessor = DatasetAccessorFactory.createHTTP(authServiceREST);
accessor.getModel();
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestFileUpload method upload_gsp_02.
@Test
public void upload_gsp_02() {
FileSender x = new FileSender(ServerCtl.serviceGSP() + "?default");
x.add("D.ttl", "<http://example/s> <http://example/p> 123 .", "text/turtle");
x.add("D.nt", "<http://example/s> <http://example/p> <http://example/o-456> .", "application/n-triples");
x.send("PUT");
// BUG
DatasetAccessor du = DatasetAccessorFactory.createHTTP(ServerCtl.serviceGSP());
Model m = du.getModel();
assertEquals(2, m.size());
}
Aggregations