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 2018/11/20 07:18:19 UTC

[1/2] incubator-tamaya git commit: TAMAYA-348 Clarified/fixed init routine.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 54d50a89a -> ec2c803e6


TAMAYA-348 Clarified/fixed init routine.


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

Branch: refs/heads/master
Commit: b22761e91fe53fe2bc03a8441609b01fe4f13c7e
Parents: 54d50a8
Author: Anatole Tresch <at...@gmail.com>
Authored: Tue Nov 20 08:14:07 2018 +0100
Committer: Anatole Tresch <at...@gmail.com>
Committed: Tue Nov 20 08:14:07 2018 +0100

----------------------------------------------------------------------
 .../spisupport/propertysource/EnvironmentPropertySource.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/b22761e9/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
----------------------------------------------------------------------
diff --git a/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java b/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
index 5f981ec..0308b76 100644
--- a/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
+++ b/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
@@ -134,10 +134,15 @@ public class EnvironmentPropertySource extends BasePropertySource {
      * </pre>
      */
     private void initFromSystemProperties() {
+        // Read prefix
         String value = System.getProperty(TAMAYA_ENVPROPS_PREFIX);
         if(value==null){
-            prefix = System.getenv(TAMAYA_ENVPROPS_PREFIX);
+            value = System.getenv(TAMAYA_ENVPROPS_PREFIX);
         }
+        if(value !=null){
+            this.prefix = value;
+        }
+        // Read enabled 1) for property source, 2) as default
         value = System.getProperty(TAMAYA_ENVPROPS_DISABLE);
         if(value==null){
             value = System.getenv(TAMAYA_ENVPROPS_DISABLE);


[2/2] incubator-tamaya git commit: TAMAYA-348 Clarified/fixed init routine, adapted test.

Posted by an...@apache.org.
TAMAYA-348 Clarified/fixed init routine, adapted test.


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

Branch: refs/heads/master
Commit: ec2c803e6b843acb8ed99f8a1fc6bf6813488979
Parents: b22761e
Author: Anatole Tresch <at...@gmail.com>
Authored: Tue Nov 20 08:15:52 2018 +0100
Committer: Anatole Tresch <at...@gmail.com>
Committed: Tue Nov 20 08:15:52 2018 +0100

----------------------------------------------------------------------
 .../spisupport/propertysource/EnvironmentPropertySourceTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/ec2c803e/code/spi-support/src/test/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySourceTest.java
----------------------------------------------------------------------
diff --git a/code/spi-support/src/test/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySourceTest.java b/code/spi-support/src/test/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySourceTest.java
index bff46d7..2bec2e4 100644
--- a/code/spi-support/src/test/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySourceTest.java
+++ b/code/spi-support/src/test/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySourceTest.java
@@ -49,7 +49,7 @@ public class EnvironmentPropertySourceTest {
 			System.setProperty("tamaya.envprops.prefix", "fakeprefix");
 			System.setProperty("tamaya.envprops.disable", "true");
 			localEnvironmentPropertySource = new EnvironmentPropertySource();
-			assertThat(localEnvironmentPropertySource.getPrefix()).isNull(); // is not fakeprefix because disabled
+			assertThat(localEnvironmentPropertySource.getPrefix()).isEqualTo("fakeprefix");
 			assertThat(localEnvironmentPropertySource.isDisabled()).isTrue();
 			assertThat(localEnvironmentPropertySource.get(System.getenv().entrySet().iterator().next().getKey()))
 					.isNull();