aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java')
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java64
1 files changed, 10 insertions, 54 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
index f40e41b..29abc87 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
@@ -1,68 +1,24 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.testng.Assert;
4import org.testng.annotations.Test; 3import org.testng.annotations.Test;
5import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.util.TestUtil;
6import uk.ac.ox.cs.pagoda.tester.Statistics;
7import uk.ac.ox.cs.pagoda.util.Utility;
8 5
9import java.io.FileInputStream;
10import java.io.IOException; 6import java.io.IOException;
11import java.util.Properties; 7import java.nio.file.Paths;
12 8
13public class PagodaLUBM { 9public class PagodaLUBM {
14 10
15 public static final String CONFIG_FILE = "config/test.properties"; 11 private void testN(int number ) throws IOException {
16 12 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 private static boolean isInit = false; 13 TestGlobalCorrectness.test(Paths.get(ontoDir, "lubm/univ-bench.owl"),
18 private static String ontoDir; 14 Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"),
19 15 Paths.get(ontoDir, "lubm/queries/test.sparql"),
20 private static void init() { 16 Paths.get(ontoDir, "lubm/lubm" + number + ".ans"));
21 if(isInit) return;
22 isInit = true;
23
24 Properties config = new Properties();
25
26 try(FileInputStream in = new FileInputStream(CONFIG_FILE)) {
27 config.load(in);
28 in.close();
29 } catch (IOException e) {
30 e.printStackTrace();
31 }
32
33 ontoDir = config.getProperty("ontoDir");
34 }
35
36 private void test_all(int number) {
37 init();
38 PagodaTester.main(
39 Utility.combinePaths(ontoDir, "lubm/univ-bench.owl"),
40 Utility.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
41 Utility.combinePaths(ontoDir, "lubm/queries/test.sparql")
42 );
43
44// assertTrue(false);
45// AllTests.copy("log4j.log", "output/jair/lubm" + number + ".out");
46 } 17 }
47 18
48 @Test 19 @Test
49 public void test1() { 20 public void test1() throws IOException {
50 test_all(1); 21 testN(1);
51 }
52
53// @Test
54// public void test() {
55// int number = 100;
56// test_all(number);
57// }
58
59 private void check(int number) throws IOException {
60 Statistics stat = new Statistics("output/log4j.log");
61 // TODO insert proper file
62 String diff = stat.diff("results-backup/benchmark/lubm" + number + ".out");
63 Utility.copyFile("output/log4j.log", "results-backup/current/lubm" + number + ".out");
64 if (!diff.isEmpty())
65 Assert.fail(diff);
66 } 22 }
67 23
68} 24}