You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2017/10/12 22:22:39 UTC

incubator-tamaya-sandbox git commit: TAMAYA-260 Added tests for empty values.

Repository: incubator-tamaya-sandbox
Updated Branches:
  refs/heads/master f5a1b5a35 -> a4e2df547


TAMAYA-260 Added tests for empty values.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/commit/a4e2df54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/tree/a4e2df54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/diff/a4e2df54

Branch: refs/heads/master
Commit: a4e2df5471aa8402e6d13bd3f9cc173c709d9d75
Parents: f5a1b5a
Author: Anatole Tresch <an...@apache.org>
Authored: Fri Oct 13 00:22:31 2017 +0200
Committer: Anatole Tresch <an...@apache.org>
Committed: Fri Oct 13 00:22:31 2017 +0200

----------------------------------------------------------------------
 .../tamaya/microprofile/MicroprofileConfigTest.java    | 13 +++++++++++++
 .../resources/META-INF/microprofile-config.properties  |  5 ++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/a4e2df54/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java
index e1d7f35..1c5375a 100644
--- a/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java
@@ -79,4 +79,17 @@ public class MicroprofileConfigTest {
         config.getValue("java.version", Integer.class);
     }
 
+    @Test
+    public void testEmptySystemProperty(){
+        System.setProperty("my.empty.property", "");
+        Config config = ConfigProvider.getConfig();
+        assertEquals("", config.getValue("my.empty.property", String.class));
+    }
+
+    @Test
+    public void testEmptyConfigProperty(){
+        Config config = ConfigProvider.getConfig();
+        assertEquals("", config.getValue("my.empty.property.in.config.file", String.class));
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/a4e2df54/microprofile/src/test/resources/META-INF/microprofile-config.properties
----------------------------------------------------------------------
diff --git a/microprofile/src/test/resources/META-INF/microprofile-config.properties b/microprofile/src/test/resources/META-INF/microprofile-config.properties
index 39298a8..2e63bf8 100644
--- a/microprofile/src/test/resources/META-INF/microprofile-config.properties
+++ b/microprofile/src/test/resources/META-INF/microprofile-config.properties
@@ -99,4 +99,7 @@ tck.config.test.javaconfig.converter.duckname=Hannelore
 
 # URL Converter tests
 tck.config.test.javaconfig.converter.urlvalue=http://microprofile.io
-tck.config.test.javaconfig.converter.urlvalue.broken=tt:--location
\ No newline at end of file
+tck.config.test.javaconfig.converter.urlvalue.broken=tt:--location$
+
+# Empty values
+my.empty.property.in.config.file=
\ No newline at end of file