Exemplo n.º 1
0
 public void testBulkByModel(Model m) {
   assertEquals("precondition: model must be empty", 0, m.size());
   Model A = modelWithStatements("clouds offer rain; trees offer shelter");
   Model B = modelWithStatements("x R y; y Q z; z P x");
   m.add(A);
   assertIsoModels(A, m);
   m.add(B);
   m.remove(A);
   assertIsoModels(B, m);
   m.remove(B);
   assertEquals("", 0, m.size());
 }
Exemplo n.º 2
0
 public void testMBU(Model m) {
   Statement[] sArray = statements(m, "moon orbits earth; earth orbits sun");
   List<Statement> sList = Arrays.asList(statements(m, "I drink tea; you drink coffee"));
   m.add(sArray);
   testContains(m, sArray);
   m.add(sList);
   testContains(m, sList);
   testContains(m, sArray);
   /* */
   m.remove(sArray);
   testOmits(m, sArray);
   testContains(m, sList);
   m.remove(sList);
   testOmits(m, sArray);
   testOmits(m, sList);
 }
Exemplo n.º 3
0
 public void testBulkDeleteByModelReifying(boolean suppress) {
   Model target = modelWithStatements(ReificationStyle.Minimal, "");
   addReification(target, "x", "S P O");
   addReification(target, "y", "A P B");
   Model remove = modelWithStatements("");
   addReification(remove, "y", "A P B");
   Model answer = modelWithStatements("");
   addReification(answer, "x", "S P O");
   if (suppress) addReification(answer, "y", "A P B");
   target.remove(remove, suppress);
   assertIsoModels(answer, target);
 }
Exemplo n.º 4
0
 public void testBulkRemoveSelf() {
   Model m = modelWithStatements("they sing together; he sings alone");
   m.remove(m);
   assertEquals("", 0, m.size());
 }