From 5d54af2638a53721b414a41356a93686a9616272 Mon Sep 17 00:00:00 2001 From: RncLsn Date: Tue, 19 May 2015 13:35:52 +0100 Subject: Backup before changes in MyQueryReasoner. --- .../ox/cs/pagoda/global_tests/TestPagodaLUBM.java | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java') diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java index bb58681..8cbe022 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java @@ -4,42 +4,57 @@ import org.testng.annotations.Test; import uk.ac.ox.cs.pagoda.Pagoda; import uk.ac.ox.cs.pagoda.util.TestUtil; +import java.io.File; import java.io.IOException; +import java.nio.file.Path; import java.nio.file.Paths; public class TestPagodaLUBM { - public void test(int number) throws IOException { + /** + * Just execute on LUBM 100 + */ + public static void main(String... args) { + new TestPagodaLUBM().justExecute_100(); + } + + public void answersCorrecntess(int number) throws IOException { String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); + Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); + new File(computedAnswers.toString()).deleteOnExit(); + Pagoda pagoda = Pagoda.builder() .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) + .answer(computedAnswers) .classify(true) .hermit(true) .build(); - CheckAnswersOverDataset.check(pagoda, Paths.get(ontoDir, "lubm/lubm" + number + ".json")); + pagoda.run(); + + Path givenAnswers = Paths.get(ontoDir, "lubm/lubm" + number + ".json"); + CheckAnswers.assertSameAnswers(computedAnswers, givenAnswers); } - @Test - public void test_1() throws IOException { - test(1); + @Test(groups = {"light"}) + public void answersCorrectness_1() throws IOException { + answersCorrecntess(1); } + /** + * Just execute on LUBM 100 + * */ public void justExecute_100() { int number = 100; String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); Pagoda pagoda = Pagoda.builder() .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) - .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) + .query(Paths.get(ontoDir, "lubm/queries/answersCorrectness.sparql")) .classify(true) .hermit(true) .build(); pagoda.run(); } - - public static void main(String... args) { - new TestPagodaLUBM().justExecute_100(); - } } -- cgit v1.2.3