diff options
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 | 79 |
1 files changed, 79 insertions, 0 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 new file mode 100644 index 0000000..29a9056 --- /dev/null +++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.test_units; | ||
| 2 | |||
| 3 | import org.testng.annotations.Test; | ||
| 4 | import uk.ac.ox.cs.pagoda.tester.PagodaTester; | ||
| 5 | import uk.ac.ox.cs.pagoda.tester.Statistics; | ||
| 6 | import uk.ac.ox.cs.pagoda.util.Utility; | ||
| 7 | |||
| 8 | import java.io.FileInputStream; | ||
| 9 | import java.io.IOException; | ||
| 10 | import java.util.Properties; | ||
| 11 | |||
| 12 | public class PagodaUOBM { | ||
| 13 | |||
| 14 | public static final String CONFIG_FILE = "config/test.properties"; | ||
| 15 | |||
| 16 | private static boolean isInit = false; | ||
| 17 | private static String ontoDir; | ||
| 18 | |||
| 19 | private static void init() { | ||
| 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 | } | ||
| 62 | |||
| 63 | @Test | ||
| 64 | public void test1() { test_all(1); } | ||
| 65 | |||
| 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 | } | ||
| 78 | |||
| 79 | } | ||
