use of fr.lirmm.graphik.util.MethodNotImplementedError in project graal by graphik-team.
the class StoreTest method removeAllTest.
@Theory
public void removeAllTest(AtomSet store) throws AtomSetException, IteratorException {
// given
store.add(DlgpParser.parseAtom("<P>(b,a)."));
store.add(DlgpParser.parseAtom("<P>(a,a)."));
store.add(DlgpParser.parseAtom("<P>(b,b)."));
store.add(DlgpParser.parseAtom("<P>(a,c)."));
store.add(DlgpParser.parseAtom("<Q>(a,a)."));
store.add(DlgpParser.parseAtom("<Q>(a,b)."));
// when
try {
store.removeAll(DlgpParser.parseAtomSet("<P>(a,c), <Q>(a,a)."));
} catch (MethodNotImplementedError e) {
return;
}
// then
Assert.assertFalse(store.contains(DlgpParser.parseAtom("<P>(a,c).")));
Assert.assertFalse(store.contains(DlgpParser.parseAtom("<Q>(a,a).")));
Assert.assertEquals(3, Iterators.count(store.atomsByPredicate(new Predicate("P", 2))));
Assert.assertEquals(1, Iterators.count(store.atomsByPredicate(new Predicate("Q", 2))));
}
use of fr.lirmm.graphik.util.MethodNotImplementedError in project graal by graphik-team.
the class StoreTest method removeTest.
@Theory
public void removeTest(AtomSet store) throws AtomSetException, IteratorException {
// given
store.add(DlgpParser.parseAtom("<P>(b,a)."));
store.add(DlgpParser.parseAtom("<P>(a,a)."));
store.add(DlgpParser.parseAtom("<P>(b,b)."));
store.add(DlgpParser.parseAtom("<P>(a,c)."));
store.add(DlgpParser.parseAtom("<Q>(a,a)."));
store.add(DlgpParser.parseAtom("<Q>(a,b)."));
// when
try {
store.remove(DlgpParser.parseAtom("<P>(a,c)."));
} catch (MethodNotImplementedError e) {
return;
}
// then
Assert.assertFalse(store.contains(DlgpParser.parseAtom("<P>(a,c).")));
Assert.assertEquals(3, Iterators.count(store.atomsByPredicate(new Predicate("P", 2))));
Assert.assertEquals(2, Iterators.count(store.atomsByPredicate(new Predicate("Q", 2))));
}
Aggregations