aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
diff options
context:
space:
mode:
authorRncLsn <rnc.lsn@gmail.com>2015-05-20 18:52:47 +0100
committerRncLsn <rnc.lsn@gmail.com>2015-05-20 18:52:47 +0100
commitd81b086fe329fa69891eba0a4b1f73e44183620d (patch)
tree7c55c80678660cdbd3dae18e94c4baf5b0680e11 /test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
parent7a68441a541b12b22587fb53072193e1130049ff (diff)
downloadACQuA-d81b086fe329fa69891eba0a4b1f73e44183620d.tar.gz
ACQuA-d81b086fe329fa69891eba0a4b1f73e44183620d.zip
Added more tests.
Querying of the upper bound is currently unstable.
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java')
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java31
1 files changed, 9 insertions, 22 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
index 0956ee8..558ac1f 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
@@ -13,7 +13,7 @@ import java.nio.file.Paths;
13public class TestPagodaUOBM { 13public class TestPagodaUOBM {
14 14
15 private static final int N_1 = 1; 15 private static final int N_1 = 1;
16 private static final int N_2 = 10; 16 private static final int N_2 = 4;
17 17
18 @DataProvider(name = "UOBMNumbers") 18 @DataProvider(name = "UOBMNumbers")
19 private static Object[][] UOBMNumbers() { 19 private static Object[][] UOBMNumbers() {
@@ -23,42 +23,29 @@ public class TestPagodaUOBM {
23 return integers; 23 return integers;
24 } 24 }
25 25
26 public void answersCorrectness(int number) throws IOException {
27 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
28 Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
29 new File(computedAnswers.toString()).deleteOnExit();
30
31 Pagoda pagoda = Pagoda.builder()
32 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
33 .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"))
34 .query(Paths.get(ontoDir, "uobm/queries/test.sparql"))
35 .answer(computedAnswers)
36 .classify(true)
37 .hermit(true)
38 .build();
39 pagoda.run();
40
41 // TODO use HermitReasoner for computing correct answers if they are missing
42 String given_answers = "uobm/uobm" + number + ".json";
43 CheckAnswers.assertSameAnswers(computedAnswers, Paths.get(ontoDir, given_answers));
44 }
45
46 @Test(groups = {"light"}) 26 @Test(groups = {"light"})
47 public void answersCorrectness_1() throws IOException { 27 public void answersCorrectness_1() throws IOException {
48 answersCorrectness(1); 28 answersCorrectness(1);
49 } 29 }
50 30
51 @Test(groups = {"heavy"}, dataProvider = "UOBMNumbers") 31 @Test(groups = {"heavy"}, dataProvider = "UOBMNumbers")
52 public void justExecute(int number) { 32 public void answersCorrectness(int number) throws IOException {
53 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 33 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
34 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
35 new File(answers.toString()).deleteOnExit();
36 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-uobm" + number + ".json");
37
54 Pagoda pagoda = Pagoda.builder() 38 Pagoda pagoda = Pagoda.builder()
55 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) 39 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
56 .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) 40 .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"))
57 .query(Paths.get(ontoDir, "uobm/queries/test.sparql")) 41 .query(Paths.get(ontoDir, "uobm/queries/test.sparql"))
42 .answer(answers)
58 .classify(true) 43 .classify(true)
59 .hermit(true) 44 .hermit(true)
60 .build(); 45 .build();
46
61 pagoda.run(); 47 pagoda.run();
48 CheckAnswers.assertSameAnswers(answers, givenAnswers);
62 } 49 }
63 50
64} 51}