Search in sources :

Example 1 with StatementComparator

use of net.fortytwo.sesametools.StatementComparator in project blueprints by tinkerpop.

the class PropertyGraphSailTest method assertExpected.

private void assertExpected(final Collection<Statement> graph, final Statement... expectedStatements) throws Exception {
    Set<Statement> expected = new TreeSet<Statement>(new StatementComparator());
    for (Statement st : expectedStatements) {
        expected.add(st);
    }
    Set<Statement> actual = new TreeSet<Statement>(new StatementComparator());
    for (Statement st : graph) {
        actual.add(st);
    }
    for (Statement t : expected) {
        if (!actual.contains(t)) {
            fail("expected statement not found: " + t);
        }
    }
    for (Statement t : actual) {
        if (!expected.contains(t)) {
            fail("unexpected statement found: " + t);
        }
    }
}
Also used : TreeSet(java.util.TreeSet) Statement(org.openrdf.model.Statement) StatementComparator(net.fortytwo.sesametools.StatementComparator)

Aggregations

TreeSet (java.util.TreeSet)1 StatementComparator (net.fortytwo.sesametools.StatementComparator)1 Statement (org.openrdf.model.Statement)1