summaryrefslogtreecommitdiff
path: root/same/src/test
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-03 16:52:07 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-03 16:52:07 +0100
commit1be8d7ee97a96f79e75f43710f8322611c5a1e24 (patch)
treedce84f10c9db94bad9530bc71a0d638f5f5409cd /same/src/test
parent1c7bbed107d0767536c93a092dbf192a6a45a620 (diff)
Add Configuration system.
Diffstat (limited to 'same/src/test')
-rw-r--r--same/src/test/java/com/orbekk/same/config/ConfigurationTest.java17
-rw-r--r--same/src/test/resources/com/orbekk/same/config/test.properties1
2 files changed, 18 insertions, 0 deletions
diff --git a/same/src/test/java/com/orbekk/same/config/ConfigurationTest.java b/same/src/test/java/com/orbekk/same/config/ConfigurationTest.java
new file mode 100644
index 0000000..e5b42aa
--- /dev/null
+++ b/same/src/test/java/com/orbekk/same/config/ConfigurationTest.java
@@ -0,0 +1,17 @@
+package com.orbekk.same.config;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class ConfigurationTest {
+ @Test public void testLoadConfiguration() {
+ String resources = "src/test/resources/";
+ System.setProperty(Configuration.configurationProperty,
+ resources + "com/orbekk/same/config/test.properties");
+ Configuration configuration = Configuration.load();
+ assertEquals("Test Value",
+ configuration.getProperty("testProperty"));
+
+ }
+}
diff --git a/same/src/test/resources/com/orbekk/same/config/test.properties b/same/src/test/resources/com/orbekk/same/config/test.properties
new file mode 100644
index 0000000..45e1cc4
--- /dev/null
+++ b/same/src/test/resources/com/orbekk/same/config/test.properties
@@ -0,0 +1 @@
+testProperty=Test Value