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/08/08 22:23:23 UTC
[1/4] incubator-tamaya-sandbox git commit: TAMAYA-274: Moved to Java
8, set version to 0.4-incubating-SNAPSHOT
Repository: incubator-tamaya-sandbox
Updated Branches:
refs/heads/java8 a3e01813f -> f30884f9e
TAMAYA-274: Moved to Java 8, set version to 0.4-incubating-SNAPSHOT
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/d9e2d541
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/tree/d9e2d541
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/diff/d9e2d541
Branch: refs/heads/java8
Commit: d9e2d541ed7fe5467955c20954f21c758a354542
Parents: a3e0181
Author: anatole <an...@apache.org>
Authored: Tue Aug 8 21:44:51 2017 +0200
Committer: anatole <an...@apache.org>
Committed: Tue Aug 8 21:44:51 2017 +0200
----------------------------------------------------------------------
apache-commons/pom.xml | 2 +-
camel/pom.xml | 2 +-
configured-sysprops/pom.xml | 2 +-
consul/pom.xml | 2 +-
etcd/pom.xml | 2 +-
hazelcast/pom.xml | 2 +-
jodatime/pom.xml | 2 +-
management/pom.xml | 2 +-
metamodel/pom.xml | 2 +-
microprofile/pom.xml | 46 +++++++++++++++++++++++++++++++++++-----
osgi/common/pom.xml | 2 +-
osgi/karaf-features/pom.xml | 2 +-
osgi/pom.xml | 4 ++--
pom.xml | 22 +++++++++----------
propertysources/pom.xml | 2 +-
remote/pom.xml | 2 +-
server/pom.xml | 2 +-
ui/base/pom.xml | 2 +-
ui/events/pom.xml | 2 +-
ui/mutableconfig/pom.xml | 2 +-
ui/pom.xml | 2 +-
uom/pom.xml | 2 +-
usagetracker/pom.xml | 2 +-
validation/pom.xml | 2 +-
vertx/pom.xml | 2 +-
25 files changed, 75 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/apache-commons/pom.xml
----------------------------------------------------------------------
diff --git a/apache-commons/pom.xml b/apache-commons/pom.xml
index 8f4d945..0ed033d 100644
--- a/apache-commons/pom.xml
+++ b/apache-commons/pom.xml
@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>tamaya-commons-config_beta</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/camel/pom.xml
----------------------------------------------------------------------
diff --git a/camel/pom.xml b/camel/pom.xml
index 2dcdc60..f4324bb 100644
--- a/camel/pom.xml
+++ b/camel/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/configured-sysprops/pom.xml
----------------------------------------------------------------------
diff --git a/configured-sysprops/pom.xml b/configured-sysprops/pom.xml
index 884007f..8384d04 100644
--- a/configured-sysprops/pom.xml
+++ b/configured-sysprops/pom.xml
@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>tamaya-sysprops_beta</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/consul/pom.xml
----------------------------------------------------------------------
diff --git a/consul/pom.xml b/consul/pom.xml
index 14dbe65..47ce340 100644
--- a/consul/pom.xml
+++ b/consul/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/etcd/pom.xml
----------------------------------------------------------------------
diff --git a/etcd/pom.xml b/etcd/pom.xml
index 376a469..31ea349 100644
--- a/etcd/pom.xml
+++ b/etcd/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/hazelcast/pom.xml
----------------------------------------------------------------------
diff --git a/hazelcast/pom.xml b/hazelcast/pom.xml
index 7f594cd..1052787 100644
--- a/hazelcast/pom.xml
+++ b/hazelcast/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/jodatime/pom.xml
----------------------------------------------------------------------
diff --git a/jodatime/pom.xml b/jodatime/pom.xml
index a1e99df..7ffbf23 100644
--- a/jodatime/pom.xml
+++ b/jodatime/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/management/pom.xml
----------------------------------------------------------------------
diff --git a/management/pom.xml b/management/pom.xml
index 9ac2ec4..1ac279a 100644
--- a/management/pom.xml
+++ b/management/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/metamodel/pom.xml b/metamodel/pom.xml
index bfffea8..1f8ae92 100644
--- a/metamodel/pom.xml
+++ b/metamodel/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/microprofile/pom.xml
----------------------------------------------------------------------
diff --git a/microprofile/pom.xml b/microprofile/pom.xml
index 123f7b8..89f29c3 100644
--- a/microprofile/pom.xml
+++ b/microprofile/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
@@ -36,6 +36,9 @@ under the License.
<microprofile.version>1.0</microprofile.version>
<geronimo-atinject-1.0-spec.version>1.0</geronimo-atinject-1.0-spec.version>
<geronimo-jcdi-1.1-spec.version>1.0</geronimo-jcdi-1.1-spec.version>
+ <version.shrinkwrap.resolvers>2.2.6</version.shrinkwrap.resolvers>
+ <org.apache.tomcat.version>6.0.53</org.apache.tomcat.version>
+ <tamaya-version>0.4-incubating-SNAPSHOT</tamaya-version>
</properties>
<dependencies>
@@ -53,18 +56,18 @@ under the License.
<dependency>
<groupId>org.apache.tamaya</groupId>
<artifactId>tamaya-core</artifactId>
- <version>${project.parent.version}</version>
+ <version>${tamaya-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tamaya</groupId>
<artifactId>tamaya-api</artifactId>
- <version>${project.parent.version}</version>
+ <version>${tamaya-version}</version>
</dependency>
<dependency>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-functions</artifactId>
- <version>${project.parent.version}</version>
+ <version>${tamaya-version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
@@ -97,6 +100,39 @@ under the License.
<version>6.9.9</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-depchain</artifactId>
+ <version>${version.shrinkwrap.resolvers}</version>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ <!-- since microprofile requires a Java EE container ;-(
+ we need one for executing the TCK! -->
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
+ <version>1.0.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.main.extras</groupId>
+ <artifactId>glassfish-embedded-all</artifactId>
+ <version>4.1.2</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun</groupId>
+ <artifactId>tools-jar</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>21.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
@@ -115,7 +151,7 @@ under the License.
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
- <suiteXmlFile>tck-suite.xml</suiteXmlFile>
+ <suiteXmlFile>src/test/tck-suite.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/osgi/common/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/common/pom.xml b/osgi/common/pom.xml
index 89dabcd..e0a5411 100644
--- a/osgi/common/pom.xml
+++ b/osgi/common/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-osgi-all</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
</parent>
<artifactId>tamaya-osgi_alpha</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/osgi/karaf-features/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/karaf-features/pom.xml b/osgi/karaf-features/pom.xml
index e1f00ea..b7cc919 100644
--- a/osgi/karaf-features/pom.xml
+++ b/osgi/karaf-features/pom.xml
@@ -23,7 +23,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-osgi-all</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
</parent>
<artifactId>tamaya-karaf-features</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/osgi/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/pom.xml b/osgi/pom.xml
index 07a5a3b..ada48f4 100644
--- a/osgi/pom.xml
+++ b/osgi/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
@@ -272,7 +272,7 @@
<dependency>
<groupId>org.apache.tamaya</groupId>
<artifactId>tamaya-api</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index afc8a0e..578eac8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@ under the License.
</parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache Tamaya Sandbox</name>
@@ -224,11 +224,11 @@ under the License.
</exclusions>
</dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <version>${findbugs.version}</version>
- </dependency>
+ <!--<dependency>-->
+ <!--<groupId>com.google.code.findbugs</groupId>-->
+ <!--<artifactId>jsr305</artifactId>-->
+ <!--<version>${findbugs.version}</version>-->
+ <!--</dependency>-->
<dependency>
<groupId>org.hamcrest</groupId>
@@ -425,8 +425,6 @@ under the License.
<configuration>
<debug>true</debug>
<optimize>${maven.compile.optimize}</optimize>
- <source>${maven.compile.sourceLevel}</source>
- <target>${maven.compile.targetLevel}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<showDeprecation>${maven.compile.deprecation}</showDeprecation>
</configuration>
@@ -709,8 +707,8 @@ under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.7</source>
- <target>1.7</target>
+ <source>${jdkVersion}</source>
+ <target>${jdkVersion}</target>
</configuration>
</plugin>
<plugin>
@@ -754,9 +752,9 @@ under the License.
<module>osgi</module>
<module>management</module>
<module>metamodel</module>
- <!-- Requires JAVA 8: <module>microprofile</module>-->
+ <module>microprofile</module>
<module>uom</module>
- <!-- Requires JAVA 8: <module>vertx</module>-->
+ <module>vertx</module>
</modules>
<profiles>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/propertysources/pom.xml
----------------------------------------------------------------------
diff --git a/propertysources/pom.xml b/propertysources/pom.xml
index ae50287..e9d64ac 100644
--- a/propertysources/pom.xml
+++ b/propertysources/pom.xml
@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>tamaya-propertysources_alpha</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/remote/pom.xml
----------------------------------------------------------------------
diff --git a/remote/pom.xml b/remote/pom.xml
index 51c9680..25b6847 100644
--- a/remote/pom.xml
+++ b/remote/pom.xml
@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index f67fb8c..5b4c0dd 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/ui/base/pom.xml
----------------------------------------------------------------------
diff --git a/ui/base/pom.xml b/ui/base/pom.xml
index c300feb..3807cc5 100644
--- a/ui/base/pom.xml
+++ b/ui/base/pom.xml
@@ -24,7 +24,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-ui-parent</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/ui/events/pom.xml
----------------------------------------------------------------------
diff --git a/ui/events/pom.xml b/ui/events/pom.xml
index cfcc815..4cf01d9 100644
--- a/ui/events/pom.xml
+++ b/ui/events/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-ui-parent</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/ui/mutableconfig/pom.xml
----------------------------------------------------------------------
diff --git a/ui/mutableconfig/pom.xml b/ui/mutableconfig/pom.xml
index df8b166..6468719 100644
--- a/ui/mutableconfig/pom.xml
+++ b/ui/mutableconfig/pom.xml
@@ -24,7 +24,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-ui-parent</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index 9214a84..2835676 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
</parent>
<artifactId>tamaya-ui-parent</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/uom/pom.xml
----------------------------------------------------------------------
diff --git a/uom/pom.xml b/uom/pom.xml
index e0e2e3d..0dc6bba 100644
--- a/uom/pom.xml
+++ b/uom/pom.xml
@@ -15,7 +15,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
</parent>
<artifactId>tamaya-uom_beta</artifactId>
<name>Apache Tamaya Modules - Units of Measurement Support</name>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/usagetracker/pom.xml
----------------------------------------------------------------------
diff --git a/usagetracker/pom.xml b/usagetracker/pom.xml
index 7399a36..f52516c 100644
--- a/usagetracker/pom.xml
+++ b/usagetracker/pom.xml
@@ -22,7 +22,7 @@ under the License.
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/validation/pom.xml
----------------------------------------------------------------------
diff --git a/validation/pom.xml b/validation/pom.xml
index 15bf254..5fc7a5b 100644
--- a/validation/pom.xml
+++ b/validation/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/d9e2d541/vertx/pom.xml
----------------------------------------------------------------------
diff --git a/vertx/pom.xml b/vertx/pom.xml
index 058fbd3..4c14510 100644
--- a/vertx/pom.xml
+++ b/vertx/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-sandbox</artifactId>
- <version>0.3-incubating-SNAPSHOT</version>
+ <version>0.4-incubating-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
[4/4] incubator-tamaya-sandbox git commit: TAMAYA-274: Simplified
compiler settings, set version to 0.4-incubating-SNAPSHOT
Posted by an...@apache.org.
TAMAYA-274: Simplified compiler settings, set version to 0.4-incubating-SNAPSHOT
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/f30884f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/tree/f30884f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/diff/f30884f9
Branch: refs/heads/java8
Commit: f30884f9e0ec2902567fe4e823f6f87ac2c29f98
Parents: 1e2a184
Author: anatole <an...@apache.org>
Authored: Wed Aug 9 00:20:09 2017 +0200
Committer: anatole <an...@apache.org>
Committed: Wed Aug 9 00:20:09 2017 +0200
----------------------------------------------------------------------
management/pom.xml | 4 ----
metamodel/pom.xml | 4 ----
.../apache/tamaya/osgi/InjectionKarafTest.java | 18 +++++++++---------
.../org/apache/tamaya/osgi/OSGIKarafTest.java | 12 ++++++------
pom.xml | 15 ++++++++-------
remote/pom.xml | 4 ----
server/pom.xml | 1 -
tamaya-sandbox.iml | 2 +-
ui/pom.xml | 3 ---
usagetracker/pom.xml | 4 ----
validation/pom.xml | 4 ----
vertx/pom.xml | 3 ---
12 files changed, 24 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/management/pom.xml
----------------------------------------------------------------------
diff --git a/management/pom.xml b/management/pom.xml
index 1ac279a..81f64c9 100644
--- a/management/pom.xml
+++ b/management/pom.xml
@@ -30,10 +30,6 @@ under the License.
<name>Apache Tamaya Modules - JMX Support</name>
<packaging>jar</packaging>
- <properties>
- <jdkVersion>1.7</jdkVersion>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.apache.tamaya</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/metamodel/pom.xml b/metamodel/pom.xml
index 1f8ae92..b462590 100644
--- a/metamodel/pom.xml
+++ b/metamodel/pom.xml
@@ -33,10 +33,6 @@
</description>
<packaging>jar</packaging>
- <properties>
- <jdkVersion>1.7</jdkVersion>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.apache.tamaya</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/InjectionKarafTest.java
----------------------------------------------------------------------
diff --git a/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/InjectionKarafTest.java b/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/InjectionKarafTest.java
index 14e83ed..d8a2366 100644
--- a/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/InjectionKarafTest.java
+++ b/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/InjectionKarafTest.java
@@ -70,7 +70,7 @@ public class InjectionKarafTest {
.artifactId("tamaya-osgi-features")
.type("xml")
.classifier("features")
- .version("0.3-incubating-SNAPSHOT");
+ .version("0.4-incubating-SNAPSHOT");
return options(
KarafDistributionOption.karafDistributionConfiguration()
.frameworkUrl(CoreOptions.maven()
@@ -94,16 +94,16 @@ public class InjectionKarafTest {
"src/test/resources/org.ops4j.pax.logging.cfg")),
mavenBundle("org.apache.geronimo.specs", "geronimo-annotation_1.2_spec", "1.0-alpha-1"),
- mavenBundle("org.apache.tamaya", "tamaya-api", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya", "tamaya-core", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-spisupport", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-functions", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-osgi", "0.3-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya", "tamaya-api", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya", "tamaya-core", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-spisupport", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-functions", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-osgi", "0.4-incubating-SNAPSHOT"),
// injection libs
mavenBundle("org.apache.geronimo.specs", "geronimo-atinject_1.0_spec", "1.0"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-injection-api", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-injection", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-osgi-injection", "0.3-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-injection-api", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-injection", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-osgi-injection", "0.4-incubating-SNAPSHOT"),
KarafDistributionOption.features(
karafStandardRepo, "scr"),
KarafDistributionOption.features(
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/OSGIKarafTest.java
----------------------------------------------------------------------
diff --git a/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/OSGIKarafTest.java b/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/OSGIKarafTest.java
index 4cc8b90..bbbf10c 100644
--- a/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/OSGIKarafTest.java
+++ b/osgi/karaf-features/src/test/java/org/apache/tamaya/osgi/OSGIKarafTest.java
@@ -78,7 +78,7 @@ public class OSGIKarafTest {
.artifactId("tamaya-osgi-features")
.type("xml")
.classifier("features")
- .version("0.3-incubating-SNAPSHOT");
+ .version("0.4-incubating-SNAPSHOT");
return options(
// KarafDistributionOption.karafDistributionConfiguration()
// .frameworkUrl(CoreOptions.maven()
@@ -102,11 +102,11 @@ public class OSGIKarafTest {
// "src/test/resources/org.ops4j.pax.logging.cfg")),
mavenBundle("org.apache.geronimo.specs", "geronimo-annotation_1.2_spec", "1.0-alpha-1"),
- mavenBundle("org.apache.tamaya", "tamaya-api", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya", "tamaya-core", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-spisupport", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-functions", "0.3-incubating-SNAPSHOT"),
- mavenBundle("org.apache.tamaya.ext", "tamaya-osgi", "0.3-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya", "tamaya-api", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya", "tamaya-core", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-spisupport", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-functions", "0.4-incubating-SNAPSHOT"),
+ mavenBundle("org.apache.tamaya.ext", "tamaya-osgi", "0.4-incubating-SNAPSHOT"),
// KarafDistributionOption.features(
// karafStandardRepo, "scr"),
// KarafDistributionOption.features(
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 578eac8..0078166 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,14 +44,13 @@ under the License.
</prerequisites>
<properties>
- <tamaya.version>3.0-incubating-SNAPSHOT</tamaya.version>
+ <tamaya.version>0.4-incubating-SNAPSHOT</tamaya.version>
<commons-io.version>2.5</commons-io.version>
<findbugs.skip>false</findbugs.skip>
- <jdkVersion>1.8</jdkVersion>
<osgi.version>5.0.0</osgi.version> <!-- 4.3.1 -->
<osgi.compendium.version>${osgi.version}</osgi.compendium.version>
- <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
- <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
+ <maven.compile.targetLevel>1.8</maven.compile.targetLevel>
+ <maven.compile.sourceLevel>1.8</maven.compile.sourceLevel>
<maven.compile.optimize>false</maven.compile.optimize>
<maven.compile.deprecation>true</maven.compile.deprecation>
<maven.javadoc.skip>false</maven.javadoc.skip>
@@ -424,6 +423,8 @@ under the License.
<version>3.5.1</version>
<configuration>
<debug>true</debug>
+ <source>${maven.compile.sourceLevel}</source>
+ <target>${maven.compile.targetLevel}</target>
<optimize>${maven.compile.optimize}</optimize>
<encoding>${project.build.sourceEncoding}</encoding>
<showDeprecation>${maven.compile.deprecation}</showDeprecation>
@@ -707,8 +708,8 @@ under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>${jdkVersion}</source>
- <target>${jdkVersion}</target>
+ <source>${maven.compile.sourceLevel}</source>
+ <target>${maven.compile.targetLevel}</target>
</configuration>
</plugin>
<plugin>
@@ -749,7 +750,7 @@ under the License.
<module>camel</module>
<module>propertysources</module>
<!--<module>ui</module>-->
- <module>osgi</module>
+ <!--<module>osgi</module>-->
<module>management</module>
<module>metamodel</module>
<module>microprofile</module>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/remote/pom.xml
----------------------------------------------------------------------
diff --git a/remote/pom.xml b/remote/pom.xml
index 25b6847..37f2bf5 100644
--- a/remote/pom.xml
+++ b/remote/pom.xml
@@ -31,10 +31,6 @@ under the License.
<name>Apache Tamaya Modules - Remote PropertySource</name>
<packaging>jar</packaging>
- <properties>
- <jdkVersion>1.7</jdkVersion>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.apache.tamaya</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 5b4c0dd..ab40526 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -31,7 +31,6 @@ under the License.
<packaging>jar</packaging>
<properties>
- <jdkVersion>1.7</jdkVersion>
<tomcat.version>7.0.57</tomcat.version>
</properties>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/tamaya-sandbox.iml
----------------------------------------------------------------------
diff --git a/tamaya-sandbox.iml b/tamaya-sandbox.iml
index 75636dc..a0d4a1e 100644
--- a/tamaya-sandbox.iml
+++ b/tamaya-sandbox.iml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" version="4">
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index 2835676..529f070 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -33,9 +33,6 @@
<packaging>pom</packaging>
<properties>
- <jdkVersion>1.8</jdkVersion>
- <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
- <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
<vaadin.plugin.version>2.1.0</vaadin.plugin.version>
<vaadin.version>8.0.4</vaadin.version>
<guava.version>21.0</guava.version>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/usagetracker/pom.xml
----------------------------------------------------------------------
diff --git a/usagetracker/pom.xml b/usagetracker/pom.xml
index f52516c..57dce21 100644
--- a/usagetracker/pom.xml
+++ b/usagetracker/pom.xml
@@ -33,10 +33,6 @@ under the License.
</description>
<packaging>jar</packaging>
- <properties>
- <jdkVersion>1.7</jdkVersion>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.apache.tamaya</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/validation/pom.xml
----------------------------------------------------------------------
diff --git a/validation/pom.xml b/validation/pom.xml
index 5fc7a5b..e3d9b79 100644
--- a/validation/pom.xml
+++ b/validation/pom.xml
@@ -32,10 +32,6 @@
</description>
<packaging>jar</packaging>
- <properties>
- <jdkVersion>1.7</jdkVersion>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.apache.tamaya</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/f30884f9/vertx/pom.xml
----------------------------------------------------------------------
diff --git a/vertx/pom.xml b/vertx/pom.xml
index 4c14510..ede9c64 100644
--- a/vertx/pom.xml
+++ b/vertx/pom.xml
@@ -34,9 +34,6 @@
<packaging>jar</packaging>
<properties>
- <jdkVersion>1.8</jdkVersion>
- <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
- <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
<vertx.version>3.3.0</vertx.version>
</properties>
[2/4] incubator-tamaya-sandbox git commit: TAMAYA-260: Implemented
all basic microprofile features. Last 3 failres are to be discussed with MP
folks.
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/matchers/AdditionalMatchers.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/matchers/AdditionalMatchers.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/matchers/AdditionalMatchers.java
new file mode 100644
index 0000000..31024d2
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/matchers/AdditionalMatchers.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tamaya.microprofile.imported.matchers;
+
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+
+import static org.hamcrest.Matchers.closeTo;
+
+/**
+ *
+ * @author Ondrej Mihalyi
+ */
+public final class AdditionalMatchers {
+
+ private AdditionalMatchers() {
+ // utility class
+ }
+
+ public static Matcher<Float> floatCloseTo(float value, float range) {
+ return new BaseMatcher<Float>() {
+
+ private Matcher<Double> doubleMatcher = null;
+
+ @Override
+ public boolean matches(Object item) {
+ if (item instanceof Float) {
+ return (doubleMatcher = closeTo(value, range)).matches(((Float)item).doubleValue());
+ }
+ else {
+ return (doubleMatcher = closeTo(value, range)).matches(item);
+ }
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ doubleMatcher.describeTo(description);
+ }
+ };
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java
new file mode 100644
index 0000000..4522fb8
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigArchiveProcessor.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.microprofile.tck;
+
+import org.apache.tamaya.microprofile.MicroprofileAdapter;
+import org.apache.tamaya.microprofile.MicroprofileConfigProviderResolver;
+import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
+import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
+import org.jboss.arquillian.test.spi.TestClass;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+import java.io.File;
+
+/**
+ * Adds the whole Config implementation classes and resources to the
+ * Arqillian deployment archive. This is needed to have the container
+ * pick up the beans from within the impl for the TCK tests.
+ *
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ */
+public class TamayaConfigArchiveProcessor implements ApplicationArchiveProcessor {
+
+ @Override
+ public void process(Archive<?> applicationArchive, TestClass testClass) {
+ if (applicationArchive instanceof WebArchive) {
+ File[] coreLibs = Maven.resolver()
+ .loadPomFromFile("pom.xml").resolve("org.apache.tamaya:tamaya-core")
+ .withTransitivity().asFile();
+ File[] apiLibs = Maven.resolver()
+ .loadPomFromFile("pom.xml").resolve("org.apache.tamaya:tamaya-api")
+ .withTransitivity().asFile();
+ File[] functionsLib = Maven.resolver()
+ .loadPomFromFile("pom.xml").resolve("org.apache.tamaya.ext:tamaya-functions")
+ .withTransitivity().asFile();
+
+ JavaArchive configJar = ShrinkWrap
+ .create(JavaArchive.class, "tamaya-config-impl.jar")
+ .addPackage(MicroprofileAdapter.class.getPackage())
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
+ .addAsServiceProvider(ConfigProviderResolver.class, MicroprofileConfigProviderResolver.class);
+ ((WebArchive) applicationArchive).addAsLibraries(
+ configJar)
+ .addAsLibraries(apiLibs)
+ .addAsLibraries(coreLibs)
+ .addAsLibraries(functionsLib);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java
new file mode 100644
index 0000000..9c0dfd3
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/tck/TamayaConfigExtension.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.microprofile.tck;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
+import org.jboss.arquillian.core.spi.LoadableExtension;
+
+/**
+ * Arquillian extension to load Tamaya into Arquillian context.
+ * @author <a href="mailto:anatole@apache.org">Anatole Tresch</a>
+ */
+public class TamayaConfigExtension implements LoadableExtension {
+
+ @Override
+ public void register(ExtensionBuilder extensionBuilder) {
+ extensionBuilder.service(
+ ApplicationArchiveProcessor.class,
+ TamayaConfigArchiveProcessor.class);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/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
new file mode 100644
index 0000000..6895df3
--- /dev/null
+++ b/microprofile/src/test/resources/META-INF/microprofile-config.properties
@@ -0,0 +1,100 @@
+#
+# Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+#
+# See the NOTICES file(s) distributed with this work for additional
+# information regarding copyright ownership.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+
+tck.config.test.javaconfig.properties.key1=VALue1
+
+
+tck.config.test.overwritten.in.custompropertyfile.key1=value from microprofile-config.properties
+
+
+tck.config.test.javaconfig.converter.integervalue = 1234
+tck.config.test.javaconfig.converter.integervalue.broken = xxx
+
+tck.config.test.javaconfig.converter.longvalue = 1234567890
+tck.config.test.javaconfig.converter.longvalue.broken = xxx
+
+tck.config.test.javaconfig.converter.floatvalue = 12.34
+tck.config.test.javaconfig.converter.floatvalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.doublevalue = 12.34
+tck.config.test.javaconfig.converter.doublevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.durationvalue = PT15M
+tck.config.test.javaconfig.converter.durationvalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.localtimevalue = 10:37
+tck.config.test.javaconfig.converter.localtimevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.localdatevalue = 2017-12-24
+tck.config.test.javaconfig.converter.localdatevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.localdatetimevalue = 2017-12-24T10:25:30
+tck.config.test.javaconfig.converter.localdatetimevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.offsetdatetimevalue = 2007-12-03T10:15:30+01:00
+tck.config.test.javaconfig.converter.offsetdatetimevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.offsettimevalue = 13:45:30.123456789+02:00
+tck.config.test.javaconfig.converter.offsettimevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.instantvalue = 2015-06-02T21:34:33.616Z
+tck.config.test.javaconfig.converter.instantvalue.broken = alfasdf
+
+tck.config.test.javaconfig.configvalue.key1=value1
+
+# test BooleanConverter START
+tck.config.test.javaconfig.configvalue.boolean.true=true
+tck.config.test.javaconfig.configvalue.boolean.true_uppercase=TRUE
+tck.config.test.javaconfig.configvalue.boolean.true_mixedcase=TruE
+tck.config.test.javaconfig.configvalue.boolean.false=false
+
+tck.config.test.javaconfig.configvalue.boolean.one=1
+tck.config.test.javaconfig.configvalue.boolean.zero=0
+tck.config.test.javaconfig.configvalue.boolean.seventeen=17
+
+tck.config.test.javaconfig.configvalue.boolean.yes=yes
+tck.config.test.javaconfig.configvalue.boolean.yes_uppercase=YES
+tck.config.test.javaconfig.configvalue.boolean.yes_mixedcase=Yes
+tck.config.test.javaconfig.configvalue.boolean.no=no
+
+tck.config.test.javaconfig.configvalue.boolean.y=y
+tck.config.test.javaconfig.configvalue.boolean.y_uppercase=Y
+tck.config.test.javaconfig.configvalue.boolean.n=n
+
+tck.config.test.javaconfig.configvalue.boolean.on=on
+tck.config.test.javaconfig.configvalue.boolean.on_uppercase=ON
+tck.config.test.javaconfig.configvalue.boolean.on_mixedcase=oN
+tck.config.test.javaconfig.configvalue.boolean.off=off
+
+# test BooleanConverter END
+
+# various other converter
+tck.config.test.javaconfig.configvalue.integer=1234
+tck.config.test.javaconfig.configvalue.long=1234567890123456
+tck.config.test.javaconfig.configvalue.float=12.34
+tck.config.test.javaconfig.configvalue.double=12.34567890123456
+
+# Custom Converter tests
+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
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource
----------------------------------------------------------------------
diff --git a/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource b/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource
index dc7c0fa..dbffc2a 100644
--- a/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource
+++ b/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource
@@ -16,4 +16,4 @@
# specific language governing permissions and limitations
# under the License.
#
-org.apache.tamaya.microprofile.configsources.MPSystemPropertiesConfigSource
+org.apache.tamaya.microprofile.imported.configsources.CustomDbConfigSource
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider
----------------------------------------------------------------------
diff --git a/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider b/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider
new file mode 100644
index 0000000..68c6ace
--- /dev/null
+++ b/microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2016-2017 Mark Struberg and others
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+org.apache.tamaya.microprofile.imported.configsources.CustomConfigSourceProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
----------------------------------------------------------------------
diff --git a/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
new file mode 100644
index 0000000..b2af25c
--- /dev/null
+++ b/microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.tamaya.microprofile.tck.TamayaConfigExtension
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/tck-suite.xml
----------------------------------------------------------------------
diff --git a/microprofile/src/test/tck-suite.xml b/microprofile/src/test/tck-suite.xml
new file mode 100644
index 0000000..7efa750
--- /dev/null
+++ b/microprofile/src/test/tck-suite.xml
@@ -0,0 +1,29 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy current the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<suite name="microprofile-config-TCK" verbose="2" configfailurepolicy="continue" >
+
+ <test name="microprofile-config 1.0 TCK">
+ <packages>
+ <package name="org.eclipse.microprofile.config.tck.*">
+ </package>
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/tck-suite.xml
----------------------------------------------------------------------
diff --git a/microprofile/tck-suite.xml b/microprofile/tck-suite.xml
deleted file mode 100644
index 7efa750..0000000
--- a/microprofile/tck-suite.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy current the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<suite name="microprofile-config-TCK" verbose="2" configfailurepolicy="continue" >
-
- <test name="microprofile-config 1.0 TCK">
- <packages>
- <package name="org.eclipse.microprofile.config.tck.*">
- </package>
- </packages>
- </test>
-
-</suite>
\ No newline at end of file
[3/4] incubator-tamaya-sandbox git commit: TAMAYA-260: Implemented
all basic microprofile features. Last 3 failres are to be discussed with MP
folks.
Posted by an...@apache.org.
TAMAYA-260: Implemented all basic microprofile features. Last 3 failres
are to be discussed with MP folks.
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/1e2a184f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/tree/1e2a184f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/diff/1e2a184f
Branch: refs/heads/java8
Commit: 1e2a184f80167576c6b884f004083bf5496cfe95
Parents: d9e2d54
Author: anatole <an...@apache.org>
Authored: Wed Aug 9 00:18:52 2017 +0200
Committer: anatole <an...@apache.org>
Committed: Wed Aug 9 00:18:52 2017 +0200
----------------------------------------------------------------------
.../microprofile/MicroprofileAdapter.java | 1 +
.../microprofile/MicroprofileConfigBuilder.java | 46 +++-
.../MicroprofileConfigProviderResolver.java | 8 +-
.../MicroprofileConfigurationProducer.java | 104 ++++++++
.../MicroprofileDefaultProperties.java | 33 +++
.../microprofile/TamayaPropertySource.java | 4 +-
.../org.apache.tamaya.spi.PropertySource | 20 ++
.../MicroprofileConfigBuilderTest.java | 3 +-
.../MicroprofileConfigProviderTest.java | 2 +-
.../microprofile/MicroprofileConfigTest.java | 11 +-
.../MPSystemPropertiesConfigSource.java | 34 ---
.../AutoDiscoveredConfigSourceTest.java | 64 +++++
.../imported/CDIPlainInjectionTest.java | 226 ++++++++++++++++++
.../imported/ConfigProviderTest.java | 143 +++++++++++
.../microprofile/imported/ConverterTest.java | 235 +++++++++++++++++++
.../imported/CustomConfigSourceTest.java | 61 +++++
.../imported/OptionalValuesBean.java | 61 +++++
.../imported/broken/ConfigOwner.java | 39 +++
.../imported/broken/CustomConverterBean.java | 46 ++++
...MissingConverterOnInstanceInjectionTest.java | 62 +++++
.../MissingValueOnInstanceInjectionTest.java | 61 +++++
.../WrongConverterOnInstanceInjectionTest.java | 63 +++++
.../CustomConfigSourceProvider.java | 53 +++++
.../configsources/CustomDbConfigSource.java | 69 ++++++
.../configsources/SampleYamlConfigSource.java | 58 +++++
.../microprofile/imported/converters/Duck.java | 36 +++
.../imported/converters/DuckConverter.java | 33 +++
.../microprofile/imported/converters/Pizza.java | 45 ++++
.../imported/converters/PizzaConverter.java | 33 +++
.../imported/matchers/AdditionalMatchers.java | 61 +++++
.../tck/TamayaConfigArchiveProcessor.java | 69 ++++++
.../microprofile/tck/TamayaConfigExtension.java | 36 +++
.../META-INF/microprofile-config.properties | 100 ++++++++
...eclipse.microprofile.config.spi.ConfigSource | 2 +-
...microprofile.config.spi.ConfigSourceProvider | 18 ++
....jboss.arquillian.core.spi.LoadableExtension | 19 ++
microprofile/src/test/tck-suite.xml | 29 +++
microprofile/tck-suite.xml | 29 ---
38 files changed, 1938 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileAdapter.java
----------------------------------------------------------------------
diff --git a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileAdapter.java b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileAdapter.java
index 20d5af0..8f5002c 100644
--- a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileAdapter.java
+++ b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileAdapter.java
@@ -75,6 +75,7 @@ public final class MicroprofileAdapter{
for(PropertySource ps:propertySources){
configSources.add(toConfigSource(ps));
}
+ Collections.reverse(configSources);
return configSources;
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilder.java
----------------------------------------------------------------------
diff --git a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilder.java b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilder.java
index 5e6b613..aacd31b 100644
--- a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilder.java
+++ b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilder.java
@@ -21,9 +21,14 @@ package org.apache.tamaya.microprofile;
import org.apache.tamaya.ConfigurationProvider;
import org.apache.tamaya.TypeLiteral;
import org.apache.tamaya.spi.ConfigurationContextBuilder;
+import org.apache.tamaya.spi.ServiceContextManager;
+import org.apache.tamaya.spisupport.EnvironmentPropertySource;
+import org.apache.tamaya.spisupport.PropertySourceComparator;
+import org.apache.tamaya.spisupport.SystemPropertySource;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.spi.ConfigBuilder;
import org.eclipse.microprofile.config.spi.ConfigSource;
+import org.eclipse.microprofile.config.spi.ConfigSourceProvider;
import org.eclipse.microprofile.config.spi.Converter;
import java.util.Objects;
@@ -37,26 +42,63 @@ final class MicroprofileConfigBuilder implements ConfigBuilder{
MicroprofileConfigBuilder(ConfigurationContextBuilder contextBuilder){
this.contextBuilder = Objects.requireNonNull(contextBuilder);
+ contextBuilder.addDefaultPropertyConverters();
}
public ConfigurationContextBuilder getConfigurationContextBuilder(){
return contextBuilder;
}
+ /**
+ * Add the default config sources appearing on the builder's classpath
+ * including:
+ * <ol>
+ * <li>System properties</li>
+ * <li>Environment properties</li>
+ * <li>/META-INF/microprofile-config.properties</li>
+ * </ol>
+ *
+ * @return the ConfigBuilder with the default config sources
+ */
@Override
public ConfigBuilder addDefaultSources() {
+ contextBuilder.addPropertySources(
+ new SystemPropertySource(400),
+ new EnvironmentPropertySource(300),
+ new MicroprofileDefaultProperties());
+ contextBuilder.sortPropertySources(PropertySourceComparator.getInstance()
+ .setOrdinalKey("config_ordinal"));
return this;
}
+ /**
+ * Add ConfigSources registered using the ServiceLoader.
+ * @return the ConfigBuilder with the added config sources
+ */
@Override
public ConfigBuilder addDiscoveredSources() {
- contextBuilder.addDefaultPropertySources();
+ for(ConfigSource configSource: ServiceContextManager.getServiceContext().getServices(ConfigSource.class)){
+ contextBuilder.addPropertySources(MicroprofileAdapter.toPropertySource(configSource));
+ }
+ for(ConfigSourceProvider configSourceProvider: ServiceContextManager.getServiceContext().getServices(ConfigSourceProvider.class)){
+ contextBuilder.addPropertySources(MicroprofileAdapter.toPropertySources(configSourceProvider.getConfigSources(
+ Thread.currentThread().getContextClassLoader()
+ )));
+ }
+ contextBuilder.sortPropertySources(PropertySourceComparator.getInstance());
return this;
}
+ /**
+ * Add Converters registered using the ServiceLoader.
+ * @return the ConfigBuilder with the added config converters
+ */
@Override
public ConfigBuilder addDiscoveredConverters() {
- contextBuilder.addDefaultPropertyConverters();
+ for(Converter<?> converter: ServiceContextManager.getServiceContext().getServices(Converter.class)){
+ TypeLiteral lit = TypeLiteral.of(TypeLiteral.of(converter.getClass()).getType());
+ contextBuilder.addPropertyConverters(lit, MicroprofileAdapter.toPropertyConverter(converter));
+ }
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolver.java
----------------------------------------------------------------------
diff --git a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolver.java b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolver.java
index c35bd35..92a928a 100644
--- a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolver.java
+++ b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderResolver.java
@@ -19,6 +19,7 @@
package org.apache.tamaya.microprofile;
import org.apache.tamaya.ConfigurationProvider;
+import org.apache.tamaya.spi.ConfigurationContextBuilder;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.spi.ConfigBuilder;
import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
@@ -43,7 +44,12 @@ public class MicroprofileConfigProviderResolver extends ConfigProviderResolver {
public Config getConfig(ClassLoader loader) {
Config config = this.configs.get(loader);
if(config==null){
- config = MicroprofileAdapter.toConfig(ConfigurationProvider.getConfiguration());
+ ConfigurationContextBuilder builder = ConfigurationProvider.getConfigurationContextBuilder();
+ builder.addDefaultPropertyConverters();
+ MicroprofileConfigBuilder microConfigBuilder = new MicroprofileConfigBuilder(builder);
+ microConfigBuilder.addDefaultSources();
+ microConfigBuilder.addDiscoveredSources();
+ config = microConfigBuilder.build();
this.configs.put(loader, config);
}
return config;
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigurationProducer.java
----------------------------------------------------------------------
diff --git a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigurationProducer.java b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigurationProducer.java
new file mode 100644
index 0000000..2bc3abf
--- /dev/null
+++ b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileConfigurationProducer.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tamaya.microprofile;
+
+import org.apache.tamaya.*;
+import org.apache.tamaya.spi.ConversionContext;
+import org.apache.tamaya.spi.PropertyConverter;
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+import org.eclipse.microprofile.config.spi.ConfigBuilder;
+import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+import java.lang.reflect.AnnotatedElement;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Producer bean for configuration properties.
+ */
+@ApplicationScoped
+public class MicroprofileConfigurationProducer {
+
+ private static final Logger LOGGER = Logger.getLogger(MicroprofileConfigurationProducer.class.getName());
+
+ @Produces
+ @ConfigProperty
+ public Object resolveAndConvert(final InjectionPoint injectionPoint) {
+ final ConfigProperty annotation = injectionPoint.getAnnotated().getAnnotation(ConfigProperty.class);
+ String key = annotation.name();
+
+ // unless the extension is not installed, this should never happen because the extension
+ // enforces the resolvability of the config
+ Configuration config = ConfigurationProvider.getConfiguration();
+ final Class<?> toType = (Class<?>) injectionPoint.getAnnotated().getBaseType();
+ String defaultTextValue = annotation.defaultValue().isEmpty() ? null : annotation.defaultValue();
+ String textValue = config.get(key);
+ ConversionContext.Builder builder = new ConversionContext.Builder(config,
+ ConfigurationProvider.getConfiguration().getContext(), key, TypeLiteral.of(toType));
+ if (injectionPoint.getMember() instanceof AnnotatedElement) {
+ builder.setAnnotatedElement((AnnotatedElement) injectionPoint.getMember());
+ }
+ ConversionContext conversionContext = builder.build();
+ if (textValue == null) {
+ textValue = defaultTextValue;
+ }
+ Object value = null;
+ if (textValue != null) {
+ List<PropertyConverter<Object>> converters = ConfigurationProvider.getConfiguration().getContext()
+ .getPropertyConverters(TypeLiteral.of(toType));
+ for (PropertyConverter<Object> converter : converters) {
+ try {
+ value = converter.convert(textValue, conversionContext);
+ if (value != null) {
+ LOGGER.log(Level.FINEST, "Parsed default value from '" + textValue + "' into " +
+ injectionPoint);
+ break;
+ }
+ } catch (Exception e) {
+ LOGGER.log(Level.FINEST, "Failed to convert value '" + textValue + "' for " +
+ injectionPoint, e);
+ }
+ }
+ }
+ if (value == null) {
+ throw new ConfigException(String.format(
+ "Can't resolve any of the possible config keys: %s to the required target type: %s, supported formats: %s",
+ key, toType.getName(), conversionContext.getSupportedFormats().toString()));
+ }
+ LOGGER.finest(String.format("Injecting %s for key %s in class %s", key, value.toString(), injectionPoint.toString()));
+ return value;
+ }
+
+ @Produces
+ public Config getConfiguration(){
+ return ConfigProvider.getConfig(Thread.currentThread().getContextClassLoader());
+ }
+
+ @Produces
+ public ConfigBuilder getConfigBuilder(){
+ return ConfigProviderResolver.instance().getBuilder();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileDefaultProperties.java
----------------------------------------------------------------------
diff --git a/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileDefaultProperties.java b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileDefaultProperties.java
new file mode 100644
index 0000000..cfe06bd
--- /dev/null
+++ b/microprofile/src/main/java/org/apache/tamaya/microprofile/MicroprofileDefaultProperties.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tamaya.microprofile;
+
+import org.apache.tamaya.spisupport.PropertiesResourcePropertySource;
+
+
+/**
+ * Default property source for config properties in the classpath.
+ */
+public class MicroprofileDefaultProperties extends PropertiesResourcePropertySource{
+
+ public MicroprofileDefaultProperties() {
+ super("META-INF/microprofile-config.properties", null);
+ setDefaultOrdinal(100);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/main/java/org/apache/tamaya/microprofile/TamayaPropertySource.java
----------------------------------------------------------------------
diff --git a/microprofile/src/main/java/org/apache/tamaya/microprofile/TamayaPropertySource.java b/microprofile/src/main/java/org/apache/tamaya/microprofile/TamayaPropertySource.java
index a1913e8..f526514 100644
--- a/microprofile/src/main/java/org/apache/tamaya/microprofile/TamayaPropertySource.java
+++ b/microprofile/src/main/java/org/apache/tamaya/microprofile/TamayaPropertySource.java
@@ -25,6 +25,7 @@ import org.eclipse.microprofile.config.spi.ConfigSource;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
+import java.util.Optional;
/**
* Property source implementation that wraps a Microprofile {@link ConfigSource} instance.
@@ -48,7 +49,8 @@ public class TamayaPropertySource implements PropertySource{
@Override
public String getName() {
- return delegate.getName();
+ return Optional.ofNullable(delegate.getName())
+ .orElse(delegate.toString());
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
----------------------------------------------------------------------
diff --git a/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource b/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
new file mode 100644
index 0000000..585700b
--- /dev/null
+++ b/microprofile/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+org.apache.tamaya.microprofile.MicroprofileDefaultProperties
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java
index 6076d1b..e7cc6fd 100644
--- a/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigBuilderTest.java
@@ -83,7 +83,7 @@ public class MicroprofileConfigBuilderTest {
}
@Test
- @Ignore
+// @Ignore
public void testBuildDefaultConfig(){
ConfigBuilder builder = ConfigProviderResolver.instance().getBuilder();
assertNotNull(builder);
@@ -95,7 +95,6 @@ public class MicroprofileConfigBuilderTest {
assertNotNull(config.getValue("java.home", String.class));
ConfigSource src = config.getConfigSources().iterator().next();
assertNotNull(src);
- assertEquals(src.getName(), "system-properties");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java
index 0c77506..46f1d2b 100644
--- a/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigProviderTest.java
@@ -43,7 +43,7 @@ public class MicroprofileConfigProviderTest {
count++;
System.out.println(count + ": " +name);
}
- assertEquals(ConfigurationProvider.getConfiguration().getProperties().size(), count);
+ assertTrue(ConfigurationProvider.getConfiguration().getProperties().size() <= count);
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/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 96e7123..21d0bb9 100644
--- a/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/MicroprofileConfigTest.java
@@ -35,15 +35,14 @@ import static org.junit.Assert.*;
public class MicroprofileConfigTest {
@Test
- public void testDefaultConfigAccess(){
+ public void testDefaultConfigAccess() {
Config config = ConfigProvider.getConfig();
Iterable<ConfigSource> sources = config.getConfigSources();
int count = 0;
- for(ConfigSource cs:sources){
+ for (ConfigSource cs : sources) {
count++;
- assertEquals(cs.getClass(), MicroprofileConfigSource.class);
}
- assertTrue(count == ConfigurationProvider.getConfiguration().getContext().getPropertySources().size());
+ assertEquals(count, 5);
}
@Test
@@ -53,8 +52,6 @@ public class MicroprofileConfigTest {
for(String key:config.getPropertyNames()){
Optional<String> val = config.getOptionalValue(key, String.class);
assertNotNull(val);
- assertEquals(val.orElse("N/A"),
- ConfigurationProvider.getConfiguration().get(key));
val = config.getOptionalValue(key + System.currentTimeMillis(), String.class);
assertNotNull(val);
assertFalse(val.isPresent());
@@ -68,8 +65,6 @@ public class MicroprofileConfigTest {
for(String key:config.getPropertyNames()){
String val = config.getValue(key, String.class);
assertNotNull(val);
- assertEquals(val,
- ConfigurationProvider.getConfiguration().get(key));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/configsources/MPSystemPropertiesConfigSource.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/configsources/MPSystemPropertiesConfigSource.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/configsources/MPSystemPropertiesConfigSource.java
deleted file mode 100644
index 62ecbd4..0000000
--- a/microprofile/src/test/java/org/apache/tamaya/microprofile/configsources/MPSystemPropertiesConfigSource.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tamaya.microprofile.configsources;
-
-import org.apache.tamaya.microprofile.MicroprofileConfigSource;
-import org.apache.tamaya.spisupport.SystemPropertySource;
-
-/**
- * Microprofile config source based on Tamaya's system property source.
- * Created by atsticks on 30.03.17.
- */
-public class MPSystemPropertiesConfigSource extends MicroprofileConfigSource {
-
- public MPSystemPropertiesConfigSource() {
- super(new SystemPropertySource());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/AutoDiscoveredConfigSourceTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/AutoDiscoveredConfigSourceTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/AutoDiscoveredConfigSourceTest.java
new file mode 100644
index 0000000..5aa037e
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/AutoDiscoveredConfigSourceTest.java
@@ -0,0 +1,64 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *******************************************************************************/
+package org.apache.tamaya.microprofile.imported;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
+import org.eclipse.microprofile.config.tck.converters.Pizza;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Verify the method addDiscoveredSources() on ConfigBuilder.
+ *
+ * @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class AutoDiscoveredConfigSourceTest {
+
+ @Test
+ public void testAutoDiscoveredConfigureSources() {
+ Config config = ConfigProviderResolver.instance().getBuilder().addDefaultSources().addDiscoveredSources().build();
+ Assert.assertEquals(config.getValue("tck.config.test.customDbConfig.key1", String.class), "valueFromDb1");
+ }
+
+ @Test
+ public void testAutoDiscoveredConverterManuallyAdded() {
+
+ Config config = ConfigProviderResolver.instance().getBuilder().addDefaultSources().addDiscoveredSources().addDiscoveredConverters().build();
+ Pizza dVaule = config.getValue("tck.config.test.customDbConfig.key3", Pizza.class);
+ Assert.assertEquals(dVaule.getSize(), "big");
+ Assert.assertEquals(dVaule.getFlavor(), "cheese");
+ }
+
+ @Test
+ public void testAutoDiscoveredConverterNotAddedAutomatically() {
+ Config config = ConfigProviderResolver.instance().getBuilder().addDefaultSources().addDiscoveredSources().build();
+ try {
+ // Pizza is too simple, so Tamaya find's a way to construct it.
+ Pizza dVaule = config.getValue("tck.config.test.customDbConfig.key3", Pizza.class);
+ Assert.fail("The auto discovered converter should not be added automatically.");
+ }
+ catch (Exception e) {
+ Assert.assertTrue( e instanceof IllegalArgumentException);
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CDIPlainInjectionTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CDIPlainInjectionTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CDIPlainInjectionTest.java
new file mode 100644
index 0000000..170f55b
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CDIPlainInjectionTest.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tamaya.microprofile.imported;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+import org.eclipse.microprofile.config.spi.ConfigSource;
+import org.jboss.arquillian.testng.Arquillian;
+import org.testng.annotations.Test;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.spi.CDI;
+import javax.inject.Inject;
+import javax.inject.Provider;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.eclipse.microprofile.config.tck.matchers.AdditionalMatchers.floatCloseTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.*;
+
+/**
+ * Test cases for CDI-based API that test retrieving values from the configuration.
+ * The tests depend only on CDI 1.2.
+ * @author Ondrej Mihalyi
+ */
+public class CDIPlainInjectionTest extends Arquillian{
+
+ private static final String DEFAULT_PROPERTY_BEAN_KEY =
+ "org.eclipse.microprofile.config.tck.CDIPlainInjectionTest.defaultPropertyBean.configProperty";
+
+ @Test
+ public void can_inject_simple_values_when_defined() {
+ ensure_all_property_values_are_defined();
+
+ SimpleValuesBean bean = getBeanOfType(SimpleValuesBean.class);
+
+ assertThat(bean.stringProperty, is(equalTo("text")));
+ assertThat(bean.booleanProperty, is(true));
+ assertThat(bean.intProperty, is(equalTo(5)));
+ assertThat(bean.longProperty, is(equalTo(10L)));
+ assertThat(bean.floatProperty, is(floatCloseTo(10.5f, 0.1f)));
+ assertThat(bean.doubleProperty, is(closeTo(11.5, 0.1)));
+
+ assertThat(bean.booleanObjProperty, is(true));
+ assertThat(bean.integerProperty, is(equalTo(5)));
+ assertThat(bean.longObjProperty, is(equalTo(10L)));
+ assertThat(bean.floatObjProperty, is(floatCloseTo(10.5f, 0.1f)));
+ assertThat(bean.doubleObjProperty, is(closeTo(11.5, 0.1)));
+
+ assertThat(bean.doublePropertyWithDefaultValue, is(closeTo(3.1415, 0.1)));
+ }
+
+ @Test
+ public void can_inject_dynamic_values_via_CDI_provider() {
+ clear_all_property_values();
+
+ DynamicValuesBean bean = getBeanOfType(DynamicValuesBean.class);
+
+ //X TODO clarify how Provider<T> should behave for missing values assertThat(bean.getIntProperty(), is(nullValue()));
+
+ ensure_all_property_values_are_defined();
+
+ assertThat(bean.getIntProperty(), is(equalTo(5)));
+ }
+
+ @Test
+ public void can_inject_default_property_path() {
+ clear_all_property_values();
+
+ ensure_all_property_values_are_defined();
+
+ DefaultPropertyBean bean = getBeanOfType(DefaultPropertyBean.class);
+
+ assertThat(bean.getConfigProperty(), is(equalTo("pathConfigValue")));
+ }
+
+ private void ensure_all_property_values_are_defined() {
+ System.setProperty("my.string.property", "text");
+ System.setProperty("my.boolean.property", "true");
+ System.setProperty("my.int.property", "5");
+ System.setProperty("my.long.property", "10");
+ System.setProperty("my.float.property", "10.5");
+ System.setProperty("my.double.property", "11.5");
+ System.setProperty(DEFAULT_PROPERTY_BEAN_KEY, "pathConfigValue");
+ }
+
+ private void clear_all_property_values() {
+ System.getProperties().remove("my.string.property");
+ System.getProperties().remove("my.boolean.property");
+ System.getProperties().remove("my.int.property");
+ System.getProperties().remove("my.long.property");
+ System.getProperties().remove("my.float.property");
+ System.getProperties().remove("my.double.property");
+ System.getProperties().remove(DEFAULT_PROPERTY_BEAN_KEY);
+ }
+
+ private <T> T getBeanOfType(Class<T> beanClass) {
+ return CDI.current().select(beanClass).get();
+ }
+
+ @Dependent
+ public static class SimpleValuesBean {
+
+ @Inject
+ @ConfigProperty(name="my.string.property")
+ private String stringProperty;
+
+ @Inject
+ @ConfigProperty(name="my.boolean.property")
+ private Boolean booleanObjProperty;
+
+ @Inject
+ @ConfigProperty(name="my.boolean.property")
+ private boolean booleanProperty;
+
+ @Inject
+ @ConfigProperty(name="my.int.property")
+ private Integer integerProperty;
+
+ @Inject
+ @ConfigProperty(name="my.int.property")
+ private int intProperty;
+
+ @Inject
+ @ConfigProperty(name="my.long.property")
+ private Long longObjProperty;
+
+ @Inject
+ @ConfigProperty(name="my.long.property")
+ private long longProperty;
+
+ @Inject
+ @ConfigProperty(name="my.float.property")
+ private Float floatObjProperty;
+
+ @Inject
+ @ConfigProperty(name="my.float.property")
+ private float floatProperty;
+
+ @Inject
+ @ConfigProperty(name="my.double.property")
+ private Double doubleObjProperty;
+
+ @Inject
+ @ConfigProperty(name="my.double.property")
+ private double doubleProperty;
+
+ // the property is not configured in any ConfigSource but its defaultValue will
+ // be used to set the field.
+ @Inject
+ @ConfigProperty(name="my.not.configured.double.property", defaultValue = "3.1415")
+ private Double doublePropertyWithDefaultValue;
+
+ }
+
+ @Dependent
+ public static class DynamicValuesBean {
+
+ @Inject
+ @ConfigProperty(name="my.int.property")
+ private Provider<Integer> intPropertyProvider;
+
+ public Integer getIntProperty() {
+ return intPropertyProvider.get();
+ }
+
+ }
+
+ @Dependent
+ public static class DefaultPropertyBean {
+ @Inject
+ @ConfigProperty
+ private String configProperty;
+
+ public String getConfigProperty() {
+ return configProperty;
+ }
+ }
+
+ public static class TestConfigSource implements ConfigSource {
+
+ private Map<String, String> properties;
+
+ public TestConfigSource() {
+ properties = new HashMap<>();
+ properties.put("my.string.property", "text");
+ properties.put("my.boolean.property", "true");
+ properties.put("my.int.property", "5");
+ properties.put("my.long.property", "10");
+ properties.put("my.float.property", "10.5");
+ properties.put("my.double.property", "11.5");
+ }
+
+ @Override
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String getValue(String propertyName) {
+ return properties.get(propertyName);
+ }
+
+ @Override
+ public String getName() {
+ return this.getClass().getName();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConfigProviderTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConfigProviderTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConfigProviderTest.java
new file mode 100644
index 0000000..4a6e351
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConfigProviderTest.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tamaya.microprofile.imported;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.eclipse.microprofile.config.spi.ConfigSource;
+import org.eclipse.microprofile.config.tck.base.AbstractTest;
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.inject.Inject;
+import java.io.*;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class ConfigProviderTest {
+
+ private Config config = ConfigProvider.getConfig();
+
+ @Deployment
+ public static WebArchive deploy() {
+ JavaArchive testJar = ShrinkWrap
+ .create(JavaArchive.class, "configProviderTest.jar")
+ .addPackage(AbstractTest.class.getPackage())
+ .addClass(org.eclipse.microprofile.config.tck.ConfigProviderTest.class)
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
+ .as(JavaArchive.class);
+
+ AbstractTest.addFile(testJar, "META-INF/microprofile-config.properties");
+
+ WebArchive war = ShrinkWrap
+ .create(WebArchive.class, "configProviderTest.war")
+ .addAsLibrary(testJar);
+ return war;
+ }
+
+ @Test
+ public void testEnvironmentConfigSource() {
+ Map<String, String> env = System.getenv();
+ for (Map.Entry<String, String> envEntry : env.entrySet()) {
+ Assert.assertEquals(envEntry.getValue(), config.getValue(envEntry.getKey(), String.class));
+ }
+ }
+
+ @Test
+ public void testPropertyConfigSource() {
+ Properties properties = System.getProperties();
+
+ for (Map.Entry<Object, Object> propEntry : properties.entrySet()) {
+ String propValue = (String) propEntry.getValue();
+ if (propValue != null && propValue.length() > 0) {
+ Assert.assertEquals(propValue, config.getValue((String) propEntry.getKey(), String.class));
+ }
+ }
+ }
+
+ @Test
+ public void testDynamicValueInPropertyConfigSource() {
+ String configKey = "tck.config.test.systemproperty.dynamic.value";
+ String configValue = "myDynamicValue;";
+
+ System.setProperty(configKey, configValue);
+ Assert.assertEquals(config.getValue(configKey, String.class), configValue);
+ }
+
+ @Test
+ public void testJavaConfigPropertyFilesConfigSource() {
+ Assert.assertEquals(config.getValue("tck.config.test.javaconfig.properties.key1", String.class), "VALue1");
+ }
+
+ @Test
+ public void testNonExistingConfigKey() {
+ Assert.assertFalse(config.getOptionalValue("tck.config.test.keydoesnotexist", String.class).isPresent());
+ }
+
+ @Test(expected = NoSuchElementException.class)
+ public void testNonExistingConfigKeyGet() {
+ config.getValue("tck.config.test.keydoesnotexist", String.class);
+ }
+
+ @Test
+ public void testGetConfigSources() {
+ Iterable<ConfigSource> configSources = config.getConfigSources();
+ Assert.assertNotNull(configSources);
+
+ // check descending sorting
+ int prevOrdinal = Integer.MAX_VALUE;
+ for (ConfigSource configSource : configSources) {
+ Assert.assertTrue(configSource.getOrdinal() <= prevOrdinal);
+ prevOrdinal = configSource.getOrdinal();
+ }
+
+ }
+
+ @Test
+ public void testInjectedConfigSerializable() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ try (ObjectOutputStream out = new ObjectOutputStream(byteArrayOutputStream)) {
+ out.writeObject(config);
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ Assert.fail("Injected config should be serializable, but could not serialize it");
+ }
+ Object readObject = null;
+ try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()))) {
+ readObject = in.readObject();
+ } catch (IOException | ClassNotFoundException ex) {
+ ex.printStackTrace();
+ Assert.fail("Injected config should be serializable, but could not deserialize a previously serialized instance");
+ }
+ MatcherAssert.assertThat("Deserialized object", readObject, CoreMatchers.instanceOf(Config.class));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConverterTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConverterTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConverterTest.java
new file mode 100644
index 0000000..e481003
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/ConverterTest.java
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+import org.eclipse.microprofile.config.tck.converters.Duck;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.inject.Inject;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.time.*;
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ * @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
+ * @author <a href="mailto:john.d.ament@gmail.com">John D. Ament</a>
+ */
+public class ConverterTest {
+
+ private Config config = ConfigProvider.getConfig();
+
+ private Duck namedDuck = config.getValue("tck.config.test.javaconfig.converter.duckname", Duck.class);
+
+
+ @Test
+ public void testInteger() {
+ Integer value = config.getValue("tck.config.test.javaconfig.converter.integervalue", Integer.class);
+ Assert.assertEquals(value, Integer.valueOf(1234));
+ }
+
+ @Test
+ public void testInt() {
+ int value = config.getValue("tck.config.test.javaconfig.converter.integervalue", int.class);
+ Assert.assertEquals(value, 1234);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testInteger_Broken() {
+ Integer value = config.getValue("tck.config.test.javaconfig.converter.integervalue.broken", Integer.class);
+ }
+
+ @Test
+ public void testLong() {
+ Long value = config.getValue("tck.config.test.javaconfig.converter.longvalue", Long.class);
+ Assert.assertEquals(value, Long.valueOf(1234567890));
+ }
+
+ @Test
+ public void testlong() {
+ long primitiveValue = config.getValue("tck.config.test.javaconfig.converter.longvalue", long.class);
+ Assert.assertEquals(primitiveValue, 1234567890L);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testLong_Broken() {
+ config.getValue("tck.config.test.javaconfig.converter.longvalue.broken", Long.class);
+ }
+
+ @Test
+ public void testFloat() {
+ Float value = config.getValue("tck.config.test.javaconfig.converter.floatvalue", Float.class);
+ Assert.assertEquals(value, 12.34f, 0.0f);
+ }
+
+ @Test
+ public void testfloat() {
+ float value = config.getValue("tck.config.test.javaconfig.converter.floatvalue", float.class);
+ Assert.assertEquals(value, 12.34f, 0f);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testFloat_Broken() {
+ config.getValue("tck.config.test.javaconfig.converter.floatvalue.broken", Float.class);
+ }
+
+ @Test
+ public void testDouble() {
+ Double value = config.getValue("tck.config.test.javaconfig.converter.doublevalue", Double.class);
+ Assert.assertEquals(value, 12.34d, 0.0d);
+ }
+
+ @Test
+ public void testdouble() {
+ double value = config.getValue("tck.config.test.javaconfig.converter.doublevalue", double.class);
+ Assert.assertEquals(value,12.34d, 0d);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testDouble_Broken() {
+ Double value = config.getValue("tck.config.test.javaconfig.converter.doublevalue.broken", Double.class);
+ }
+
+ @Test
+ public void testDuration() {
+ Duration value = config.getValue("tck.config.test.javaconfig.converter.durationvalue", Duration.class);
+ Assert.assertEquals(value, Duration.parse("PT15M"));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testDuration_Broken() {
+ Duration value = config.getValue("tck.config.test.javaconfig.converter.durationvalue.broken", Duration.class);
+ }
+
+ @Test
+ public void testLocalTime() {
+ LocalTime value = config.getValue("tck.config.test.javaconfig.converter.localtimevalue", LocalTime.class);
+ Assert.assertEquals(value, LocalTime.parse("10:37"));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testLocalTime_Broken() {
+ LocalTime value = config.getValue("tck.config.test.javaconfig.converter.localtimevalue.broken", LocalTime.class);
+ }
+
+ @Test
+ public void testLocalDate() {
+ LocalDate value = config.getValue("tck.config.test.javaconfig.converter.localdatevalue", LocalDate.class);
+ Assert.assertEquals(value, LocalDate.parse("2017-12-24"));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testLocalDate_Broken() {
+ LocalDate value = config.getValue("tck.config.test.javaconfig.converter.localdatevalue.broken", LocalDate.class);
+ }
+
+ @Test
+ public void testLocalDateTime() {
+ LocalDateTime value = config.getValue("tck.config.test.javaconfig.converter.localdatetimevalue", LocalDateTime.class);
+ Assert.assertEquals(value, LocalDateTime.parse("2017-12-24T10:25:30"));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testLocalDateTime_Broken() {
+ LocalDateTime value = config.getValue("tck.config.test.javaconfig.converter.localdatetimevalue.broken", LocalDateTime.class);
+ }
+
+ @Test
+ public void testOffsetDateTime() {
+ OffsetDateTime value = config.getValue("tck.config.test.javaconfig.converter.offsetdatetimevalue", OffsetDateTime.class);
+ Assert.assertEquals(value, OffsetDateTime.parse("2007-12-03T10:15:30+01:00"));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testOffsetDateTime_Broken() {
+ OffsetDateTime value = config.getValue("tck.config.test.javaconfig.converter.offsetdatetimevalue.broken", OffsetDateTime.class);
+ }
+
+ @Test
+ public void testOffsetTime() {
+ OffsetTime value = config.getValue("tck.config.test.javaconfig.converter.offsettimevalue", OffsetTime.class);
+ OffsetTime parsed = OffsetTime.parse("13:45:30.123456789+02:00");
+ Assert.assertEquals(value, parsed);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testOffsetTime_Broken() {
+ OffsetTime value = config.getValue("tck.config.test.javaconfig.converter.offsettimevalue.broken", OffsetTime.class);
+ }
+
+ @Test
+ public void testInstant() {
+ Instant value = config.getValue("tck.config.test.javaconfig.converter.instantvalue", Instant.class);
+ Assert.assertEquals(value, Instant.parse("2015-06-02T21:34:33.616Z"));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testInstant_Broken() {
+ Instant value = config.getValue("tck.config.test.javaconfig.converter.instantvalue.broken", Instant.class);
+ }
+
+ @Test
+ public void testBoolean() {
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.true", Boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.true", boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.true_uppercase", Boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.true_mixedcase", Boolean.class));
+ Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.false", Boolean.class));
+
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.one", Boolean.class));
+ Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.zero", Boolean.class));
+ Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.seventeen", Boolean.class));
+
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.yes", Boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.yes_uppercase", Boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.yes_mixedcase", Boolean.class));
+ Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.no", Boolean.class));
+
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.y", Boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.y_uppercase", Boolean.class));
+ Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.n", Boolean.class));
+
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.on", Boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.on_uppercase", Boolean.class));
+ Assert.assertTrue(config.getValue("tck.config.test.javaconfig.configvalue.boolean.on_mixedcase", Boolean.class));
+ Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.off", Boolean.class));
+ Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.off", boolean.class));
+ }
+
+ @Test
+ public void testCustomConverter() {
+ Assert.assertEquals(namedDuck.getName(), "Hannelore");
+ }
+
+ @Test
+ public void testURLConverter() throws MalformedURLException {
+ URL url = config.getValue("tck.config.test.javaconfig.converter.urlvalue", URL.class);
+ Assert.assertEquals(url, new URL("http://microprofile.io"));
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testURLConverterBroken() throws Exception {
+ URL ignored = config.getValue("tck.config.test.javaconfig.converter.urlvalue.broken", URL.class);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CustomConfigSourceTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CustomConfigSourceTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CustomConfigSourceTest.java
new file mode 100644
index 0000000..79a62f6
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/CustomConfigSourceTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.inject.Inject;
+
+import static org.eclipse.microprofile.config.tck.base.AbstractTest.addFile;
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class CustomConfigSourceTest {
+
+ private Config config = ConfigProvider.getConfig();
+
+// @Deployment
+// public static WebArchive deploy() {
+// JavaArchive testJar = ShrinkWrap
+// .create(JavaArchive.class, "customConfigSourceTest.jar")
+// .addClasses(org.eclipse.microprofile.config.tck.CustomConfigSourceTest.class, CustomDbConfigSource.class, CustomConfigSourceProvider.class)
+// .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
+// .addAsServiceProvider(ConfigSource.class, CustomDbConfigSource.class)
+// .addAsServiceProvider(ConfigSourceProvider.class, CustomConfigSourceProvider.class)
+// .as(JavaArchive.class);
+//
+// addFile(testJar, "META-INF/microprofile-config.properties");
+//
+// WebArchive war = ShrinkWrap
+// .create(WebArchive.class, "customConfigSourceTest.war")
+// .addAsLibrary(testJar);
+// return war;
+// }
+
+
+ @Test
+ public void testConfigSourceProvider() {
+ Assert.assertEquals(config.getValue("tck.config.test.customDbConfig.key1", String.class), "valueFromDb1");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/OptionalValuesBean.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/OptionalValuesBean.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/OptionalValuesBean.java
new file mode 100644
index 0000000..bc9df03
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/OptionalValuesBean.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported;
+/**
+ * Declare a bean for config property injections.
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ * @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
+ */
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+import javax.enterprise.context.Dependent;
+import javax.inject.Inject;
+import java.util.Optional;
+
+@Dependent
+public class OptionalValuesBean {
+ @Inject
+ @ConfigProperty(name="my.optional.int.property")
+ private Optional<Integer> intProperty;
+
+ @Inject
+ @ConfigProperty(name="my.notexisting.property")
+ private Optional<Integer> notexistingProperty;
+
+ private Optional<String> stringValue;
+
+ @Inject
+ public void setStringValue(@ConfigProperty(name="my.optional.string.property") Optional<String> stringValue) {
+ this.stringValue = stringValue;
+ }
+
+ public Optional<String> getStringValue() {
+ return stringValue;
+ }
+
+ public Optional<Integer> getIntProperty() {
+ return intProperty;
+ }
+
+ public Optional<Integer> getNotexistingProperty() {
+ return notexistingProperty;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/ConfigOwner.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/ConfigOwner.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/ConfigOwner.java
new file mode 100644
index 0000000..e6763b2
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/ConfigOwner.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.broken;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+
+/**
+ * A bean contains a config property injection
+ *
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ * @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
+ */
+@RequestScoped
+public class ConfigOwner {
+
+ @Inject
+ @ConfigProperty(name="my.long.value")
+ private Long configValue;
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/CustomConverterBean.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/CustomConverterBean.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/CustomConverterBean.java
new file mode 100644
index 0000000..51b7028
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/CustomConverterBean.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.broken;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+
+/**
+ * A bean contains a config property injection, which converts to CustomType
+ *
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ * @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
+ */
+
+public class CustomConverterBean {
+
+ @RequestScoped
+ public static class ConfigOwner {
+
+ @Inject
+ @ConfigProperty(name="my.customtype.value")
+ private CustomType configValue;
+ }
+
+ public static class CustomType {
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingConverterOnInstanceInjectionTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingConverterOnInstanceInjectionTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingConverterOnInstanceInjectionTest.java
new file mode 100644
index 0000000..863594c
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingConverterOnInstanceInjectionTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.broken;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.ShouldThrowException;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.testng.annotations.Test;
+
+import javax.enterprise.inject.spi.DeploymentException;
+
+/**
+ * Verify that a Converter exists which can handle the configured string.
+ *
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class MissingConverterOnInstanceInjectionTest extends Arquillian {
+
+ @ShouldThrowException(DeploymentException.class)
+ @Deployment
+ public static WebArchive deploy() {
+ JavaArchive testJar = ShrinkWrap
+ .create(JavaArchive.class, "missingConverterOnInstanceInjectionTest.jar")
+ .addClass(CustomConverterBean.class)
+ .addAsManifestResource(new StringAsset("my.customtype.value=xxxxx"), "microprofile-config.properties")
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
+ .as(JavaArchive.class);
+
+ WebArchive war = ShrinkWrap
+ .create(WebArchive.class, "missingConverterOnInstanceInjectionTest.war")
+ .addAsLibrary(testJar);
+ return war;
+ }
+
+ @Test
+ public void test() {
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingValueOnInstanceInjectionTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingValueOnInstanceInjectionTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingValueOnInstanceInjectionTest.java
new file mode 100644
index 0000000..776000a
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/MissingValueOnInstanceInjectionTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.broken;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.ShouldThrowException;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.testng.annotations.Test;
+
+import javax.enterprise.inject.spi.DeploymentException;
+
+/**
+ * Verify that injectng a native value which is not configured will lead to a deployment error.
+ *
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class MissingValueOnInstanceInjectionTest extends Arquillian {
+
+ @ShouldThrowException(DeploymentException.class)
+ @Deployment
+ public static WebArchive deploy() {
+ JavaArchive testJar = ShrinkWrap
+ .create(JavaArchive.class, "missingValueOnInstanceInjectionTest.jar")
+ .addClass(ConfigOwner.class)
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
+ .as(JavaArchive.class);
+
+ WebArchive war = ShrinkWrap
+ .create(WebArchive.class, "missingValueOnInstanceInjectionTest.war")
+ .addAsLibrary(testJar);
+ return war;
+ }
+
+ @Test
+ public void test() {
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/WrongConverterOnInstanceInjectionTest.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/WrongConverterOnInstanceInjectionTest.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/WrongConverterOnInstanceInjectionTest.java
new file mode 100644
index 0000000..5075ef2
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/broken/WrongConverterOnInstanceInjectionTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.broken;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.ShouldThrowException;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.testng.annotations.Test;
+
+import javax.enterprise.inject.spi.DeploymentException;
+
+/**
+ * Verify that injectng a native value also has a valid converter which can handle the configured string.
+ *
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class WrongConverterOnInstanceInjectionTest extends Arquillian {
+
+ @ShouldThrowException(DeploymentException.class)
+ @Deployment
+ public static WebArchive deploy() {
+ JavaArchive testJar = ShrinkWrap
+ .create(JavaArchive.class, "wrongConverterOnInstanceInjectionTest.jar")
+ .addClass(ConfigOwner.class)
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
+ .addAsManifestResource(new StringAsset("my.long.value=xxxxx"), "microprofile-config.properties")
+ .as(JavaArchive.class);
+
+ WebArchive war = ShrinkWrap
+ .create(WebArchive.class, "wrongConverterOnInstanceInjectionTest.war")
+ .addAsLibrary(testJar);
+ return war;
+ }
+
+ @Test
+ public void test() {
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomConfigSourceProvider.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomConfigSourceProvider.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomConfigSourceProvider.java
new file mode 100644
index 0000000..003f73a
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomConfigSourceProvider.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.configsources;
+
+import org.eclipse.microprofile.config.spi.ConfigSource;
+import org.eclipse.microprofile.config.spi.ConfigSourceProvider;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class CustomConfigSourceProvider implements ConfigSourceProvider {
+
+ @Override
+ public Iterable<ConfigSource> getConfigSources(ClassLoader forClassLoader) {
+ List<ConfigSource> detectedConfigSources = new ArrayList<>();
+
+ Enumeration<URL> yamlFiles = null;
+ try {
+ yamlFiles = forClassLoader.getResources("sampleconfig.yaml");
+ }
+ catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ while (yamlFiles.hasMoreElements()) {
+ detectedConfigSources.add(new SampleYamlConfigSource(yamlFiles.nextElement()));
+ }
+ return detectedConfigSources;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomDbConfigSource.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomDbConfigSource.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomDbConfigSource.java
new file mode 100644
index 0000000..28ba343
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/CustomDbConfigSource.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.configsources;
+
+import org.eclipse.microprofile.config.spi.ConfigSource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class CustomDbConfigSource implements ConfigSource {
+
+ private Map<String, String> configValues = new HashMap<>();
+
+ public CustomDbConfigSource() {
+ configValues.put("tck.config.test.customDbConfig.key1", "valueFromDb1");
+ configValues.put("tck.config.test.customDbConfig.key2", "valueFromDb2");
+ configValues.put("tck.config.test.customDbConfig.key3", "big:cheese");
+ }
+
+ @Override
+ public int getOrdinal() {
+ return 112;
+ }
+
+ @Override
+ public Map<String, String> getProperties() {
+ return readPropertiesFromDb();
+ }
+
+ @Override
+ public String getValue(String key) {
+ return readPropertyFromDb(key);
+ }
+
+ @Override
+ public String getName() {
+ return "customDbConfig";
+ }
+
+ private Map<String, String> readPropertiesFromDb() {
+ return configValues;
+ }
+
+ private String readPropertyFromDb(String key) {
+ return configValues.get(key);
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/SampleYamlConfigSource.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/SampleYamlConfigSource.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/SampleYamlConfigSource.java
new file mode 100644
index 0000000..34a612e
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/configsources/SampleYamlConfigSource.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.configsources;
+
+import org.eclipse.microprofile.config.spi.ConfigSource;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class SampleYamlConfigSource implements ConfigSource {
+ private Map<String, String> config = new HashMap<>();
+
+ public SampleYamlConfigSource(URL url) {
+ config.put("tck.config.test.sampleyaml.key1", "yamlvalue1");
+ }
+
+ @Override
+ public int getOrdinal() {
+ return 110;
+ }
+
+ @Override
+ public Map<String, String> getProperties() {
+ return config;
+ }
+
+ @Override
+ public String getValue(String key) {
+ return config.get(key);
+ }
+
+ @Override
+ public String getName() {
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Duck.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Duck.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Duck.java
new file mode 100644
index 0000000..e5bf4b1
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Duck.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.converters;
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class Duck {
+ private final String name;
+
+
+ public Duck(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/DuckConverter.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/DuckConverter.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/DuckConverter.java
new file mode 100644
index 0000000..a8eff34
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/DuckConverter.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.converters;
+
+import org.eclipse.microprofile.config.spi.Converter;
+
+/**
+ * @author <a href="mailto:struberg@apache.org">Mark Struberg</a>
+ */
+public class DuckConverter implements Converter<Duck> {
+
+ @Override
+ public Duck convert(String value) {
+ return new Duck(value);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Pizza.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Pizza.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Pizza.java
new file mode 100644
index 0000000..147756a
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/Pizza.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.converters;
+
+/**
+ * @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
+ */
+public class Pizza {
+ private String flavor;
+ private String size;
+
+
+ public Pizza(String... parts) {
+ if (parts.length ==2) {
+ size = parts[0];
+ flavor = parts[1];
+ }
+
+ }
+
+ public String getSize() {
+ return size;
+ }
+
+ public String getFlavor() {
+ return flavor;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/1e2a184f/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/PizzaConverter.java
----------------------------------------------------------------------
diff --git a/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/PizzaConverter.java b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/PizzaConverter.java
new file mode 100644
index 0000000..0cdb388
--- /dev/null
+++ b/microprofile/src/test/java/org/apache/tamaya/microprofile/imported/converters/PizzaConverter.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tamaya.microprofile.imported.converters;
+
+import org.eclipse.microprofile.config.spi.Converter;
+
+/**
+ * @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
+ */
+public class PizzaConverter implements Converter<Pizza> {
+
+ @Override
+ public Pizza convert(String value) {
+ return new Pizza(value.split(":"));
+ }
+}