diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-05-18 18:27:32 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-05-18 18:27:32 +0100 |
| commit | c7dbc7c61c7094ea4ec49bd630023f23b92fd9d1 (patch) | |
| tree | 45ff5a535e7d519b58d60c0c214a1f9ecc5a35ef /test/uk/ac/ox/cs/pagoda/util/TestUtil.java | |
| parent | 1b6a128137e5d7a6ff75566869232fc054afabef (diff) | |
| download | ACQuA-c7dbc7c61c7094ea4ec49bd630023f23b92fd9d1.tar.gz ACQuA-c7dbc7c61c7094ea4ec49bd630023f23b92fd9d1.zip | |
Configured Maven and improved executable class and tests.
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/util/TestUtil.java')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/util/TestUtil.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/util/TestUtil.java b/test/uk/ac/ox/cs/pagoda/util/TestUtil.java index 06d391a..1802147 100644 --- a/test/uk/ac/ox/cs/pagoda/util/TestUtil.java +++ b/test/uk/ac/ox/cs/pagoda/util/TestUtil.java | |||
| @@ -5,8 +5,8 @@ import org.apache.log4j.FileAppender; | |||
| 5 | import org.apache.log4j.Logger; | 5 | import org.apache.log4j.Logger; |
| 6 | 6 | ||
| 7 | import java.io.File; | 7 | import java.io.File; |
| 8 | import java.io.FileInputStream; | ||
| 9 | import java.io.IOException; | 8 | import java.io.IOException; |
| 9 | import java.io.InputStream; | ||
| 10 | import java.nio.file.Files; | 10 | import java.nio.file.Files; |
| 11 | import java.nio.file.Paths; | 11 | import java.nio.file.Paths; |
| 12 | import java.util.Enumeration; | 12 | import java.util.Enumeration; |
| @@ -19,14 +19,15 @@ import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; | |||
| 19 | */ | 19 | */ |
| 20 | public class TestUtil { | 20 | public class TestUtil { |
| 21 | 21 | ||
| 22 | public static final String CONFIG_FILE = "config/test.properties"; | 22 | public static final String CONFIG_FILE = "test.properties"; |
| 23 | 23 | ||
| 24 | private static boolean isConfigLoaded = false; | 24 | private static boolean isConfigLoaded = false; |
| 25 | private static Properties config; | 25 | private static Properties config; |
| 26 | 26 | ||
| 27 | public static Properties getConfig() { | 27 | public static Properties getConfig() { |
| 28 | if(!isConfigLoaded) { | 28 | if(!isConfigLoaded) { |
| 29 | try (FileInputStream in = new FileInputStream(CONFIG_FILE)) { | 29 | try (InputStream in = TestUtil.class.getClassLoader() |
| 30 | .getResourceAsStream(CONFIG_FILE)) { | ||
| 30 | config = new java.util.Properties(); | 31 | config = new java.util.Properties(); |
| 31 | config.load(in); | 32 | config.load(in); |
| 32 | in.close(); | 33 | in.close(); |
