incubator-tamaya git commit: Disabled the formats module as it not compile.
Repository: incubator-tamaya Updated Branches: refs/heads/master 240f9a525 - 4a6d1dafb Disabled the formats module as it not compile. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/4a6d1daf Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/4a6d1daf Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/4a6d1daf Branch: refs/heads/master Commit: 4a6d1dafb7e740dfbf3cb0287f0ed0d298c00a65 Parents: 240f9a5 Author: Oliver B. Fischer ple...@apache.org Authored: Fri Feb 13 20:41:48 2015 +0100 Committer: Oliver B. Fischer ple...@apache.org Committed: Fri Feb 13 20:41:48 2015 +0100 -- modules/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/4a6d1daf/modules/pom.xml -- diff --git a/modules/pom.xml b/modules/pom.xml index bbe0424..cbe1d92 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -36,7 +36,7 @@ under the License. modules modulebuilder/module moduleinjection/module -moduleformats/module +!--moduleformats/module-- modulejson/module moduleresolver/module moduleresources/module
[2/4] incubator-tamaya git commit: TAMAYA-63: Fixed checlstyle warnings.
TAMAYA-63: Fixed checlstyle warnings. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/0e6044b1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/0e6044b1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/0e6044b1 Branch: refs/heads/master Commit: 0e6044b19f706d51808758122b0a44dfb7e58a30 Parents: f97d12b Author: anatole anat...@apache.org Authored: Fri Feb 13 21:11:46 2015 +0100 Committer: anatole anat...@apache.org Committed: Fri Feb 13 21:17:14 2015 +0100 -- .../core/internal/converters/URLConverter.java | 7 ++--- .../core/internal/converters/URiConverter.java | 7 ++--- .../core/internal/converters/ByteConverter.java | 16 +- .../internal/converters/ClassConverter.java | 14 - .../internal/converters/IntegerConverter.java | 7 ++--- .../internal/converters/NumberConverter.java| 14 + .../internal/converters/ShortConverter.java | 33 ++-- .../core/internal/converters/URLConverter.java | 4 +-- .../core/internal/converters/URiConverter.java | 6 ++-- .../internal/converters/ZoneIdConverter.java| 5 +-- modules/pom.xml | 2 +- 11 files changed, 55 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0e6044b1/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java -- diff --git a/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java b/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java index c91fab6..272fdd8 100644 --- a/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java +++ b/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URLConverter.java @@ -28,17 +28,16 @@ import java.util.logging.Logger; /** * Converter, converting from String to URI, using new URL(value). */ -public class URLConverter implements PropertyConverterURL{ +public class URLConverter implements PropertyConverterURL { private Logger LOG = Logger.getLogger(getClass().getName()); @Override public URL convert(String value) { String trimmed = Objects.requireNonNull(value).trim(); -try{ +try { return new URL(trimmed); -} -catch(Exception e){ +} catch (Exception e) { LOG.log(Level.FINE, Unparseable URL: + trimmed, e); } return null; http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0e6044b1/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URiConverter.java -- diff --git a/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URiConverter.java b/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URiConverter.java index b422d10..14a7f1d 100644 --- a/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URiConverter.java +++ b/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/URiConverter.java @@ -28,17 +28,16 @@ import java.util.logging.Logger; /** * Converter, converting from String to URI, using new URI(value). */ -public class URiConverter implements PropertyConverterURI{ +public class URiConverter implements PropertyConverterURI { private Logger LOG = Logger.getLogger(getClass().getName()); @Override public URI convert(String value) { String trimmed = Objects.requireNonNull(value).trim(); -try{ +try { return new URI(trimmed); -} -catch(Exception e){ +} catch (Exception e) { LOG.log(Level.FINE, Unparseable URI: + trimmed, e); } return null; http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0e6044b1/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java -- diff --git a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java index b12eeab..7802d25 100644 --- a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java +++ b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java @@ -27,21 +27,21 @@ import java.util.logging.Logger; /** * Converter, converting from String to Byte, the supported format is one of the following: * ul - * li0xFF/li - * li0XFF/li - * li45/li - * li-34/li - * li0D1/li + * li0xFF/li + *
incubator-tamaya git commit: Fixed RAT and CheckStyle errors.
Repository: incubator-tamaya Updated Branches: refs/heads/master cf8eb0eab - f97d12b58 Fixed RAT and CheckStyle errors. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/f97d12b5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/f97d12b5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/f97d12b5 Branch: refs/heads/master Commit: f97d12b58f21abe213c5a921c6d3ec3a78b83380 Parents: cf8eb0e Author: Oliver B. Fischer ple...@apache.org Authored: Fri Feb 13 21:09:40 2015 +0100 Committer: Oliver B. Fischer ple...@apache.org Committed: Fri Feb 13 21:09:40 2015 +0100 -- modules/apiextensions/pom.xml | 18 ++ .../apiextensions/api/PropertySourceFactory.java | 3 +++ 2 files changed, 21 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/f97d12b5/modules/apiextensions/pom.xml -- diff --git a/modules/apiextensions/pom.xml b/modules/apiextensions/pom.xml index 881fc4b..f32d2b1 100644 --- a/modules/apiextensions/pom.xml +++ b/modules/apiextensions/pom.xml @@ -1,4 +1,22 @@ ?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 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. +-- 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; http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/f97d12b5/modules/apiextensions/src/main/java/org/apache/tamaya/modules/apiextensions/api/PropertySourceFactory.java -- diff --git a/modules/apiextensions/src/main/java/org/apache/tamaya/modules/apiextensions/api/PropertySourceFactory.java b/modules/apiextensions/src/main/java/org/apache/tamaya/modules/apiextensions/api/PropertySourceFactory.java index 147548f..d28613d 100644 --- a/modules/apiextensions/src/main/java/org/apache/tamaya/modules/apiextensions/api/PropertySourceFactory.java +++ b/modules/apiextensions/src/main/java/org/apache/tamaya/modules/apiextensions/api/PropertySourceFactory.java @@ -22,6 +22,9 @@ import org.apache.tamaya.spi.PropertySource; import java.net.URL; +/** + * TBD + */ public interface PropertySourceFactory { boolean acceptable(URL url);
incubator-tamaya git commit: Fixed code style layout errors.
Repository: incubator-tamaya Updated Branches: refs/heads/master 4a6d1dafb - 39cddb0bc Fixed code style layout errors. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/39cddb0b Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/39cddb0b Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/39cddb0b Branch: refs/heads/master Commit: 39cddb0bccc63225f971a560e489e6b5df23c18d Parents: 4a6d1da Author: Oliver B. Fischer ple...@apache.org Authored: Fri Feb 13 20:53:57 2015 +0100 Committer: Oliver B. Fischer ple...@apache.org Committed: Fri Feb 13 20:53:57 2015 +0100 -- .../core/internal/converters/ByteConverter.java | 5 ++--- .../core/internal/converters/ClassConverter.java | 18 -- .../core/internal/converters/FloatConverter.java | 11 +++ .../internal/converters/IntegerConverter.java | 8 .../core/internal/converters/NumberConverter.java | 7 --- .../core/internal/converters/ShortConverter.java | 8 .../core/internal/converters/URLConverter.java| 7 --- .../core/internal/converters/URiConverter.java| 10 +- .../core/internal/converters/ZoneIdConverter.java | 8 9 files changed, 42 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39cddb0b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java -- diff --git a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java index 8c4257d..b12eeab 100644 --- a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java +++ b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ByteConverter.java @@ -49,10 +49,9 @@ public class ByteConverter implements PropertyConverterByte{ case MAX: return Byte.MAX_VALUE; default: -try{ +try { return Byte.decode(trimmed); -} -catch(Exception e){ +} catch (Exception e){ LOG.finest(Failed to parse Byte value: + value); return null; } http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39cddb0b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java -- diff --git a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java index 6288bd8..740d1d7 100644 --- a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java +++ b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/ClassConverter.java @@ -20,7 +20,6 @@ package org.apache.tamaya.core.internal.converters; import org.apache.tamaya.PropertyConverter; -import java.util.Locale; import java.util.Objects; import java.util.logging.Logger; @@ -39,22 +38,21 @@ public class ClassConverter implements PropertyConverterClass?{ @Override public Class? convert(String value) { String trimmed = Objects.requireNonNull(value).trim(); -try{ +try { return Class.forName(trimmed, false, Thread.currentThread().getContextClassLoader()); -} -catch(Exception e){ +} catch (Exception e) { LOG.finest(Class not found in context CL: + trimmed); } -try{ + +try { return Class.forName(trimmed, false, ClassConverter.class.getClassLoader()); -} -catch(Exception e){ +} catch(Exception e) { LOG.finest(Class not found in ClassConverter's CL: + trimmed); } -try{ + +try { return Class.forName(trimmed, false, ClassLoader.getSystemClassLoader()); -} -catch(Exception e){ +} catch (Exception e){ LOG.finest(Class not found in System CL (giving up): + trimmed); return null; } http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/39cddb0b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java -- diff --git a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/FloatConverter.java index df202b5..fbb6362 100644 ---
incubator-tamaya git commit: Removed useless things on dormant.
Repository: incubator-tamaya Updated Branches: refs/heads/master 68c9c7fcf - c15fb1c64 Removed useless things on dormant. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/c15fb1c6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/c15fb1c6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/c15fb1c6 Branch: refs/heads/master Commit: c15fb1c64139c486579bfa35b08c42c4979dd885 Parents: 68c9c7f Author: anatole anat...@apache.org Authored: Fri Feb 13 21:26:23 2015 +0100 Committer: anatole anat...@apache.org Committed: Fri Feb 13 21:26:23 2015 +0100 -- .../internal/DefaultServiceContextTest.java | 131 +++ .../core/internal/PropetiesFileLoaderTest.java | 75 +++ ...tServiceContextTest$InvalidPriorityInterface | 19 +++ ...efaultServiceContextTest$MultiImplsInterface | 20 +++ .../org.apache.tamaya.spi.PropertySource| 22 ...org.apache.tamaya.spi.PropertySourceProvider | 20 +++ .../test/resources/javaconfiguration.properties | 22 .../test/resources/overrideOrdinal.properties | 25 .../core/src/test/resources/testfile.properties | 22 9 files changed, 356 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c15fb1c6/dormant/core/src/test/java/org/apache/tamaya/core/internal/DefaultServiceContextTest.java -- diff --git a/dormant/core/src/test/java/org/apache/tamaya/core/internal/DefaultServiceContextTest.java b/dormant/core/src/test/java/org/apache/tamaya/core/internal/DefaultServiceContextTest.java new file mode 100644 index 000..d14c24a --- /dev/null +++ b/dormant/core/src/test/java/org/apache/tamaya/core/internal/DefaultServiceContextTest.java @@ -0,0 +1,131 @@ +/* + * 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.internal; + +import org.apache.tamaya.ConfigException; +import org.apache.tamaya.spi.ConfigurationContext; +import org.junit.Assert; +import org.junit.Test; + +import javax.annotation.Priority; +import java.util.List; +import java.util.Optional; + +public class DefaultServiceContextTest { + +/** + * context to test + */ +private DefaultServiceContext context = new DefaultServiceContext(); + + +//@Test +//public void testGetService() { +//OptionalConfigurationContext configurationContext = context.getService(ConfigurationContext.class); +// +//Assert.assertNotNull(configurationContext); +//Assert.assertTrue(configurationContext.isPresent()); +//Assert.assertTrue(configurationContext.get() instanceof DefaultConfigurationContext); +//} +// +//@Test(expected = ConfigException.class) +//public void testGetService_multipleServicesWithoutPriority_shouldThrowConfigException() { +//context.getService(InvalidPriorityInterface.class); +//} +// +//@Test +//public void testGetService_multipleService_shouldReturnServiceWithHighestPriority() { +//OptionalMultiImplsInterface service = context.getService(MultiImplsInterface.class); +// +//Assert.assertTrue(service.isPresent()); +//Assert.assertTrue(service.get() instanceof MultiImpl2); +//} +// +//@Test +//public void testGetService_noImpl_shouldReturnEmptyOpional() { +//OptionalNoImplInterface service = context.getService(NoImplInterface.class); +//Assert.assertFalse(service.isPresent()); +//} + + +@Test +public void testGetServices_shouldReturnServices() { +{ +ListInvalidPriorityInterface services = context.getServices(InvalidPriorityInterface.class); +Assert.assertNotNull(services); +Assert.assertEquals(2, services.size()); + +for (InvalidPriorityInterface service : services) { +Assert.assertTrue(service instanceof InvalidPriorityImpl1 || service instanceof InvalidPriorityImpl2); +} +} + +{ +
Build failed in Jenkins: Tamaya-Master-branch #210
See https://builds.apache.org/job/Tamaya-Master-branch/210/changes Changes: [plexus] Disabled the formats module as it not compile. [plexus] Fixed code style layout errors. [plexus] Added module for API extensions which are currently not part of the main API. JavaDoc will follow. [plexus] Fixed RAT and CheckStyle errors. [anatole] TAMAYA-63: Fixed checlstyle warnings. [anatole] Fixed checkstyle issues. [anatole] Reduced memory consumption for failsafe plugin. [anatole] Just updated refactoring done on dormant part (not compiling). [anatole] Removed useless things on dormant. [anatole] Added ConfiguratoinFOrmats singleton to formats module. -- [...truncated 3353 lines...] symbol: class ConfigurationData location: package org.apache.tamaya.format [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/formats/IniConfigurationFormat.java:[43,12] cannot find symbol symbol: class ConfigurationData location: class org.apache.tamaya.format.formats.IniConfigurationFormat [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/BaseSimpleFormatPropertySourceProvider.java:[66,73] cannot find symbol symbol: class ConfigurationData location: class org.apache.tamaya.format.BaseSimpleFormatPropertySourceProvider [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/BasePathBasedMultiFormatPropertySourceProvider.java:[113,25] cannot find symbol symbol: class ConfigurationData location: class org.apache.tamaya.format.BasePathBasedMultiFormatPropertySourceProvider [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/FlattenedDefaultPropertySource.java:[39,37] cannot find symbol symbol: variable ConfigurationData location: class org.apache.tamaya.format.FlattenedDefaultPropertySource [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationFormats.java:[72,9] cannot find symbol symbol: class ConfigurationData location: class org.apache.tamaya.format.ConfigurationFormats [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationDataBuilder.java:[100,28] cannot find symbol symbol: variable ConfigurationData location: class org.apache.tamaya.format.ConfigurationDataBuilder [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationDataBuilder.java:[121,30] cannot find symbol symbol: variable ConfigurationData location: class org.apache.tamaya.format.ConfigurationDataBuilder [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/ConfigurationDataBuilder.java:[129,20] cannot find symbol symbol: class ConfigurationData location: class org.apache.tamaya.format.ConfigurationDataBuilder [ERROR] https://builds.apache.org/job/Tamaya-Master-branch/ws/modules/formats/src/main/java/org/apache/tamaya/format/formats/IniConfigurationFormat.java:[70,45] cannot find symbol symbol: variable ConfigurationData location: class org.apache.tamaya.format.formats.IniConfigurationFormat [INFO] 21 errors [INFO] - [INFO] [INFO] Reactor Summary: [INFO] [INFO] Apache Tamaya . SUCCESS [ 24.377 s] [INFO] Apache Tamaya Build Configuration . SUCCESS [ 4.572 s] [INFO] Apache Tamaya Java 7 Parent ... SUCCESS [ 3.501 s] [INFO] Apache Tamaya Java 7 API .. SUCCESS [ 16.338 s] [INFO] Apache Tamaya Java 7 Core . SUCCESS [ 21.121 s] [INFO] Apache Tamaya Java 8 Parent ... SUCCESS [ 4.197 s] [INFO] Apache Tamaya Java 8 API .. SUCCESS [ 15.637 s] [INFO] Apache Tamaya Java 8 Core . SUCCESS [ 32.632 s] [INFO] Apache Tamaya Extension Modules ... SUCCESS [ 4.018 s] [INFO] Apache Tamaya Builder . SUCCESS [ 17.036 s] [INFO] Apache Tamaya API Extensions .. SUCCESS [ 11.288 s] [INFO] Apache Tamaya Resource Services ... SUCCESS [ 17.318 s] [INFO] Apache Tamaya Resolver Services ... SUCCESS [ 17.543 s] [INFO] Apache Tamaya Injection Support ... SUCCESS [ 18.675 s] [INFO] Apache Tamaya Format Services . FAILURE [ 0.709 s] [INFO] Apache Tamaya JSON Support SKIPPED [INFO] [INFO] BUILD
[2/2] incubator-tamaya git commit: Added ConfiguratoinFOrmats singleton to formats module. Moved commons-config related aspects into separate integration module.
Added ConfiguratoinFOrmats singleton to formats module. Moved commons-config related aspects into separate integration module. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/bd997069 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/bd997069 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/bd997069 Branch: refs/heads/master Commit: bd9970692dd545f6b526b448f3ae159c3e6786a7 Parents: c15fb1c Author: anatole anat...@apache.org Authored: Sat Feb 14 00:49:07 2015 +0100 Committer: anatole anat...@apache.org Committed: Sat Feb 14 00:49:07 2015 +0100 -- .gitignore | 2 + dormant/api/PropertyMapSupplier.java| 37 -- dormant/buildtools/pom.xml | 35 - .../src/main/java/old/AggregationPolicy.java| 133 --- .../java/old/EnvPropertiesConfigProvider.java | 54 dormant/core/src/main/java/old/Orderable.java | 34 - .../core/src/main/java/old/OrdinalProvider.java | 37 -- .../java/old/PropertyAdapterProviderSpi.java| 36 - .../old/SystemPropertiesConfigProvider.java | 54 .../tamaya/core/internal/format/IniFormat.java | 98 -- .../core/internal/format/PropertiesFormat.java | 61 - .../internal/format/PropertiesXmlFormat.java| 62 - .../resources/AntPathClasspathResolver.java | 60 - .../internal/resources/AntPathFileResolver.java | 61 - .../resources/DefaultResourceLoader.java| 81 --- .../properties/EnvironmentPropertySource.java | 48 --- .../core/properties/MapBasedPropertySource.java | 98 -- .../SystemPropertiesPropertySource.java | 55 .../apache/tamaya/core/spi/PathResolver.java| 45 --- dormant/pom.xml | 35 + modules/formats/pom.xml | 5 - .../format/CommonsConfigPropertySource.java | 79 --- .../tamaya/format/ConfigurationFormat.java | 4 + .../tamaya/format/ConfigurationFormats.java | 88 .../format/FlattenedDefaultPropertySource.java | 60 + .../tamaya/format/IniConfigurationFormat.java | 57 .../apache/tamaya/format/PropertiesFormat.java | 57 .../tamaya/format/PropertiesXmlFormat.java | 56 .../format/formats/IniConfigurationFormat.java | 84 .../tamaya/format/formats/PropertiesFormat.java | 61 + .../format/formats/PropertiesXmlFormat.java | 60 + modules/integration/commons/pom.xml | 50 +++ .../commons/CommonsConfigPropertySource.java| 81 +++ .../commons/IniConfigurationFormat.java | 60 + modules/integration/pom.xml | 3 +- 35 files changed, 587 insertions(+), 1344 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/bd997069/.gitignore -- diff --git a/.gitignore b/.gitignore index b97b7b5..194682a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ release.properties .project .settings .classpath + +modules/integration/commons-config/commons-configuration.iml \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/bd997069/dormant/api/PropertyMapSupplier.java -- diff --git a/dormant/api/PropertyMapSupplier.java b/dormant/api/PropertyMapSupplier.java deleted file mode 100644 index 69dd308..000 --- a/dormant/api/PropertyMapSupplier.java +++ /dev/null @@ -1,37 +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; - -import java.util.Map; - -/** - * Supplier for a property map. - */ -@FunctionalInterface -public interface PropertyMapSupplier { - -/** - * Access the current properties as Map. The resulting Map may not return all items
[1/2] incubator-tamaya git commit: Added ConfiguratoinFOrmats singleton to formats module. Moved commons-config related aspects into separate integration module.
Repository: incubator-tamaya Updated Branches: refs/heads/master c15fb1c64 - bd9970692 http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/bd997069/modules/integration/commons/src/main/java/org/apache/tamaya/integration/commons/IniConfigurationFormat.java -- diff --git a/modules/integration/commons/src/main/java/org/apache/tamaya/integration/commons/IniConfigurationFormat.java b/modules/integration/commons/src/main/java/org/apache/tamaya/integration/commons/IniConfigurationFormat.java new file mode 100644 index 000..2f80977 --- /dev/null +++ b/modules/integration/commons/src/main/java/org/apache/tamaya/integration/commons/IniConfigurationFormat.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.integration.commons; + +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.HierarchicalINIConfiguration; +import org.apache.commons.configuration.SubnodeConfiguration; +import org.apache.tamaya.ConfigException; +import org.apache.tamaya.format.ConfigurationData; +import org.apache.tamaya.format.ConfigurationDataBuilder; +import org.apache.tamaya.format.ConfigurationFormat; + +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * Implements a ini file format based on the APache Commons + * {@link org.apache.commons.configuration.HierarchicalINIConfiguration}. + */ +public class IniConfigurationFormat implements ConfigurationFormat { + +@Override +public ConfigurationData readConfiguration(URL url) { +ConfigurationDataBuilder builder = ConfigurationDataBuilder.of(url, this); +try { +HierarchicalINIConfiguration commonIniConfiguration = new HierarchicalINIConfiguration(url); +for(String section:commonIniConfiguration.getSections()){ +SubnodeConfiguration sectionConfig = commonIniConfiguration.getSection(section); +MapString, String properties = new HashMap(); +IteratorString keyIter = sectionConfig.getKeys(); +while(keyIter.hasNext()){ +String key = keyIter.next(); +properties.put(key, sectionConfig.getString(key)); +} +builder.addProperties(section, properties); +} +} catch (ConfigurationException e) { +throw new ConfigException(Failed to parse ini-file format from + url, e); +} +return builder.build(); +} +} http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/bd997069/modules/integration/pom.xml -- diff --git a/modules/integration/pom.xml b/modules/integration/pom.xml index efc019d..105e0ac 100644 --- a/modules/integration/pom.xml +++ b/modules/integration/pom.xml @@ -23,7 +23,7 @@ under the License. parent artifactIdtamaya-extensions-all/artifactId groupIdorg.apache.tamaya.ext/groupId -version0.1-SNAPSHOT/version +version0.1-incubating-SNAPSHOT/version relativePath../relativePath /parent packagingpom/packaging @@ -34,6 +34,7 @@ under the License. modules modulecdi/module modulese/module +modulecommons/module /modules /project \ No newline at end of file