Skip to content
This repository was archived by the owner on Oct 8, 2020. It is now read-only.

Commit 7cf311c

Browse files
Extended test output if test fails.
1 parent d5e6b6c commit 7cf311c

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

sansa-inference-tests/src/test/scala/net/sansa_stack/test/conformance/ConformanceTestBase.scala

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
package net.sansa_stack.test.conformance
22

3-
import java.io.{File, StringWriter}
4-
import java.nio.file.{Path, Paths}
3+
import scala.collection.mutable
54

6-
import net.sansa_stack.inference.data.{RDF, RDFOps}
75
import org.apache.jena.rdf.model.Model
86
import org.apache.jena.shared.PrefixMapping
97
import org.junit.runner.RunWith
108
import org.scalatest.junit.JUnitRunner
119
import org.scalatest.{BeforeAndAfterAll, FlatSpec}
12-
import scala.collection.mutable
1310

14-
import net.sansa_stack.test.conformance.TestCases.getClass
11+
import net.sansa_stack.inference.data.{RDF, RDFOps}
1512

1613
/**
1714
* The class is to test the conformance of each materialization rule of RDFS(simple) entailment.
@@ -88,10 +85,19 @@ abstract class ConformanceTestBase[Rdf <: RDF](val rdfOps: RDFOps[Rdf]) extends
8885

8986
// compare models, i.e. the inferred model should contain exactly the triples of the conclusion graph
9087
val correctOutput = inferredModel.containsAll(testCase.outputGraph)
88+
if(!correctOutput) {
89+
println("Missing triples in inferred graph:")
90+
testCase.outputGraph.difference(inferredModel).write(System.out, "TURTLE")
91+
}
9192
assert(correctOutput, "contains all expected triples")
9293

94+
9395
val isomorph = inferredModel.isIsomorphicWith(testCase.outputGraph)
94-
assert(isomorph)
96+
if(!isomorph) {
97+
println("inferred graph:")
98+
inferredModel.write(System.out, "TURTLE")
99+
}
100+
assert(isomorph, "input and output are isomorph")
95101
}
96102
}
97103

sansa-inference-tests/src/test/scala/net/sansa_stack/test/conformance/RDFSConformanceTestBase.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.junit.runner.RunWith
55
import org.scalatest.junit.JUnitRunner
66

77
/**
8-
* The class is to test the conformance of each materialization rule of RDFS(simple) entailment.
8+
* The base class to test the conformance of each materialization rule of RDFS(simple) entailment.
99
*
1010
* @author Lorenz Buehmann
1111
*

0 commit comments

Comments
 (0)