From 5be5fd3daa0d50980fb3791e904e035cdbca254f Mon Sep 17 00:00:00 2001 From: RncLsn Date: Thu, 7 May 2015 19:26:24 +0100 Subject: Making the output machine-readable (JSON). --- test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java | 64 ++++------------------ 1 file changed, 10 insertions(+), 54 deletions(-) (limited to 'test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java') 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 @@ package uk.ac.ox.cs.pagoda.test_units; -import org.testng.Assert; import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.tester.PagodaTester; -import uk.ac.ox.cs.pagoda.tester.Statistics; -import uk.ac.ox.cs.pagoda.util.Utility; +import uk.ac.ox.cs.pagoda.util.TestUtil; -import java.io.FileInputStream; import java.io.IOException; -import java.util.Properties; +import java.nio.file.Paths; public class PagodaLUBM { - public static final String CONFIG_FILE = "config/test.properties"; - - private static boolean isInit = false; - private static String ontoDir; - - private static void init() { - if(isInit) return; - isInit = true; - - Properties config = new Properties(); - - try(FileInputStream in = new FileInputStream(CONFIG_FILE)) { - config.load(in); - in.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - ontoDir = config.getProperty("ontoDir"); - } - - private void test_all(int number) { - init(); - PagodaTester.main( - Utility.combinePaths(ontoDir, "lubm/univ-bench.owl"), - Utility.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"), - Utility.combinePaths(ontoDir, "lubm/queries/test.sparql") - ); - -// assertTrue(false); -// AllTests.copy("log4j.log", "output/jair/lubm" + number + ".out"); + private void testN(int number ) throws IOException { + String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); + TestGlobalCorrectness.test(Paths.get(ontoDir, "lubm/univ-bench.owl"), + Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"), + Paths.get(ontoDir, "lubm/queries/test.sparql"), + Paths.get(ontoDir, "lubm/lubm" + number + ".ans")); } @Test - public void test1() { - test_all(1); - } - -// @Test -// public void test() { -// int number = 100; -// test_all(number); -// } - - private void check(int number) throws IOException { - Statistics stat = new Statistics("output/log4j.log"); - // TODO insert proper file - String diff = stat.diff("results-backup/benchmark/lubm" + number + ".out"); - Utility.copyFile("output/log4j.log", "results-backup/current/lubm" + number + ".out"); - if (!diff.isEmpty()) - Assert.fail(diff); + public void test1() throws IOException { + testN(1); } } -- cgit v1.2.3