From 17bd9beaf7f358a44e5bf36a5855fe6727d506dc Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Tue, 10 May 2022 18:17:06 +0100 Subject: [pagoda] Move project to Scala This commit includes a few changes: - The repository still uses Maven to manage dependency but it is now a Scala project. - The code has been ported from OWLAPI 3.4.10 to 5.1.20 - A proof of concept program using both RSAComb and PAGOdA has been added. --- test/uk/ac/ox/cs/pagoda/util/TestUtil.java | 97 ------------------------------ 1 file changed, 97 deletions(-) delete mode 100644 test/uk/ac/ox/cs/pagoda/util/TestUtil.java (limited to 'test/uk/ac/ox/cs/pagoda/util/TestUtil.java') diff --git a/test/uk/ac/ox/cs/pagoda/util/TestUtil.java b/test/uk/ac/ox/cs/pagoda/util/TestUtil.java deleted file mode 100644 index c7f024a..0000000 --- a/test/uk/ac/ox/cs/pagoda/util/TestUtil.java +++ /dev/null @@ -1,97 +0,0 @@ -package uk.ac.ox.cs.pagoda.util; - -import org.apache.log4j.Appender; -import org.apache.log4j.FileAppender; -import org.apache.log4j.Logger; -import org.semanticweb.owlapi.model.IRI; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Enumeration; -import java.util.Properties; - -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; - -/** - * A collection of utility methods for testing. - */ -public class TestUtil { - - public static final String CONFIG_FILE = "test.properties"; - private static final Logger LOGGER = Logger.getLogger("Tester"); - private static boolean isConfigLoaded = false; - private static Properties config; - - public static Properties getConfig() { - if(!isConfigLoaded) { - try(InputStream in = TestUtil.class.getClassLoader().getResourceAsStream(CONFIG_FILE)) { - config = new java.util.Properties(); - config.load(in); - in.close(); - isConfigLoaded = true; - } catch (IOException e) { - e.printStackTrace(); - } - } - return config; - } - - public static String combinePaths(String path1, String path2) { - File file1 = new File(path1); - File file2 = new File(file1, path2); - return file2.getPath(); - } - - public static void copyFile(String src, String dst) throws IOException { - Files.copy(Paths.get(src), Paths.get(dst), REPLACE_EXISTING); - } - - /** - * Get the log file, which is assumed unique. - * */ - public static String getLogFileName() { - Enumeration e = Logger.getRootLogger().getAllAppenders(); - while (e.hasMoreElements()){ - Appender app = (Appender)e.nextElement(); - if (app instanceof FileAppender){ - return ((FileAppender)app).getFile(); - } - } - return null; - } - - public static Path getAnswersFilePath(String name) { - URL givenAnswersURL = TestUtil.class.getClassLoader() - .getResource(name); - if(givenAnswersURL == null) throw new RuntimeException("Missing answers file:" + name); - return Paths.get(givenAnswersURL.getPath()); - } - - public static void logInfo(Object msg) { - LOGGER.info(msg); - } - - public static void logDebug(Object msg) { - LOGGER.debug(msg); - } - - public static void logError(Object msg) { - LOGGER.error(msg); - } - - public static void logError(Object msg, Throwable t) { - LOGGER.error(msg, t); - } - - public static final String NS = "http://example.org/test#%s"; - - public static IRI getEntityIRI(String name) { - return IRI.create(String.format(NS, name)); - } - -} -- cgit v1.2.3