Commit 50279337 authored by Christian Willms's avatar Christian Willms
Browse files

Using Junit4 instead of Junit5 for ISum*Test

parent fa804739
package de.dfki.lt.hfc;
import de.dfki.lt.hfc.runnable.Utils;
import org.junit.After;
import org.junit.Before;
import org.junit.jupiter.api.Test;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static de.dfki.lt.hfc.runnable.Utils.checkResult;
import static de.dfki.lt.hfc.TestUtils.checkResult;
public class ISumOneTest {
static ForwardChainer fc;
private static String getResource(String name) {
return Utils.getTestResource("ISum1", name);
return TestUtils.getTestResource("ISum1", name);
}
@Before
@BeforeClass
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
......@@ -76,7 +75,7 @@ public class ISumOneTest {
checkResult(expected, bt, bt.getVars());
}
@After
@AfterClass
public static void finish() {
fc.shutdownNoExit();
}
......
package de.dfki.lt.hfc;
import static org.junit.Assert.*;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static de.dfki.lt.hfc.TestUtils.checkResult;
......@@ -16,22 +16,21 @@ public class ISumTwoTest {
private static String getResource(String name) {
return TestUtils.getTestResource("ISum2", name);
}
@BeforeAll
@BeforeClass
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("isum.nt"), // tuple file
getResource("isum.rdl"), // rule file
getResource("isum.ns") // namespace file
);
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("isum.nt"), // tuple file
getResource("isum.rdl"), // rule file
getResource("isum.ns") // namespace file
);
// compute deductive closure
......@@ -44,41 +43,42 @@ public class ISumTwoTest {
// TODO: FIX EXPECTED DATA
String[][] expected = {
{ "<test:sri>", "<test:hasName>", "\"SRI\"^^<xsd:string>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce24", "<test:numberOfEmployees>", "\"61000\"^^<xsd:int>" },
{ "<owl:Thing>", "<rdf:type>", "<owl:Class>" },
{ "<test:sri>", "<test:numberOfEmployees>", "\"1000\"^^<xsd:int>" },
{ "<xsd:int>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:Company>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:db>", "<test:numberOfEmployees>", "\"60000\"^^<xsd:int>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce22", "<test:numberOfEmployees>", "\"60500\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI\"^^<xsd:string>" },
{ "<test:sri>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasName>", "\"Deutsches Forschungszentrum für Künstliche Intelligenz\"@de" },
{ "<owl:Thing>", "<owl:disjointWith>", "<owl:Nothing>" },
{ "<test:db>", "<rdf:type>", "<test:Company>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce25", "<test:numberOfEmployees>", "\"60500\"^^<xsd:int>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce21", "<test:numberOfEmployees>", "\"1500\"^^<xsd:int>" },
{ "<owl:Nothing>", "<rdf:type>", "<owl:Class>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce23", "<test:numberOfEmployees>", "\"1500\"^^<xsd:int>" },
{ "<test:sri>", "<test:hasName>", "\"Stanford Research Institute\"^^<xsd:string>" },
{ "<test:dfki>", "<rdf:type>", "<test:Company>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce20", "<test:numberOfEmployees>", "\"61000\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI GmbH\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:dfki>", "<test:hasName>", "\"German Research Center for Artificial Inteligence\"@en" },
{ "<test:db>", "<test:hasName>", "\"Daimler Benz\"^^<xsd:string>" },
{ "<xsd:string>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:adder>", "<rdf:type>", "<owl:Thing>" },
{ "<test:dfki>", "<test:numberOfEmployees>", "\"500\"^^<xsd:int>" },
{ "<test:sri>", "<test:hasName>", "\"SRI\"^^<xsd:string>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce24", "<test:numberOfEmployees>", "\"61000\"^^<xsd:int>" },
{ "<owl:Thing>", "<rdf:type>", "<owl:Class>" },
{ "<test:sri>", "<test:numberOfEmployees>", "\"1000\"^^<xsd:int>" },
{ "<xsd:int>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:Company>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:db>", "<test:numberOfEmployees>", "\"60000\"^^<xsd:int>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce22", "<test:numberOfEmployees>", "\"60500\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI\"^^<xsd:string>" },
{ "<test:sri>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasName>", "\"Deutsches Forschungszentrum für Künstliche Intelligenz\"@de" },
{ "<owl:Thing>", "<owl:disjointWith>", "<owl:Nothing>" },
{ "<test:db>", "<rdf:type>", "<test:Company>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce25", "<test:numberOfEmployees>", "\"60500\"^^<xsd:int>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce21", "<test:numberOfEmployees>", "\"1500\"^^<xsd:int>" },
{ "<owl:Nothing>", "<rdf:type>", "<owl:Class>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce23", "<test:numberOfEmployees>", "\"1500\"^^<xsd:int>" },
{ "<test:sri>", "<test:hasName>", "\"Stanford Research Institute\"^^<xsd:string>" },
{ "<test:dfki>", "<rdf:type>", "<test:Company>" },
{ "_:de.dfki.lt.hfc.ForwardChainer@45283ce20", "<test:numberOfEmployees>", "\"61000\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI GmbH\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:dfki>", "<test:hasName>", "\"German Research Center for Artificial Inteligence\"@en" },
{ "<test:db>", "<test:hasName>", "\"Daimler Benz\"^^<xsd:string>" },
{ "<xsd:string>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:adder>", "<rdf:type>", "<owl:Thing>" },
{ "<test:dfki>", "<test:numberOfEmployees>", "\"500\"^^<xsd:int>" },
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
//TestUtils.printExpected(bt, fc.tupleStore); // TODO: THIS SHOULD BE REMOVED WHEN FINISHED
checkResult(expected, bt, bt.getVars());
}
@AfterAll
@AfterClass
public static void finish() {
fc.shutdownNoExit();
}
......@@ -89,4 +89,3 @@ public class ISumTwoTest {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment