Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-asprino committed Jun 21, 2023
1 parent 960733a commit 90b13b7
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,24 @@ public static void printDebugDiff(Graph expected, Graph result) {
}
}

public static void printDebugDiff(DatasetGraph left, DatasetGraph right) {
public static void printDebugDiff(DatasetGraph expected, DatasetGraph result) {
if (logger.isDebugEnabled()) {
Iterator<Quad> it = left.find();

logger.debug(">> Test expected items are also in result");
Iterator<Quad> it = expected.find();
while (it.hasNext()) {
Quad q = it.next();
logger.trace(">> {}", q);

if (!right.contains(q)) {
logger.debug(">> {} not found in right", q);
logger.debug(">> (T) {} {} {} {} {}", q.getSubject().getClass().getSimpleName(), q.getPredicate().getClass().getSimpleName(), q.getObject().getClass().getSimpleName(), (q.getObject().isLiteral() && q.getObject().getLiteralDatatypeURI() != null) ? q.getObject().getLiteralDatatypeURI() : "", q.getGraph().getClass().getSimpleName());
if (!result.contains(q)) {
logger.debug(">> {} not found in expected", q);
}
}
it = right.find();

logger.debug(">> Test result items are also in expected");
it = result.find();
while (it.hasNext()) {
Quad t = it.next();
logger.trace("<< {}", t);
if (!left.contains(t)) {
logger.debug("<< {} not found in left", t);
logger.debug("<< (T) {} {} {} {} {}", t.getSubject().getClass().getSimpleName(), t.getPredicate().getClass().getSimpleName(), t.getObject().getClass().getSimpleName(), (t.getObject().isLiteral() && t.getObject().getLiteralDatatypeURI() != null) ? t.getObject().getLiteralDatatypeURI() : "", t.getGraph().getClass().getSimpleName());
if (!expected.contains(t)) {
logger.debug("<< {} not found in result", t);
}
}
}
Expand Down

0 comments on commit 90b13b7

Please sign in to comment.