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

Commit

Permalink
Extended test output if test fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzBuehmann committed Jun 27, 2019
1 parent d5e6b6c commit 7cf311c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package net.sansa_stack.test.conformance

import java.io.{File, StringWriter}
import java.nio.file.{Path, Paths}
import scala.collection.mutable

import net.sansa_stack.inference.data.{RDF, RDFOps}
import org.apache.jena.rdf.model.Model
import org.apache.jena.shared.PrefixMapping
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{BeforeAndAfterAll, FlatSpec}
import scala.collection.mutable

import net.sansa_stack.test.conformance.TestCases.getClass
import net.sansa_stack.inference.data.{RDF, RDFOps}

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

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


val isomorph = inferredModel.isIsomorphicWith(testCase.outputGraph)
assert(isomorph)
if(!isomorph) {
println("inferred graph:")
inferredModel.write(System.out, "TURTLE")
}
assert(isomorph, "input and output are isomorph")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

/**
* The class is to test the conformance of each materialization rule of RDFS(simple) entailment.
* The base class to test the conformance of each materialization rule of RDFS(simple) entailment.
*
* @author Lorenz Buehmann
*
Expand Down

0 comments on commit 7cf311c

Please sign in to comment.