use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestDatasetAccessorHTTP method test_404_1.
@Test
public void test_404_1() {
// Not the right service.
DatasetAccessor du = DatasetAccessorFactory.createHTTP(datasetURI_not_1);
Model graph = du.getModel(gn99);
assertNull(graph);
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestDatasetAccessorHTTP method post_03.
@Test
public void post_03() {
DatasetAccessor du = connectToDataset();
du.putModel(model1);
// POST appends
du.add(model2);
Model graph = du.getModel();
Model graph3 = ModelFactory.createDefaultModel();
graph3.add(model1);
graph3.add(model2);
assertFalse(graph.isIsomorphicWith(model1));
assertFalse(graph.isIsomorphicWith(model2));
assertTrue(graph.isIsomorphicWith(graph3));
// Empty it.
du.deleteDefault();
graph = du.getModel();
assertTrue(graph.isEmpty());
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestDatasetAccessorHTTP method put_01.
@Test
public void put_01() {
DatasetAccessor du = connectToService();
du.putModel(model1);
Model graph = du.getModel();
assertTrue(graph.isIsomorphicWith(model1));
// Empty it.
du.deleteDefault();
graph = du.getModel();
assertTrue(graph.isEmpty());
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestDatasetAccessorHTTP method get_02.
@Test
public void get_02() {
DatasetAccessor du = connectToService();
Model graph = du.getModel(gn1);
assertNull(graph);
}
use of org.apache.jena.query.DatasetAccessor in project jena by apache.
the class TestDatasetAccessorHTTP method head_02.
@Test
public void head_02() {
DatasetAccessor du = connectToService();
du.putModel(gn1, model1);
boolean exists = du.containsModel(gn1);
assertTrue(exists);
exists = du.containsModel(gn2);
assertFalse("Expected gn2 not to exist (1)", exists);
exists = du.containsModel(gn2);
assertFalse("Expected gn2 not to exist (2)", exists);
// Clearup
du.deleteModel(gn1);
}
Aggregations