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()); }
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); }
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); }
public void testBulkRemoveSelf() { Model m = modelWithStatements("they sing together; he sings alone"); m.remove(m); assertEquals("", 0, m.size()); }