tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [incubator-tamaya-extensions] 03/03: TAMAYA-378 Improved injection API for more transparent key resolution.
Date Thu, 21 Feb 2019 22:17:33 GMT
This is an automated email from the ASF dual-hosted git repository.

anatole pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tamaya-extensions.git

commit 00686459b9f49ce970a8df5e644c4f30c9fc486b
Author: Anatole Tresch <atsticks@gmail.com>
AuthorDate: Thu Feb 21 23:16:51 2019 +0100

    TAMAYA-378 Improved injection API for more transparent key resolution.
---
 .../src/test/java/org/apache/tamaya/osgi/injection/Example.java    | 6 +++---
 .../java/org/apache/tamaya/osgi/injection/TemplateExample.java     | 6 +++---
 .../org/apache/tamaya/integration/spring/ConfiguredSpringBean.java | 7 ++++---
 .../java/org/apache/tamaya/integration/spring/EndpointBean.java    | 2 +-
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/Example.java
b/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/Example.java
index a360c7b..ad06561 100644
--- a/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/Example.java
+++ b/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/Example.java
@@ -26,11 +26,11 @@ import static org.assertj.core.api.Assertions.assertThat;
  * Example class to be configured with injection.
  */
 final class Example {
-    @Config("java.home")
+    @Config(key="java.home")
     String javaHome;
-    @Config("java.version")
+    @Config(key="java.version")
     String javaVersion;
-    @Config(value = "java.used", defaultValue = "true")
+    @Config(key = "java.used", defaultValue = "true")
     boolean javaUsed;
 
     static void checkExampleConfig(Example example) {
diff --git a/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/TemplateExample.java
b/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/TemplateExample.java
index 4605b4d..46a58a7 100644
--- a/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/TemplateExample.java
+++ b/modules/osgi/injection/src/test/java/org/apache/tamaya/osgi/injection/TemplateExample.java
@@ -25,12 +25,12 @@ import org.apache.tamaya.inject.api.Config;
  */
 interface TemplateExample {
 
-    @Config("java.home")
+    @Config(key="java.home")
     String getJavaHome();
 
-    @Config("java.version")
+    @Config(key="java.version")
     String javaVersion();
 
-    @Config(value = "java.used", defaultValue = "true")
+    @Config(key = "java.used", defaultValue = "true")
     boolean isJavaUsed();
 }
diff --git a/modules/spring/src/test/java/org/apache/tamaya/integration/spring/ConfiguredSpringBean.java
b/modules/spring/src/test/java/org/apache/tamaya/integration/spring/ConfiguredSpringBean.java
index c43dde0..6e8f830 100644
--- a/modules/spring/src/test/java/org/apache/tamaya/integration/spring/ConfiguredSpringBean.java
+++ b/modules/spring/src/test/java/org/apache/tamaya/integration/spring/ConfiguredSpringBean.java
@@ -19,14 +19,15 @@
 package org.apache.tamaya.integration.spring;
 
 import org.apache.tamaya.inject.api.Config;
-import org.apache.tamaya.inject.api.ConfigDefaultSections;
+import org.apache.tamaya.inject.api.ConfigSection;
+import org.apache.tamaya.inject.spi.AbsoluteKeyResolver;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 
 /**
  * Created by Anatole on 25.09.2015.
  */
-@ConfigDefaultSections
+@ConfigSection(keyResolver = AbsoluteKeyResolver.class)
 public class ConfiguredSpringBean {
 
     private String message;
@@ -34,7 +35,7 @@ public class ConfiguredSpringBean {
     @Autowired
     private Environment env;
 
-    @Config("java.version")
+    @Config(key="java.version")
     private String javaVersion;
 
     @Config(defaultValue = "23")
diff --git a/modules/spring/src/test/java/org/apache/tamaya/integration/spring/EndpointBean.java
b/modules/spring/src/test/java/org/apache/tamaya/integration/spring/EndpointBean.java
index ab511ea..df3b3c3 100644
--- a/modules/spring/src/test/java/org/apache/tamaya/integration/spring/EndpointBean.java
+++ b/modules/spring/src/test/java/org/apache/tamaya/integration/spring/EndpointBean.java
@@ -27,7 +27,7 @@ import java.net.URL;
 @Component
 public class EndpointBean {
 
-    @Config(value = "server.endpoint", defaultValue = "http://localhost:8000/ass_s/v1")
+    @Config(key = "[server.endpoint]", defaultValue = "http://localhost:8000/ass_s/v1")
     private URL endpoint;
 
     @PostConstruct


Mime
View raw message