From 1be8d7ee97a96f79e75f43710f8322611c5a1e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Fri, 3 Feb 2012 16:52:07 +0100 Subject: Add Configuration system. --- .../java/com/orbekk/same/config/ConfigurationTest.java | 17 +++++++++++++++++ .../resources/com/orbekk/same/config/test.properties | 1 + 2 files changed, 18 insertions(+) create mode 100644 same/src/test/java/com/orbekk/same/config/ConfigurationTest.java create mode 100644 same/src/test/resources/com/orbekk/same/config/test.properties (limited to 'same/src/test') 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 -- cgit v1.2.3