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 2014/11/26 19:07:08 UTC
[03/11] incubator-tamaya git commit: Initial import from GitHub.
Added PGP public key.
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/log4j2.xml b/core/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..1d7f346
--- /dev/null
+++ b/core/src/main/resources/log4j2.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="warn">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java b/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
new file mode 100644
index 0000000..f7ed72a
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/DefaultConfigurationManagerSingletonSpiSingletonSpiTest.java
@@ -0,0 +1,119 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.tamaya.core.internal.DefaultConfigurationManagerSingletonSpi;
+import org.junit.Test;
+
+/**
+ * Test class for {@link org.apache.tamaya.core.internal.DefaultConfigurationManagerSingletonSpi}.
+ */
+public class DefaultConfigurationManagerSingletonSpiSingletonSpiTest{
+
+
+
+ @Test
+ public void testSEConfigurationService() {
+ new DefaultConfigurationManagerSingletonSpi();
+ }
+
+ @Test
+ public void testGetConfigurationString() {
+ Configuration config = Configuration.of("default");
+ assertNotNull(config);
+ assertTrue(config.toString().contains("default"));
+ assertNotNull(config.getMetaInfo());
+ assertTrue(config.getMetaInfo().toString().contains("default"));
+ System.out.println("CONFIG: " + config);
+ assertEquals(System.getProperty("java.version"),
+ config.get("java.version"));
+
+ config = Configuration.of("system.properties");
+ assertNotNull(config);
+ assertNotNull(config.getMetaInfo());
+ assertTrue(config.getMetaInfo().toString().contains("system.properties"));
+ assertEquals(System.getProperty("java.version"),
+ config.get("java.version"));
+ }
+
+ @Test
+ public void testGetConfigurationStringEnvironment() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testIsConfigurationDefined() {
+ assertTrue(Configuration.isDefined("test"));
+ assertFalse(Configuration.isDefined("sdksajdsajdlkasj dlkjaslkd"));
+ }
+
+ @Test
+ public void testGetCurrentEnvironment() {
+ Environment env = Environment.of();
+ assertNotNull(env);
+ assertEquals(System.getProperty("java.version"),
+ env.get("java.version").get());
+ }
+
+ @Test
+ public void testGetRootEnvironment() {
+ DefaultConfigurationManagerSingletonSpi s = new DefaultConfigurationManagerSingletonSpi();
+ Environment env = Environment.getRootEnvironment();
+ assertNotNull(env);
+ assertEquals(System.getProperty("java.version"),
+ env.get("java.version").get());
+ }
+
+ @Test
+ public void testQueryConfiguration() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testCreateConfiguration() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testUpdateConfiguration() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testAddConfigChangeListener() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testRemoveConfigChangeListener() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testConfigure() {
+ fail("Not yet implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/JavaOneDemo.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/JavaOneDemo.java b/core/src/test/java/org/apache/tamaya/JavaOneDemo.java
new file mode 100644
index 0000000..9cd271c
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/JavaOneDemo.java
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import org.apache.tamaya.core.config.ConfigurationBuilder;
+import org.apache.tamaya.core.config.ConfigurationFormats;
+import org.apache.tamaya.core.properties.AggregationPolicy;
+import org.apache.tamaya.core.properties.PropertyProviders;
+import org.apache.tamaya.samples.annotations.ConfiguredClass;
+import org.apache.tamaya.core.spi.ConfigurationFormat;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Created by Anatole on 30.09.2014.
+ */
+public class JavaOneDemo{
+
+ @Test
+ public void testFromSystemProperties(){
+ PropertyProvider prov = PropertyProviders.fromSystemProperties();
+ assertNotNull(prov);
+ for(Map.Entry<Object,Object> en:System.getProperties().entrySet()){
+ assertEquals(en.getValue(), prov.get(en.getKey().toString()).get());
+ }
+ }
+
+ @Test
+ public void testProgrammatixPropertySet(){
+ System.out.println(PropertyProviders.fromPaths("test", "classpath:test.properties"));
+ }
+
+ @Test
+ public void testProgrammaticConfig(){
+ ConfigurationFormat format = ConfigurationFormats.getPropertiesFormat();
+ Map<String,String> cfgMap = new HashMap<>();
+ cfgMap.put("param1", "value1");
+ cfgMap.put("a", "Adrian"); // overrides Anatole
+ Configuration config = ConfigurationBuilder.of("myTestConfig").addResources(
+ "classpath:test.properties").addConfigMaps(AggregationPolicy.OVERRIDE,
+ PropertyProviders
+ .fromPaths("classpath:cfg/test.xml"),
+ PropertyProviders.fromArgs(new String[]{"-arg1", "--fullarg", "fullValue", "-myflag"}),
+ PropertyProviders.from(cfgMap)).build();
+ System.out.println(config.getAreas());
+ System.out.println("---");
+ System.out.println(config.getAreas(s -> s.startsWith("another")));
+ System.out.println("---");
+ System.out.println(config.getTransitiveAreas());
+ System.out.println("---");
+ System.out.println(config.getTransitiveAreas(s -> s.startsWith("another")));
+ System.out.println("---");
+ System.out.println(config);
+ System.out.print("--- b=");
+ System.out.println(config.get("b"));
+ System.out.println("--- only a,b,c)");
+ System.out.println(PropertyProviders.filtered((f) -> f.equals("a") || f.equals("b") || f.equals("c"), config));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java b/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java
new file mode 100644
index 0000000..a9aab61
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/core/config/ClasspathModulePropertyMapTest.java
@@ -0,0 +1,74 @@
+/*
+ * 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.core.config;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.apache.tamaya.core.properties.ClasspathModulePropertyProvider;
+import org.junit.Test;
+
+public class ClasspathModulePropertyMapTest{
+
+ @Test
+ public void testGetMetaInfoString() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testGetMetaInfo() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testClasspathModuleConfigUnit() {
+ ClasspathModulePropertyProvider u = new ClasspathModulePropertyProvider(
+ ClasspathModulePropertyProvider.class.getClassLoader(),
+ "cfg/test.xml");
+
+ System.out.println(u);
+ assertEquals("testValue", u.get("testFromXml"));
+ }
+
+ @Test
+ public void testGetClassLoader() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testGetProperty() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testGetProperties() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testIsActive() {
+ fail("Not yet implemented");
+ }
+
+ @Test
+ public void testToString() {
+ fail("Not yet implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/core/config/EnvironmentManagerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/core/config/EnvironmentManagerTest.java b/core/src/test/java/org/apache/tamaya/core/config/EnvironmentManagerTest.java
new file mode 100644
index 0000000..a60ba55
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/core/config/EnvironmentManagerTest.java
@@ -0,0 +1,40 @@
+/*
+ * 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.core.config;
+
+import org.apache.tamaya.Environment;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Created by Anatole on 16.06.2014.
+ */
+public class EnvironmentManagerTest{
+
+ @Test
+ public void testEnvironmentNotNull(){
+ Assert.assertNotNull(Environment.of());
+ }
+
+ @Test
+ public void testRootEnvironmentNotNull(){
+ Assert.assertNotNull(Environment.getRootEnvironment());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/core/config/MutableConfigTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/core/config/MutableConfigTest.java b/core/src/test/java/org/apache/tamaya/core/config/MutableConfigTest.java
new file mode 100644
index 0000000..37f5be8
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/core/config/MutableConfigTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.core.config;
+
+import org.apache.tamaya.ConfigChangeSet;
+import org.apache.tamaya.ConfigChangeSetBuilder;
+import org.apache.tamaya.Configuration;
+import org.junit.Test;
+
+import java.beans.PropertyChangeEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertFalse;
+
+/**
+ * Created by Anatole on 22.10.2014.
+ */
+public class MutableConfigTest {
+
+ @Test
+ public void accessMutableConfig(){
+ Configuration config = Configuration.of("mutableTestConfig");
+ ConfigChangeSet changeSet = ConfigChangeSetBuilder.of(config).put("testCase", "accessMutableConfig")
+ .put("execTime", System.currentTimeMillis()).put("execution", "once").build();
+ List<PropertyChangeEvent> changes = new ArrayList<>();
+ config.addPropertyChangeListener((evt) -> changes.add(evt));
+ config.apply(changeSet);
+ assertFalse(changes.isEmpty());
+ System.out.println(changes);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/core/env/ConfiguredSystemPropertiesTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/core/env/ConfiguredSystemPropertiesTest.java b/core/src/test/java/org/apache/tamaya/core/env/ConfiguredSystemPropertiesTest.java
new file mode 100644
index 0000000..b8ddd8f
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/core/env/ConfiguredSystemPropertiesTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.core.env;
+
+import org.apache.tamaya.Configuration;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Created by Anatole on 02.10.2014.
+ */
+public class ConfiguredSystemPropertiesTest {
+
+ @Test
+ public void testInstall(){
+ Configuration config = Configuration.of();
+ Properties props = System.getProperties();
+ assertTrue(props.getClass().getName().equals(Properties.class.getName()));
+ System.out.println("Props("+props.getClass().getName()+"): " + props);
+ ConfiguredSystemProperties.install();
+ props = System.getProperties();
+ System.out.println("Props("+props.getClass().getName()+"): " + props);
+ assertTrue(props.getClass().getName().equals(ConfiguredSystemProperties.class.getName()));
+ ConfiguredSystemProperties.uninstall();
+ props = System.getProperties();
+ assertTrue(props.getClass().getName().equals(Properties.class.getName()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/core/env/EnvironmentManagerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/core/env/EnvironmentManagerTest.java b/core/src/test/java/org/apache/tamaya/core/env/EnvironmentManagerTest.java
new file mode 100644
index 0000000..341b6ef
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/core/env/EnvironmentManagerTest.java
@@ -0,0 +1,100 @@
+/*
+ * 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.core.env;
+
+import org.apache.tamaya.Environment;
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+/**
+ * Tests for basic {@link org.apache.tamaya.EnvironmentManager} functionality.
+ * Created by Anatole on 17.10.2014.
+ */
+public class EnvironmentManagerTest {
+
+ @Test
+ public void testGetEnvironment(){
+ Environment env = Environment.of();
+ assertNotNull(env);
+ Environment env2 = Environment.of();
+ assertNotNull(env2);
+ assertTrue("Current Environments requested in same context are not the same!", env==env2);
+ }
+
+ @Test
+ public void testGetRootEnvironment(){
+ Environment env = Environment.getRootEnvironment();
+ assertNotNull(env);
+ Environment env2 = Environment.getRootEnvironment();
+ assertNotNull(env2);
+ assertTrue("Root Environments requested in same context are not the same!", env==env2);
+ }
+
+ @Test
+ public void testRootIsNotCurrentEnvironment(){
+ Environment env1 = Environment.getRootEnvironment();
+ Environment env2 = Environment.of();
+ assertNotNull(env1);
+ assertNotNull(env2);
+ assertNotSame(env1, env2);
+ }
+
+ @Test
+ public void testEnvironmentTypeOrder(){
+ List<String> envOrder = Environment.getEnvironmentTypeOrder();
+ assertNotNull(envOrder);
+ assertTrue(envOrder.size()>0);
+ assertTrue(envOrder.contains("root"));
+ assertTrue(envOrder.contains("system"));
+ assertTrue(envOrder.contains("ear"));
+ assertTrue(envOrder.contains("application"));
+ assertTrue(envOrder.get(0).equals("root"));
+ }
+
+ @Test
+ public void testEnvironmentHierarchy(){
+ List<String> envOrder = Environment.getEnvironmentHierarchy();
+ assertNotNull(envOrder);
+ assertTrue(envOrder.size()>0);
+ assertTrue(envOrder.contains("root(root)"));
+ assertTrue(envOrder.contains("system(system)"));
+ assertTrue(envOrder.contains("myEar1(ear)"));
+ assertTrue(envOrder.contains("MyApp1(application)"));
+ assertTrue(envOrder.get(0).equals("MyApp1(application)"));
+ }
+
+ @Test
+ public void testEnvironmentId(){
+ String envId = Environment.of().getEnvironmentId();
+ assertNotNull(envId);
+ assertTrue(envId.contains("root(root)"));
+ assertTrue(envId.contains("system(system)"));
+ assertTrue(envId.contains("myEar1(ear)"));
+ assertTrue(envId.contains("MyApp1(application)"));
+ }
+
+ @Test
+ public void testEnvironmentOverride(){
+ assertEquals(Environment.getRootEnvironment().get("user.country").get(),System.getProperty("user.country"));
+ assertEquals(Environment.of().get("user.country").get(), "DE_1234");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/core/properties/PropertyProvidersTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/core/properties/PropertyProvidersTest.java b/core/src/test/java/org/apache/tamaya/core/properties/PropertyProvidersTest.java
new file mode 100644
index 0000000..3e3435c
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/core/properties/PropertyProvidersTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.core.properties;
+
+import org.junit.Test;
+
+import org.apache.tamaya.PropertyProvider;
+
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Created by Anatole on 30.09.2014.
+ */
+public class PropertyProvidersTest{
+
+ @Test
+ public void testFromEnvironmentProperties(){
+ PropertyProvider prov = PropertyProviders.fromEnvironmentProperties();
+ assertNotNull(prov);
+ for(Map.Entry<String,String> en:System.getenv().entrySet()){
+ assertEquals(en.getValue(), prov.get(en.getKey()).get());
+ }
+ }
+
+ @Test
+ public void testFromSystemProperties(){
+ PropertyProvider prov = PropertyProviders.fromSystemProperties();
+ assertNotNull(prov);
+ for(Map.Entry<Object,Object> en:System.getProperties().entrySet()){
+ assertEquals(en.getValue(), prov.get(en.getKey().toString()).get());
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/internal/MutableTestConfigProvider.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/internal/MutableTestConfigProvider.java b/core/src/test/java/org/apache/tamaya/internal/MutableTestConfigProvider.java
new file mode 100644
index 0000000..91d99dd
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/internal/MutableTestConfigProvider.java
@@ -0,0 +1,60 @@
+/*
+ * 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.internal;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.MetaInfoBuilder;
+import org.apache.tamaya.PropertyProvider;
+import org.apache.tamaya.core.config.Configurations;
+import org.apache.tamaya.core.properties.PropertyProviders;
+import org.apache.tamaya.core.spi.ConfigurationProviderSpi;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Created by Anatole on 29.09.2014.
+ */
+public class MutableTestConfigProvider implements ConfigurationProviderSpi{
+
+ private static final String CONFIG_NAME = "mutableTestConfig";
+ private Configuration testConfig;
+ private final Map<String, String> dataMap = new ConcurrentHashMap<>();
+
+ public MutableTestConfigProvider(){
+ dataMap.put("dad", "Anatole");
+ dataMap.put("mom", "Sabine");
+ dataMap.put("sons.1", "Robin");
+ dataMap.put("sons.2", "Luke");
+ dataMap.put("sons.3", "Benjamin");
+ PropertyProvider provider = PropertyProviders.from(MetaInfoBuilder.of().setName(CONFIG_NAME).build(),
+ dataMap);
+ testConfig = Configurations.getConfiguration(provider);
+ }
+
+ @Override
+ public String getConfigName(){
+ return CONFIG_NAME;
+ }
+
+ @Override
+ public Configuration getConfiguration(){
+ return testConfig;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/internal/TestConfigProvider.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/internal/TestConfigProvider.java b/core/src/test/java/org/apache/tamaya/internal/TestConfigProvider.java
new file mode 100644
index 0000000..6448df1
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/internal/TestConfigProvider.java
@@ -0,0 +1,63 @@
+/*
+ * 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.internal;
+
+import org.apache.tamaya.core.config.Configurations;
+import org.apache.tamaya.core.spi.ConfigurationProviderSpi;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.MetaInfoBuilder;
+import java.util.*;
+
+/**
+ * Created by Anatole on 29.09.2014.
+ */
+public class TestConfigProvider implements ConfigurationProviderSpi{
+
+ private Configuration testConfig;
+
+ public TestConfigProvider(){
+ final Map<String,String> config = new HashMap<>();
+ config.put("a.b.c.key1", "value of a.b.c.key1");
+ config.put("a.b.c.key2", "value of a.b.c.key2");
+ config.put("a.b.key3", "value of a.b.key3");
+ config.put("a.b.key4", "value of a.b.key4");
+ config.put("a.key5", "value of a.key5");
+ config.put("a.key6", "value of a.key6");
+ config.put("int1", "123456");
+ config.put("int2", "111222");
+ config.put("booleanT", "true");
+ config.put("double1", "1234.5678");
+ config.put("BD", "123456789123456789123456789123456789.123456789123456789123456789123456789");
+ config.put("testProperty", "value of testProperty");
+ config.put("runtimeVersion", "${java.version}");
+ testConfig = Configurations.getConfiguration(MetaInfoBuilder.of().setName("test").build(),
+ () -> config);
+ }
+
+ @Override
+ public String getConfigName(){
+ return "test";
+ }
+
+ @Override
+ public Configuration getConfiguration(){
+ return testConfig;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
new file mode 100644
index 0000000..5ef226a
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfigTemplate.java
@@ -0,0 +1,67 @@
+/*
+ * 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.samples.annotations;
+
+import org.apache.tamaya.annot.ConfigChanged;
+import org.apache.tamaya.annot.ConfiguredProperty;
+import org.apache.tamaya.annot.DefaultValue;
+
+import java.math.BigDecimal;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+public interface ConfigTemplate {
+
+ @ConfiguredProperty
+ String testProperty();
+
+ @ConfiguredProperty("Foo")
+ @DefaultValue("The current \\${JAVA_HOME} env property is ${env:JAVA_HOME}.")
+ String value1();
+
+ @ConfiguredProperty("COMPUTERNAME")
+ String computerName();
+
+ @ConfiguredProperty()
+ String APPDATA();
+
+ @ConfiguredProperty
+ @DefaultValue("N/A")
+ String runtimeVersion();
+
+ @ConfiguredProperty
+ @DefaultValue("${sys:java.version}")
+ String javaVersion2();
+
+ @ConfiguredProperty
+ @DefaultValue("5")
+ Integer int1();
+
+ @ConfiguredProperty
+ @DefaultValue("2233")
+ int int2();
+
+ @ConfiguredProperty
+ boolean booleanT();
+
+ @ConfiguredProperty("BD")
+ BigDecimal bigNumber();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
new file mode 100644
index 0000000..fc3098f
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredClass.java
@@ -0,0 +1,119 @@
+/*
+ * 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.samples.annotations;
+
+import org.apache.tamaya.annot.ConfigChanged;
+import org.apache.tamaya.annot.ConfiguredProperty;
+import org.apache.tamaya.annot.DefaultValue;
+import org.apache.tamaya.annot.WithConfig;
+
+import java.beans.PropertyChangeEvent;
+import java.math.BigDecimal;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+public class ConfiguredClass{
+
+ @ConfiguredProperty
+ private String testProperty;
+
+ @ConfiguredProperty("a.b.c.key1")
+ @ConfiguredProperty("a.b.c.key2")
+ @ConfiguredProperty("a.b.c.key3")
+ @DefaultValue("The current \\${JAVA_HOME} env property is ${env:JAVA_HOME}.")
+ String value1;
+
+ @WithConfig("test")
+ @ConfiguredProperty("foo")
+ @ConfiguredProperty("a.b.c.key2")
+ private String value2;
+
+ @ConfiguredProperty
+ @DefaultValue("N/A")
+ private String runtimeVersion;
+
+ @ConfiguredProperty
+ @DefaultValue("${sys:java.version}")
+ private String javaVersion2;
+
+ @ConfiguredProperty
+ @DefaultValue("5")
+ private Integer int1;
+
+ @WithConfig("test")
+ @ConfiguredProperty
+ private int int2;
+
+ @WithConfig("test")
+ @ConfiguredProperty
+ private boolean booleanT;
+
+ @WithConfig("test")
+ @ConfiguredProperty("BD")
+ private BigDecimal bigNumber;
+
+ @ConfigChanged
+ public void changeListener1(PropertyChangeEvent configChange){
+ // will be called
+ }
+
+ public String getTestProperty() {
+ return testProperty;
+ }
+
+ public String getValue1() {
+ return value1;
+ }
+
+ public String getValue2() {
+ return value2;
+ }
+
+ public String getRuntimeVersion() {
+ return runtimeVersion;
+ }
+
+ public String getJavaVersion2() {
+ return javaVersion2;
+ }
+
+ public Integer getInt1() {
+ return int1;
+ }
+
+ public int getInt2() {
+ return int2;
+ }
+
+ public boolean isBooleanT() {
+ return booleanT;
+ }
+
+ public BigDecimal getBigNumber() {
+ return bigNumber;
+ }
+
+ public String toString(){
+ return super.toString() + ": testProperty="+testProperty+", value1="+value1+", value2="+value2
+ +", int1="+int1+", int2="+int2+", booleanT="+booleanT+", bigNumber="+bigNumber
+ +", runtimeVersion="+runtimeVersion+", javaVersion2="+javaVersion2;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredTest.java b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredTest.java
new file mode 100644
index 0000000..2c85dc1
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/samples/annotations/ConfiguredTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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.samples.annotations;
+
+import org.apache.tamaya.Configuration;
+import org.junit.Test;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+public class ConfiguredTest{
+
+ @Test
+ public void testTemplate(){
+ ConfigTemplate template = Configuration.of(ConfigTemplate.class);
+ assertNotNull(template);
+ assertNotNull(template.computerName());
+ assertNotNull(template.APPDATA());
+ assertEquals(2233, template.int2());
+ assertEquals(Integer.valueOf(5), template.int1());
+ assertNotNull(System.getProperty("java.version"), template.javaVersion2());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/samples/devops/DeploymentProvider.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/samples/devops/DeploymentProvider.java b/core/src/test/java/org/apache/tamaya/samples/devops/DeploymentProvider.java
new file mode 100644
index 0000000..18e6705
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/samples/devops/DeploymentProvider.java
@@ -0,0 +1,43 @@
+/*
+ * 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.samples.devops;
+
+
+public class DeploymentProvider {
+
+ public static void main(String[] args) {
+ // ConfigurationServiceSpi service = JavaConfig.getConfigService();
+ // // Main configuration done by ServiceLoader based services and
+ // // custom implemented system or environment properties, mechanisms
+ // System.out.println(service.getCurrentContext());
+ // // Access default configuration for current environment
+ // DefaultEnvironment myTarget = new DefaultEnvironment();
+ // myTarget.setAttribute("domain", "com.test.mydom:domain1:1.0.1");
+ // myTarget.setAttribute("application", "com.test.mydom:app1:1.0.1");
+ // myTarget.setAttribute("env", "localTest");
+ // myTarget.setStage(Stage.UnitTest);
+ // Configuration deploymentConfig =
+ // service.getConfiguration("deployment", myTarget);
+ // String startupName = deploymentConfig
+ // .getProperty("deploy.startupName", "N/A");
+ // int intProp = deploymentConfig.getInteger(
+ // "deploy.mainContainer.size");
+ // // ...
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/java/org/apache/tamaya/simple/SimplePropertiesAndCLISample.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/tamaya/simple/SimplePropertiesAndCLISample.java b/core/src/test/java/org/apache/tamaya/simple/SimplePropertiesAndCLISample.java
new file mode 100644
index 0000000..f4905d5
--- /dev/null
+++ b/core/src/test/java/org/apache/tamaya/simple/SimplePropertiesAndCLISample.java
@@ -0,0 +1,74 @@
+/*
+ * 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.simple.simple;
+
+import org.apache.tamaya.core.config.ConfigurationBuilder;
+import org.apache.tamaya.core.config.ConfigurationFormats;
+import org.apache.tamaya.core.properties.AggregationPolicy;
+import org.apache.tamaya.core.properties.PropertyProviders;
+import org.apache.tamaya.core.spi.ConfigurationFormat;
+import org.junit.Test;
+
+import org.apache.tamaya.Configuration;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by Anatole on 24.02.14.
+ */
+public class SimplePropertiesAndCLISample{
+
+ @Test
+ public void testSystemPropertyResolution(){
+ System.out.println(Configuration.evaluateValue("${sys:java.version}"));
+ }
+
+ @Test
+ public void testProgrammatixPropertySet(){
+ System.out.println(PropertyProviders.fromPaths("test", "classpath:test.properties"));
+ }
+
+ @Test
+ public void testProgrammaticConfig(){
+ ConfigurationFormat format = ConfigurationFormats.getPropertiesFormat();
+ Map<String,String> cfgMap = new HashMap<>();
+ cfgMap.put("param1", "value1");
+ cfgMap.put("a", "Adrian"); // overrides Anatole
+ Configuration config = ConfigurationBuilder.of("myTestConfig").addResources(
+ "classpath:test.properties").addConfigMaps(AggregationPolicy.OVERRIDE,
+ PropertyProviders
+ .fromPaths("classpath:cfg/test.xml"),
+ PropertyProviders.fromArgs(new String[]{"-arg1", "--fullarg", "fullValue", "-myflag"}),
+ PropertyProviders.from(cfgMap)).build();
+ System.out.println(config.getAreas());
+ System.out.println("---");
+ System.out.println(config.getAreas(s -> s.startsWith("another")));
+ System.out.println("---");
+ System.out.println(config.getTransitiveAreas());
+ System.out.println("---");
+ System.out.println(config.getTransitiveAreas(s -> s.startsWith("another")));
+ System.out.println("---");
+ System.out.println(config);
+ System.out.print("--- b=");
+ System.out.println(config.get("b"));
+ System.out.println("--- only a,b,c)");
+ System.out.println(PropertyProviders.filtered((f) -> f.equals("a") || f.equals("b") || f.equals("c"), config));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/beans.xml b/core/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..f1fdb07
--- /dev/null
+++ b/core/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/config.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/config.properties b/core/src/test/resources/META-INF/config.properties
new file mode 100644
index 0000000..cc8170a
--- /dev/null
+++ b/core/src/test/resources/META-INF/config.properties
@@ -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.environmentOrder=root,system,ear,application
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/config/example.ini
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/config/example.ini b/core/src/test/resources/META-INF/config/example.ini
new file mode 100644
index 0000000..dcbb1bc
--- /dev/null
+++ b/core/src/test/resources/META-INF/config/example.ini
@@ -0,0 +1,31 @@
+#
+# 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.
+#
+[persons.anatole]
+prename=Anatole
+name=Tresch
+address=Technoparkstrasse 10
+zip=8070
+location=Zürich
+
+[persons.peter]
+prename=Peter
+name=Fischbach
+address=Hand Platz
+zip=4556
+location=Unterland
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/config/example.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/config/example.properties b/core/src/test/resources/META-INF/config/example.properties
new file mode 100644
index 0000000..3b0047b
--- /dev/null
+++ b/core/src/test/resources/META-INF/config/example.properties
@@ -0,0 +1,31 @@
+#
+# 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.
+#
+persons=joe,anne
+
+persons.joe.prename=Joe
+persons.joe.name=Foo
+persons.joe.address=15, MyBar Street
+persons.joe.zip=80000
+persons.joe.location=Nowhere
+
+persons.anne.prename=Annemarie
+persons.anne.name=Bar
+persons.anne.address=James Strasse 16a
+persons.anne.zip=1234
+persons.anne.location=Nowhere
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/config/example.xml
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/config/example.xml b/core/src/test/resources/META-INF/config/example.xml
new file mode 100644
index 0000000..1b0fafa
--- /dev/null
+++ b/core/src/test/resources/META-INF/config/example.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+#
+# Copyright 2014 Anatole Tresch and other (see authors).
+#
+# 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.
+#
+-->
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties version="1.0">
+ <entry key="persons.gorilla.prename">Bubu</entry>
+ <entry key="persons.gorilla.name">-</entry>
+ <entry key="persons.gorilla.address">Zurich Zoo</entry>
+ <entry key="persons.gorilla.zip">8111</entry>
+ <entry key="persons.gorilla.location">Zurich</entry>
+</properties>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/env/application.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/env/application.properties b/core/src/test/resources/META-INF/env/application.properties
new file mode 100644
index 0000000..35164b9
--- /dev/null
+++ b/core/src/test/resources/META-INF/env/application.properties
@@ -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.core.env.applicationId=MyApp1
+user.country=DE_1234
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/env/ear.ini
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/env/ear.ini b/core/src/test/resources/META-INF/env/ear.ini
new file mode 100644
index 0000000..e29c4f5
--- /dev/null
+++ b/core/src/test/resources/META-INF/env/ear.ini
@@ -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.core.env]
+earId=myEar1
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/env/system.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/env/system.properties b/core/src/test/resources/META-INF/env/system.properties
new file mode 100644
index 0000000..27415a0
--- /dev/null
+++ b/core/src/test/resources/META-INF/env/system.properties
@@ -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.core.env.systemId=test
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/meta-model.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/meta-model.properties b/core/src/test/resources/META-INF/meta-model.properties
new file mode 100644
index 0000000..2872cad
--- /dev/null
+++ b/core/src/test/resources/META-INF/meta-model.properties
@@ -0,0 +1,18 @@
+#
+# 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.
+#
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi b/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
new file mode 100644
index 0000000..7b9ed48
--- /dev/null
+++ b/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
@@ -0,0 +1,22 @@
+#
+# 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.internal.TestConfigProvider
+org.apache.tamaya.core.config.SystemPropertiesConfigProvider
+org.apache.tamaya.core.config.EnvPropertiesConfigProvider
+org.apache.tamaya.internal.MutableTestConfigProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.PropertyAdaptersSingletonSpi
----------------------------------------------------------------------
diff --git a/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.PropertyAdaptersSingletonSpi b/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.PropertyAdaptersSingletonSpi
new file mode 100644
index 0000000..b546a27
--- /dev/null
+++ b/core/src/test/resources/META-INF/services/org.apache.tamaya.core.spi.PropertyAdaptersSingletonSpi
@@ -0,0 +1,15 @@
+#
+# Copyright 2014 Anatole Tresch and other (see authors).
+#
+# 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.
+#
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/cfg/test.xml
----------------------------------------------------------------------
diff --git a/core/src/test/resources/cfg/test.xml b/core/src/test/resources/cfg/test.xml
new file mode 100644
index 0000000..923cc79
--- /dev/null
+++ b/core/src/test/resources/cfg/test.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties version="1.0">
+ <entry key="testFromXml">testValue</entry>
+ <entry key="b">Bill</entry>
+ <entry key="a.compound.area.entry">myCompundAreaVlaueFromXml</entry>
+ <entry key="an.area.entry">myCompundAreaVlaueFromXml2</entry>
+</properties>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/core/src/test/resources/test.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/test.properties b/core/src/test/resources/test.properties
new file mode 100644
index 0000000..2f752c2
--- /dev/null
+++ b/core/src/test/resources/test.properties
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+a=Anatole
+b=Bj�rn
+c=Charles
+d=Dani
+e=Eduard
+f=Fane
+g=Gil
+another.compound.area.entry=thisTimeFromProperties...
+another.area.entry=thisTimeFromProperties2...
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/incubator-tamaya.iml
----------------------------------------------------------------------
diff --git a/incubator-tamaya.iml b/incubator-tamaya.iml
new file mode 100644
index 0000000..b3d5c73
--- /dev/null
+++ b/incubator-tamaya.iml
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+ <component name="org.twodividedbyzero.idea.findbugs">
+ <option name="_basePreferences">
+ <map>
+ <entry key="property.analysisEffortLevel" value="default" />
+ <entry key="property.analyzeAfterCompile" value="false" />
+ <entry key="property.annotationGutterIconEnabled" value="true" />
+ <entry key="property.annotationSuppressWarningsClass" value="edu.umd.cs.findbugs.annotations.SuppressFBWarnings" />
+ <entry key="property.annotationTextRangeMarkupEnabled" value="true" />
+ <entry key="property.exportAsHtml" value="true" />
+ <entry key="property.exportAsXml" value="true" />
+ <entry key="property.exportBaseDir" value="" />
+ <entry key="property.exportCreateArchiveDir" value="false" />
+ <entry key="property.exportOpenBrowser" value="true" />
+ <entry key="property.minPriorityToReport" value="Medium" />
+ <entry key="property.runAnalysisInBackground" value="false" />
+ <entry key="property.showHiddenDetectors" value="false" />
+ <entry key="property.toolWindowToFront" value="true" />
+ </map>
+ </option>
+ <option name="_detectors">
+ <map>
+ <entry key="AppendingToAnObjectOutputStream" value="true" />
+ <entry key="AtomicityProblem" value="true" />
+ <entry key="BadAppletConstructor" value="false" />
+ <entry key="BadResultSetAccess" value="true" />
+ <entry key="BadSyntaxForRegularExpression" value="true" />
+ <entry key="BadUseOfReturnValue" value="true" />
+ <entry key="BadlyOverriddenAdapter" value="true" />
+ <entry key="BooleanReturnNull" value="true" />
+ <entry key="BuildInterproceduralCallGraph" value="false" />
+ <entry key="BuildObligationPolicyDatabase" value="true" />
+ <entry key="CallToUnsupportedMethod" value="false" />
+ <entry key="CalledMethods" value="true" />
+ <entry key="CheckCalls" value="false" />
+ <entry key="CheckExpectedWarnings" value="false" />
+ <entry key="CheckImmutableAnnotation" value="true" />
+ <entry key="CheckRelaxingNullnessAnnotation" value="true" />
+ <entry key="CheckTypeQualifiers" value="true" />
+ <entry key="CloneIdiom" value="true" />
+ <entry key="ComparatorIdiom" value="true" />
+ <entry key="ConfusedInheritance" value="true" />
+ <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
+ <entry key="CrossSiteScripting" value="true" />
+ <entry key="DefaultEncodingDetector" value="true" />
+ <entry key="DoInsideDoPrivileged" value="true" />
+ <entry key="DontCatchIllegalMonitorStateException" value="true" />
+ <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
+ <entry key="DontUseEnum" value="true" />
+ <entry key="DroppedException" value="true" />
+ <entry key="DumbMethodInvocations" value="true" />
+ <entry key="DumbMethods" value="true" />
+ <entry key="DuplicateBranches" value="true" />
+ <entry key="EmptyZipFileEntry" value="false" />
+ <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
+ <entry key="ExplicitSerialization" value="true" />
+ <entry key="FieldItemSummary" value="true" />
+ <entry key="FinalizerNullsFields" value="true" />
+ <entry key="FindBadCast2" value="true" />
+ <entry key="FindBadForLoop" value="true" />
+ <entry key="FindBugsSummaryStats" value="true" />
+ <entry key="FindCircularDependencies" value="false" />
+ <entry key="FindDeadLocalStores" value="true" />
+ <entry key="FindDoubleCheck" value="true" />
+ <entry key="FindEmptySynchronizedBlock" value="true" />
+ <entry key="FindFieldSelfAssignment" value="true" />
+ <entry key="FindFinalizeInvocations" value="true" />
+ <entry key="FindFloatEquality" value="true" />
+ <entry key="FindFloatMath" value="false" />
+ <entry key="FindHEmismatch" value="true" />
+ <entry key="FindInconsistentSync2" value="true" />
+ <entry key="FindJSR166LockMonitorenter" value="true" />
+ <entry key="FindLocalSelfAssignment2" value="true" />
+ <entry key="FindMaskedFields" value="true" />
+ <entry key="FindMismatchedWaitOrNotify" value="true" />
+ <entry key="FindNakedNotify" value="true" />
+ <entry key="FindNonSerializableStoreIntoSession" value="false" />
+ <entry key="FindNonSerializableValuePassedToWriteObject" value="false" />
+ <entry key="FindNonShortCircuit" value="true" />
+ <entry key="FindNullDeref" value="true" />
+ <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
+ <entry key="FindOpenStream" value="true" />
+ <entry key="FindPuzzlers" value="true" />
+ <entry key="FindRefComparison" value="true" />
+ <entry key="FindReturnRef" value="true" />
+ <entry key="FindRoughConstants" value="true" />
+ <entry key="FindRunInvocations" value="true" />
+ <entry key="FindSelfComparison" value="true" />
+ <entry key="FindSelfComparison2" value="true" />
+ <entry key="FindSleepWithLockHeld" value="true" />
+ <entry key="FindSpinLoop" value="true" />
+ <entry key="FindSqlInjection" value="true" />
+ <entry key="FindTwoLockWait" value="true" />
+ <entry key="FindUncalledPrivateMethods" value="true" />
+ <entry key="FindUnconditionalWait" value="true" />
+ <entry key="FindUninitializedGet" value="true" />
+ <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
+ <entry key="FindUnreleasedLock" value="true" />
+ <entry key="FindUnsatisfiedObligation" value="true" />
+ <entry key="FindUnsyncGet" value="true" />
+ <entry key="FindUseOfNonSerializableValue" value="true" />
+ <entry key="FindUselessControlFlow" value="true" />
+ <entry key="FormatStringChecker" value="true" />
+ <entry key="FunctionsThatMightBeMistakenForProcedures" value="true" />
+ <entry key="HugeSharedStringConstants" value="true" />
+ <entry key="IDivResultCastToDouble" value="true" />
+ <entry key="IncompatMask" value="true" />
+ <entry key="InconsistentAnnotations" value="true" />
+ <entry key="InefficientIndexOf" value="true" />
+ <entry key="InefficientMemberAccess" value="false" />
+ <entry key="InefficientToArray" value="true" />
+ <entry key="InfiniteLoop" value="true" />
+ <entry key="InfiniteRecursiveLoop" value="true" />
+ <entry key="InheritanceUnsafeGetResource" value="true" />
+ <entry key="InitializationChain" value="true" />
+ <entry key="InitializeNonnullFieldsInConstructor" value="true" />
+ <entry key="InstantiateStaticClass" value="true" />
+ <entry key="IntCast2LongAsInstant" value="true" />
+ <entry key="InvalidJUnitTest" value="true" />
+ <entry key="IteratorIdioms" value="true" />
+ <entry key="LazyInit" value="true" />
+ <entry key="LoadOfKnownNullValue" value="true" />
+ <entry key="LostLoggerDueToWeakReference" value="true" />
+ <entry key="MethodReturnCheck" value="true" />
+ <entry key="Methods" value="true" />
+ <entry key="MultithreadedInstanceAccess" value="true" />
+ <entry key="MutableLock" value="true" />
+ <entry key="MutableStaticFields" value="true" />
+ <entry key="Naming" value="true" />
+ <entry key="Noise" value="false" />
+ <entry key="NoiseNullDeref" value="false" />
+ <entry key="NoteAnnotationRetention" value="true" />
+ <entry key="NoteCheckReturnValueAnnotations" value="true" />
+ <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
+ <entry key="NoteJCIPAnnotation" value="true" />
+ <entry key="NoteNonNullAnnotations" value="false" />
+ <entry key="NoteNonnullReturnValues" value="false" />
+ <entry key="NoteSuppressedWarnings" value="true" />
+ <entry key="NoteUnconditionalParamDerefs" value="true" />
+ <entry key="NumberConstructor" value="true" />
+ <entry key="OptionalReturnNull" value="true" />
+ <entry key="OverridingEqualsNotSymmetrical" value="true" />
+ <entry key="PreferZeroLengthArrays" value="true" />
+ <entry key="PublicSemaphores" value="false" />
+ <entry key="QuestionableBooleanAssignment" value="true" />
+ <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
+ <entry key="ReadReturnShouldBeChecked" value="true" />
+ <entry key="RedundantInterfaces" value="true" />
+ <entry key="ReflectiveClasses" value="true" />
+ <entry key="RepeatedConditionals" value="true" />
+ <entry key="ResolveAllReferences" value="false" />
+ <entry key="RuntimeExceptionCapture" value="true" />
+ <entry key="SerializableIdiom" value="true" />
+ <entry key="StartInConstructor" value="true" />
+ <entry key="StaticCalendarDetector" value="true" />
+ <entry key="StringConcatenation" value="true" />
+ <entry key="SuperfluousInstanceOf" value="true" />
+ <entry key="SuspiciousThreadInterrupted" value="true" />
+ <entry key="SwitchFallthrough" value="true" />
+ <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
+ <entry key="SynchronizeAndNullCheckField" value="true" />
+ <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
+ <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
+ <entry key="TestASM" value="false" />
+ <entry key="TestDataflowAnalysis" value="false" />
+ <entry key="TestingGround" value="false" />
+ <entry key="TestingGround2" value="false" />
+ <entry key="TrainFieldStoreTypes" value="true" />
+ <entry key="TrainLongInstantfParams" value="true" />
+ <entry key="TrainNonNullAnnotations" value="true" />
+ <entry key="TrainUnconditionalDerefParams" value="true" />
+ <entry key="URLProblems" value="true" />
+ <entry key="UncallableMethodOfAnonymousClass" value="true" />
+ <entry key="UnnecessaryMath" value="true" />
+ <entry key="UnreadFields" value="true" />
+ <entry key="UselessSubclassMethod" value="false" />
+ <entry key="VarArgsProblems" value="true" />
+ <entry key="VolatileUsage" value="true" />
+ <entry key="WaitInLoop" value="true" />
+ <entry key="WrongMapIterator" value="true" />
+ <entry key="XMLFactoryBypass" value="true" />
+ </map>
+ </option>
+ <option name="_reportCategories">
+ <map>
+ <entry key="BAD_PRACTICE" value="true" />
+ <entry key="CORRECTNESS" value="true" />
+ <entry key="EXPERIMENTAL" value="true" />
+ <entry key="I18N" value="true" />
+ <entry key="MALICIOUS_CODE" value="true" />
+ <entry key="MT_CORRECTNESS" value="true" />
+ <entry key="PERFORMANCE" value="true" />
+ <entry key="SECURITY" value="true" />
+ <entry key="STYLE" value="true" />
+ </map>
+ </option>
+ </component>
+</module>
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/keys/KEYS
----------------------------------------------------------------------
diff --git a/keys/KEYS b/keys/KEYS
index 82107e4..7d6f366 100644
--- a/keys/KEYS
+++ b/keys/KEYS
@@ -51,4 +51,23 @@ uXV4f3tjHlhayyDLL0hXQGDmKneKS+SWVfXSHD17/bTKSluRalgrrnnalJOm7bO3
6398+BL1iqIsU9ozd9pP
=iP1I
-----END PGP PUBLIC KEY BLOCK-----
+Anatole Tresch <an...@apache.org>
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v2.0.22 (MingW32)
+mQENBFR07GABCAC6L1HmsF7mof295OHRCv1FDb7ocj/InupxQ2x8Qz6wljINEj71
+DZPLu9s7P0Pxj4KT213G0mPe4NggY5tPZ9bECgNyljUtZqICjrtBoEYRChJQm/bt
+d6evWbF3xNbC4WJrTvsCvbwG001WASjuAI2Lcnz5kNk0u5ed6Vrmmb+QIKjMvFB1
+k0TYMY+ReQLaQjpT0LTgBdhNtPromsm17+XKXk8FHvn2kdEOO3eyIvuyNeQXq6qU
+VBLIgSisiElecBmXuSuXBMkFduYup/5ChRt40lxXvFIlMMYM94l8/9qVYC6+9/hN
+Pbp+OFCVszO5OhurnwccWOCuLSMwjuBQVHAtABEBAAG0I0FuYXRvbGUgVHJlc2No
+IDxhbmF0b2xlQGFwYWNoZS5vcmc+iQE5BBMBAgAjBQJUdOxgAhsPBwsJCAcDAgEG
+FQgCCQoLBBYCAwECHgECF4AACgkQWzij6v6dAYt5owf/T/I2WZvddgKMBzMYbfia
+CjXSgxYDI5qKrSBrgn+tem29bPqCTEAgxoGY263BSl26A1LoF0rmJHE3DOftn900
+XqwZ1+YnNR3Q0NXBcY8uyw30LXWnOG51LsUYEWvsvxdYkvlEGRUg8ylyzVhfkVn5
+gqicREa/We/yJiaRSTcOwLXULYv2KJ0Nb4FwaSy1IHgOrp6O3avXBWMUnNu8JqKW
+PUSrr6FtPd24P9ZppLOL17byAww/sjT1UmgHNuNRehWZD2XnTsdY64L2VBa2D5DA
+jScOY1axIZ92b9A2jHq7hjL0fZ6XBDajjOETki7zFv95QSdUBcs5Y6sc2epfUfcY
+Ig==
+=bvSZ
+-----END PGP PUBLIC KEY BLOCK-----
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/modules/cdi/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cdi/pom.xml b/modules/cdi/pom.xml
new file mode 100644
index 0000000..785b705
--- /dev/null
+++ b/modules/cdi/pom.xml
@@ -0,0 +1,111 @@
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya</groupId>
+ <artifactId>tamaya-modules</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>tamaya-ext-cdi</artifactId>
+ <name>Apache Tamaya Module - CDI Integration</name>
+ <packaging>jar</packaging>
+
+ <properties>
+ <jdkVersion>1.8</jdkVersion>
+ <junit.version>4.8.2</junit.version>
+ <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
+ <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${maven.compile.sourceLevel}</source>
+ <target>${maven.compile.targetLevel}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.asciidoctor</groupId>
+ <artifactId>asciidoctor-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>output-html</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>process-asciidoc</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/docs</outputDirectory>
+ <sourceHighlighter>highlightjs</sourceHighlighter>
+ <!-- coderay -->
+ <backend>html</backend>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.weld.se</groupId>
+ <artifactId>weld-se</artifactId>
+ <version>2.2.4.Final</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld.se</groupId>
+ <artifactId>weld-se</artifactId>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tamaya-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/cf59ebbd/modules/cdi/src/main/java/org/apache/tamaya/ext/cdi/ConfigurationInjector.java
----------------------------------------------------------------------
diff --git a/modules/cdi/src/main/java/org/apache/tamaya/ext/cdi/ConfigurationInjector.java b/modules/cdi/src/main/java/org/apache/tamaya/ext/cdi/ConfigurationInjector.java
new file mode 100644
index 0000000..432b30f
--- /dev/null
+++ b/modules/cdi/src/main/java/org/apache/tamaya/ext/cdi/ConfigurationInjector.java
@@ -0,0 +1,81 @@
+/*
+ * 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.ext.cdi;
+
+import org.apache.tamaya.core.internal.inject.ConfiguredInstancesManager;
+import org.apache.tamaya.core.internal.inject.ConfiguredType;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Vetoed;
+import javax.enterprise.inject.spi.*;
+import java.util.*;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+@Vetoed
+public final class ConfigurationInjector implements Extension {
+
+ public <T> void initializeConfiguredFields(final @Observes ProcessInjectionTarget<T> pit) {
+ final AnnotatedType<T> at = pit.getAnnotatedType();
+ if (!ConfiguredType.isConfigured(at.getJavaClass())) {
+ return;
+ }
+ final ConfiguredType configuredType = new ConfiguredType(at.getJavaClass());
+
+ final InjectionTarget<T> it = pit.getInjectionTarget();
+ InjectionTarget<T> wrapped = new InjectionTarget<T>() {
+ @Override
+ public void inject(T instance, CreationalContext<T> ctx) {
+ it.inject(instance, ctx);
+ configuredType.configure(instance);
+ ConfiguredInstancesManager.register(configuredType, instance);
+ }
+
+ @Override
+ public void postConstruct(T instance) {
+ it.postConstruct(instance);
+ }
+
+ @Override
+ public void preDestroy(T instance) {
+ it.dispose(instance);
+ }
+
+ @Override
+ public void dispose(T instance) {
+ it.dispose(instance);
+ }
+
+ @Override
+ public Set<InjectionPoint> getInjectionPoints() {
+ return it.getInjectionPoints();
+ }
+
+ @Override
+ public T produce(CreationalContext<T> ctx) {
+ return it.produce(ctx);
+ }
+ };
+ pit.setInjectionTarget(wrapped);
+ }
+
+
+}