From 90b13b773dc690b44e4fb9472822368739b5c4a1 Mon Sep 17 00:00:00 2001 From: Luigi Asprino Date: Wed, 21 Jun 2023 07:23:40 +0200 Subject: [PATCH] #385 --- .../sparqlanything/testutils/TestUtils.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sparql-anything-testutils/src/main/java/io/github/sparqlanything/testutils/TestUtils.java b/sparql-anything-testutils/src/main/java/io/github/sparqlanything/testutils/TestUtils.java index 6cb8e05c..bead463f 100644 --- a/sparql-anything-testutils/src/main/java/io/github/sparqlanything/testutils/TestUtils.java +++ b/sparql-anything-testutils/src/main/java/io/github/sparqlanything/testutils/TestUtils.java @@ -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 it = left.find(); + + logger.debug(">> Test expected items are also in result"); + Iterator 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); } } }