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/PagodaLUBM.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/PagodaLUBM.java')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java | 64 |
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 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.test_units; | 1 | package uk.ac.ox.cs.pagoda.test_units; |
| 2 | 2 | ||
| 3 | import org.testng.Assert; | ||
| 4 | import org.testng.annotations.Test; | 3 | import org.testng.annotations.Test; |
| 5 | import uk.ac.ox.cs.pagoda.tester.PagodaTester; | 4 | import uk.ac.ox.cs.pagoda.util.TestUtil; |
| 6 | import uk.ac.ox.cs.pagoda.tester.Statistics; | ||
| 7 | import uk.ac.ox.cs.pagoda.util.Utility; | ||
| 8 | 5 | ||
| 9 | import java.io.FileInputStream; | ||
| 10 | import java.io.IOException; | 6 | import java.io.IOException; |
| 11 | import java.util.Properties; | 7 | import java.nio.file.Paths; |
| 12 | 8 | ||
| 13 | public class PagodaLUBM { | 9 | public 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 | } |
