tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [1/2] incubator-tamaya-sandbox git commit: TAMAYA-145: Fxed conversion issue and invalid config syntax.
Date Mon, 07 Aug 2017 15:52:12 GMT
Repository: incubator-tamaya-sandbox
Updated Branches:
  refs/heads/java8 [created] 31b9c0e1d


TAMAYA-145: Fxed conversion issue and invalid config syntax.


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/1fec344c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/tree/1fec344c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/diff/1fec344c

Branch: refs/heads/java8
Commit: 1fec344c1bf98eb8accea00fbb0c51968bb47685
Parents: 9731be7
Author: anatole <anatole@apache.org>
Authored: Mon May 1 22:50:40 2017 +0200
Committer: anatole <anatole@apache.org>
Committed: Mon May 1 22:50:40 2017 +0200

----------------------------------------------------------------------
 .../apache/tamaya/metamodel/internal/ComponentConfigurator.java  | 4 ++++
 metamodel/src/test/resources/IntegrationTests/context-test.xml   | 2 +-
 metamodel/src/test/resources/tamaya-config.xml                   | 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1fec344c/metamodel/src/main/java/org/apache/tamaya/metamodel/internal/ComponentConfigurator.java
----------------------------------------------------------------------
diff --git a/metamodel/src/main/java/org/apache/tamaya/metamodel/internal/ComponentConfigurator.java
b/metamodel/src/main/java/org/apache/tamaya/metamodel/internal/ComponentConfigurator.java
index 6e7ea75..30463d4 100644
--- a/metamodel/src/main/java/org/apache/tamaya/metamodel/internal/ComponentConfigurator.java
+++ b/metamodel/src/main/java/org/apache/tamaya/metamodel/internal/ComponentConfigurator.java
@@ -176,6 +176,10 @@ public final class ComponentConfigurator<T> {
                 case "Number":
                     return Float.valueOf(value);
                 default:
+                    if(Enum.class.isAssignableFrom(targetType)){
+                        Method m = targetType.getDeclaredMethod("valueOf", String.class);
+                        return m.invoke(null, value);
+                    }
                     Constructor c = targetType.getConstructor(String.class);
                     if (!Modifier.isPublic(c.getModifiers())) {
                         LOG.fine("Setting constructor as accessible: " + targetType.getSimpleName()
+ "#<constructor>(String)");

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1fec344c/metamodel/src/test/resources/IntegrationTests/context-test.xml
----------------------------------------------------------------------
diff --git a/metamodel/src/test/resources/IntegrationTests/context-test.xml b/metamodel/src/test/resources/IntegrationTests/context-test.xml
index e1073f7..2b7ffb4 100644
--- a/metamodel/src/test/resources/IntegrationTests/context-test.xml
+++ b/metamodel/src/test/resources/IntegrationTests/context-test.xml
@@ -22,7 +22,7 @@
         <stage>${properties:system:STAGE?default=DEV}</stage>
         <configdir>${properties:system:configdir?default=.}</configdir>
         <app>${properties:system:APP?default=NONE}</app>
-        <context>${java:org.apache.tamaya.metamodel.MetaContext#id()}</context>
+        <context>${java:java.util.UUID.randomUUID()}</context>
     </context>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1fec344c/metamodel/src/test/resources/tamaya-config.xml
----------------------------------------------------------------------
diff --git a/metamodel/src/test/resources/tamaya-config.xml b/metamodel/src/test/resources/tamaya-config.xml
index bdb3269..d372249 100644
--- a/metamodel/src/test/resources/tamaya-config.xml
+++ b/metamodel/src/test/resources/tamaya-config.xml
@@ -64,7 +64,7 @@
        </url>
     </property-sources>
     <property-filters>
-        <Secured roles="admin,power-user" matches="*.secret" policy="hide"/>
+        <Secured roles="admin,power-user" matches="*.secret" policy="HIDE"/>
         <Cached timeout="30000" maxSize="300" matches="cached.*"/>
     </property-filters>
     <property-converters>
@@ -74,7 +74,7 @@
 
     <log>
         "METACONTEXT: " + MetaContext.getInstance().getProperties()
-        "CONFIG     : " + Configuration.getInstance().getProperties()
+        "CONFIG     : " + config
     </log>
 
 </configuration>


Mime
View raw message