diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-05-07 19:26:24 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-05-07 19:26:24 +0100 |
| commit | 5be5fd3daa0d50980fb3791e904e035cdbca254f (patch) | |
| tree | 8109fdd92d6a8f3b59b47f147d21e23b84301494 /test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java | |
| parent | 11a432bfc3cb11e07c68c4298fcec060ff1e25fa (diff) | |
| download | ACQuA-5be5fd3daa0d50980fb3791e904e035cdbca254f.tar.gz ACQuA-5be5fd3daa0d50980fb3791e904e035cdbca254f.zip | |
Making the output machine-readable (JSON).
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java | 75 |
1 files changed, 10 insertions, 65 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java index 29a9056..f53ed7e 100644 --- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java +++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java | |||
| @@ -1,79 +1,24 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.test_units; | 1 | package uk.ac.ox.cs.pagoda.test_units; |
| 2 | 2 | ||
| 3 | import org.testng.annotations.Test; | 3 | import org.testng.annotations.Test; |
| 4 | import uk.ac.ox.cs.pagoda.tester.PagodaTester; | 4 | import uk.ac.ox.cs.pagoda.util.TestUtil; |
| 5 | import uk.ac.ox.cs.pagoda.tester.Statistics; | ||
| 6 | import uk.ac.ox.cs.pagoda.util.Utility; | ||
| 7 | 5 | ||
| 8 | import java.io.FileInputStream; | ||
| 9 | import java.io.IOException; | 6 | import java.io.IOException; |
| 10 | import java.util.Properties; | 7 | import java.nio.file.Paths; |
| 11 | 8 | ||
| 12 | public class PagodaUOBM { | 9 | public class PagodaUOBM { |
| 13 | 10 | ||
| 14 | public static final String CONFIG_FILE = "config/test.properties"; | 11 | private void testN(int number ) throws IOException { |
| 15 | 12 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | |
| 16 | private static boolean isInit = false; | 13 | TestGlobalCorrectness.test(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"), |
| 17 | private static String ontoDir; | 14 | Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"), |
| 18 | 15 | Paths.get(ontoDir, "uobm/queries/test.sparql"), | |
| 19 | private static void init() { | 16 | Paths.get(ontoDir, "uobm/uobm" + number + ".ans")); |
| 20 | if(isInit) return; | ||
| 21 | isInit = true; | ||
| 22 | |||
| 23 | Properties config = new Properties(); | ||
| 24 | |||
| 25 | try(FileInputStream in = new FileInputStream(CONFIG_FILE)) { | ||
| 26 | config.load(in); | ||
| 27 | in.close(); | ||
| 28 | } catch (IOException e) { | ||
| 29 | e.printStackTrace(); | ||
| 30 | } | ||
| 31 | |||
| 32 | ontoDir = config.getProperty("ontoDir"); | ||
| 33 | } | ||
| 34 | |||
| 35 | private void test_all(int number ) { | ||
| 36 | init(); | ||
| 37 | |||
| 38 | PagodaTester.main( | ||
| 39 | Utility.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), | ||
| 40 | Utility.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), | ||
| 41 | Utility.combinePaths(ontoDir, "uobm/queries/test.sparql") | ||
| 42 | // + ";" + | ||
| 43 | // Utility.combinePaths(ontoDir, "uobm/queries/standard_group3_all_less.sparql") + ";" + | ||
| 44 | // Utility.combinePaths(ontoDir, "uobm/queries/G3.sparql") + ";" + | ||
| 45 | // Utility.combinePaths(ontoDir, "uobm/queries/last.sparql") | ||
| 46 | ); | ||
| 47 | |||
| 48 | // AllTests.copy("log4j.log", "output/jair/newuobm/uobm" + number + ".out"); | ||
| 49 | } | ||
| 50 | |||
| 51 | private void test_upToSum(int number) { | ||
| 52 | init(); | ||
| 53 | |||
| 54 | PagodaTester.main( | ||
| 55 | PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", | ||
| 56 | PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl", | ||
| 57 | PagodaTester.onto_dir + "uobm/queries/standard_group3_all.sparql" | ||
| 58 | ); | ||
| 59 | |||
| 60 | // AllTests.copy("log4j.log", "output/jair/uobm" + number + ".out"); | ||
| 61 | } | 17 | } |
| 62 | 18 | ||
| 63 | @Test | 19 | @Test |
| 64 | public void test1() { test_all(1); } | 20 | public void test1() throws IOException { |
| 65 | 21 | testN(1); | |
| 66 | // @Test | ||
| 67 | public void test500() { test_upToSum(500); } | ||
| 68 | |||
| 69 | // public static void main(String... args) { | ||
| 70 | // new PagodaUOBM().test_all(1); | ||
| 71 | // } | ||
| 72 | |||
| 73 | private void check() { | ||
| 74 | Statistics stat = new Statistics("results-backup/current/uobm1.out"); | ||
| 75 | String diff = stat.diff("results-backup/benchmark/uobm1.out"); | ||
| 76 | System.out.println(diff); | ||
| 77 | } | 22 | } |
| 78 | 23 | ||
| 79 | } | 24 | } |
