You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by st...@apache.org on 2012/06/13 12:49:55 UTC
[1/2] git commit: DELTASPIKE-195 more tests
Updated Branches:
refs/heads/master 3a610280c -> e6a126e84
DELTASPIKE-195 more tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/e6a126e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/e6a126e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/e6a126e8
Branch: refs/heads/master
Commit: e6a126e8414b499974f7e5928bf510a04896d53d
Parents: 9e56d13
Author: Mark Struberg <st...@apache.org>
Authored: Wed Jun 13 12:47:29 2012 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Wed Jun 13 12:47:29 2012 +0200
----------------------------------------------------------------------
.../test/core/api/config/ConfigSourceTest.java | 16 +++++++++++++-
1 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/e6a126e8/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/ConfigSourceTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/ConfigSourceTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/ConfigSourceTest.java
index 178dd3b..3bbccff 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/ConfigSourceTest.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/config/ConfigSourceTest.java
@@ -59,18 +59,30 @@ public class ConfigSourceTest
String value = "test_value_02";
String configuredValue = ConfigResolver.getPropertyValue(key);
-
Assert.assertEquals(value, configuredValue);
}
@Test
+ public void testConfigUninitializedDefaultValue()
+ {
+ String key = "nonexistingProperty01";
+
+ // passing in null as default value should work fine
+ String configuredValue = ConfigResolver.getPropertyValue(key, null);
+ Assert.assertNull(configuredValue);
+
+ String myDefaultValue = "theDefaultValueDummy";
+ configuredValue = ConfigResolver.getPropertyValue(key, myDefaultValue);
+ Assert.assertEquals(myDefaultValue, configuredValue);
+ }
+
+ @Test
public void testConfigViaMetaInfPropertyFile()
{
String key = "testProperty03";
String value = "test_value_03";
String configuredValue = ConfigResolver.getPropertyValue(key);
-
Assert.assertEquals(value, configuredValue);
}