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 2015/08/03 21:19:11 UTC

[1/2] incubator-tamaya git commit: Fixed documentation generation for use cases. Started to remove refs for images/icons.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 61c32a6f9 -> 687abeed2


Fixed documentation generation for use cases. Started to remove refs for images/icons.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/687abeed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/687abeed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/687abeed

Branch: refs/heads/master
Commit: 687abeed2e9cb3c332440b4e6d7feafeb1034507
Parents: ef18894
Author: anatole <at...@gmail.com>
Authored: Mon Aug 3 21:18:21 2015 +0200
Committer: anatole <at...@gmail.com>
Committed: Mon Aug 3 21:18:57 2015 +0200

----------------------------------------------------------------------
 docs/pom.xml                                    |  2 +-
 docs/src/main/asciidoc/API.adoc                 |  2 --
 docs/src/main/asciidoc/Core.adoc                |  2 --
 .../main/asciidoc/uc/dynamic-provisioning.adoc  |  1 +
 docs/src/main/asciidoc/uc/formats.adoc          |  1 +
 docs/src/main/asciidoc/uc/java8.adoc            |  1 +
 docs/src/main/asciidoc/uc/locations.adoc        |  1 +
 docs/src/main/asciidoc/uc/service-context.adoc  |  1 +
 docs/src/main/asciidoc/uc/simple-access.adoc    |  7 ++++
 docs/src/main/asciidoc/uc/templates.adoc        |  1 +
 docs/src/main/asciidoc/usecases.adoc            | 36 ++++++++++----------
 11 files changed, 32 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/pom.xml
----------------------------------------------------------------------
diff --git a/docs/pom.xml b/docs/pom.xml
index d774ebd..f210969 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -92,7 +92,7 @@ under the License.
                             <sourceHighlighter>coderay</sourceHighlighter>
                             <backend>html</backend>
                             <embedAssets>true</embedAssets>
-                            <imagesDir>${project.basedir}/images/icons</imagesDir>
+                            <!-- imagesDir>${project.basedir}/images/icons</imagesDir -->
                             <preserveDirectories>true</preserveDirectories>
                         </configuration>
                     </execution>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/API.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/API.adoc b/docs/src/main/asciidoc/API.adoc
index d9b1031..83c5127 100644
--- a/docs/src/main/asciidoc/API.adoc
+++ b/docs/src/main/asciidoc/API.adoc
@@ -12,10 +12,8 @@ Apache Tamaya -- API
 :email: <an...@apache.org>
 :source-highlighter: coderay
 :website: http://tamaya.incubator.apache.org/
-:iconsdir: {imagesdir}/icons
 :toc:
 :toc-placement: manual
-:icons:
 :encoding: UTF-8
 :numbered:
 // Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/Core.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/Core.adoc b/docs/src/main/asciidoc/Core.adoc
index 4c6c4b3..dec5a1b 100644
--- a/docs/src/main/asciidoc/Core.adoc
+++ b/docs/src/main/asciidoc/Core.adoc
@@ -12,10 +12,8 @@ Apache Tamaya -- Core
 :email: <an...@apache.org>
 :source-highlighter: coderay
 :website: http://tamaya.incubator.apache.org/
-:iconsdir: {imagesdir}/icons
 :toc:
 :toc-placement: manual
-:icons:
 :encoding: UTF-8
 :numbered:
 // Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/uc/dynamic-provisioning.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/uc/dynamic-provisioning.adoc b/docs/src/main/asciidoc/uc/dynamic-provisioning.adoc
index 2facc67..1629914 100644
--- a/docs/src/main/asciidoc/uc/dynamic-provisioning.adoc
+++ b/docs/src/main/asciidoc/uc/dynamic-provisioning.adoc
@@ -3,6 +3,7 @@
 In Cloud Computing, especially the PaaS and SaaS areas a typical use case would be that an application (or server)
 is deployed, configured and started dynamically. Typically things are controlled by some "active controller components",
 which are capable of
+
 * creating new nodes (using IaaS services)
 * deploying and starting the required runtime platform , e.g. as part of a PaaS solution.
 * deploying and starting the application modules.

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/uc/formats.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/uc/formats.adoc b/docs/src/main/asciidoc/uc/formats.adoc
index 7383b0d..a5a1bf7 100644
--- a/docs/src/main/asciidoc/uc/formats.adoc
+++ b/docs/src/main/asciidoc/uc/formats.adoc
@@ -1,6 +1,7 @@
 === Configuration Formats
 
 Users want to be able to use the format they prefer.
+
 * properties, xml-properties and ini-format should be supported by default
 * Other/custom formats should be easily addable by registering or providing the format on configuration evaluation (read).
 * When possible Tamaya should figure out which format to be used and how the InputStream should be correctly

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/uc/java8.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/uc/java8.adoc b/docs/src/main/asciidoc/uc/java8.adoc
index fe892cb..0cdf069 100644
--- a/docs/src/main/asciidoc/uc/java8.adoc
+++ b/docs/src/main/asciidoc/uc/java8.adoc
@@ -5,6 +5,7 @@ should provide extension points for different aspects, where additional code can
 In short: were possible functional interfaces should be modelled.
 
 Examples:
+
 * code that converts a configuration to another kind of configuration: +UnaryOperator<Configuration>+
 * code that creates any kind of result based on a configuration: +Function<Configuration,T>+
 * Adapters for type conversion are defined as +Function<String,T>+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/uc/locations.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/uc/locations.adoc b/docs/src/main/asciidoc/uc/locations.adoc
index f18d7f6..5e0f774 100644
--- a/docs/src/main/asciidoc/uc/locations.adoc
+++ b/docs/src/main/asciidoc/uc/locations.adoc
@@ -1,6 +1,7 @@
 === Configuration Locations
 
 Users want to be able to
+
 * read configuration from different locations.
 * By default classpath and file resources are
   supported. But similarly remote access using a JSON ReST call should be possible.

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/uc/service-context.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/uc/service-context.adoc b/docs/src/main/asciidoc/uc/service-context.adoc
index 31ffaaa..ceeea4a 100644
--- a/docs/src/main/asciidoc/uc/service-context.adoc
+++ b/docs/src/main/asciidoc/uc/service-context.adoc
@@ -3,6 +3,7 @@
 Tamaya should support an adaptable +ServiceContext+ to resolve any kind of implememntation services, both API services as core
 framework services. The +ServiceContext+ should be dynamically replecable by configuring an alternate instance of
 using the Java *ServiceContet+.
+
 This decouples component usage from its load and management part and als greatly simplifies integration with
 new/alternate runtime environments.
 The service context is exptected to provide

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/uc/simple-access.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/uc/simple-access.adoc b/docs/src/main/asciidoc/uc/simple-access.adoc
index bc1bf59..d4ada1e 100644
--- a/docs/src/main/asciidoc/uc/simple-access.adoc
+++ b/docs/src/main/asciidoc/uc/simple-access.adoc
@@ -5,7 +5,10 @@ mechanism, such as injection, but the SE mechanisms should work as well, so any
 portable to EE as well.
 This can only be achieved by providing a static accessor, e.g.
 
+[source,java]
+------------------------------------------------------------
 Configuration config = Configuration.current();
+------------------------------------------------------------
 
 The call above should work exactly the same in EE. To enable this the static call must be delegated in the
 internals of the singleton, depending on the runtime. In EE the executing component can behave contextually,
@@ -14,5 +17,9 @@ or even be loaded within the CDI environment (at least for post loading, applica
 Additionally in EE it should also be possible to inject Configuration, which gives you the same results as the call
 above:
 
+[source,java]
+------------------------------------------------------------
 @Inject
 private Configuration cfg;
+------------------------------------------------------------
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/uc/templates.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/uc/templates.adoc b/docs/src/main/asciidoc/uc/templates.adoc
index 0aff6c3..2aab3d2 100644
--- a/docs/src/main/asciidoc/uc/templates.adoc
+++ b/docs/src/main/asciidoc/uc/templates.adoc
@@ -9,3 +9,4 @@ or register listeners to DynamicValue instances returned.
 Templates hereby can easily be managed, but provide a excellent mechanism to provide type-safe configuration
 to clients in a very transparent way. Details can be controlled by using the same annotations as for
 normal configuration injection.
+

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/687abeed/docs/src/main/asciidoc/usecases.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/usecases.adoc b/docs/src/main/asciidoc/usecases.adoc
index 4c9d88a..07a5a94 100644
--- a/docs/src/main/asciidoc/usecases.adoc
+++ b/docs/src/main/asciidoc/usecases.adoc
@@ -37,23 +37,23 @@ toc::[]
 
 == Use Cases for Java SE Environments
 
-include::uc/simple-access.adoc[]
-include::uc/simple-property-access.adoc[]
-include::uc/value-placeholders.adoc[]
-include::uc/type-safe-properties.adoc[]
-include::uc/templates.adoc[]
-include::uc/java8.adoc[]
-include::uc/locations.adoc[]
-include::uc/formats.adoc[]
-include::uc/multiple-configurations.adoc[]
-include::uc/external-configuration.adoc[]
-include::uc/context-dependent-configuration.adoc[]
-include::uc/dynamic-provisioning.adoc[]
-include::uc/minimal-propertysource.adoc[]
-include::uc/scannable-properties.adoc[]
-include::uc/combine-configs.adoc[]
-include::uc/management.adoc[]
-include::uc/service-context.adoc[]
-include::uc/injection.adoc[]
+include::src/main/asciidoc/uc/simple-access.adoc[]
+include::src/main/asciidoc/uc/simple-property-access.adoc[]
+include::src/main/asciidoc/uc/value-placeholders.adoc[]
+include::src/main/asciidoc/uc/type-safe-properties.adoc[]
+include::src/main/asciidoc/uc/templates.adoc[]
+include::src/main/asciidoc/uc/java8.adoc[]
+include::src/main/asciidoc/uc/locations.adoc[]
+include::src/main/asciidoc/uc/formats.adoc[]
+include::src/main/asciidoc/uc/multiple-configurations.adoc[]
+include::src/main/asciidoc/uc/external-configuration.adoc[]
+include::src/main/asciidoc/uc/context-dependent-configuration.adoc[]
+include::src/main/asciidoc/uc/dynamic-provisioning.adoc[]
+include::src/main/asciidoc/uc/minimal-propertysource.adoc[]
+include::src/main/asciidoc/uc/scannable-properties.adoc[]
+include::src/main/asciidoc/uc/combine-configs.adoc[]
+include::src/main/asciidoc/uc/management.adoc[]
+include::src/main/asciidoc/uc/service-context.adoc[]
+include::src/main/asciidoc/uc/injection.adoc[]
 
 


[2/2] incubator-tamaya git commit: Added further tests and bugfixes. Renamed artifact to be in sync with parent base name.

Posted by an...@apache.org.
Added further tests and bugfixes. Renamed artifact to be in sync with parent base name.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/ef18894e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/ef18894e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/ef18894e

Branch: refs/heads/master
Commit: ef18894e5082e55affc00896157275042af06a05
Parents: 61c32a6
Author: anatole <at...@gmail.com>
Authored: Sun Aug 2 18:09:32 2015 +0200
Committer: anatole <at...@gmail.com>
Committed: Mon Aug 3 21:18:57 2015 +0200

----------------------------------------------------------------------
 sandbox/metamodels/simple/config/README.txt     | 20 +++++++++++++++++++
 .../metamodels/simple/config/test3.properties   | 21 ++++++++++++++++++++
 sandbox/metamodels/simple/pom.xml               |  8 +++++++-
 .../ConfigDirPropertySourceProvider.java        |  7 ++++++-
 ...org.apache.tamaya.spi.PropertySourceProvider |  2 +-
 .../tamaya/metamodel/simple/SimpleTest.java     |  6 ++++--
 6 files changed, 59 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/ef18894e/sandbox/metamodels/simple/config/README.txt
----------------------------------------------------------------------
diff --git a/sandbox/metamodels/simple/config/README.txt b/sandbox/metamodels/simple/config/README.txt
new file mode 100644
index 0000000..3dd71f5
--- /dev/null
+++ b/sandbox/metamodels/simple/config/README.txt
@@ -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 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.
+#
+This folder is for testing only. It contains some config files that are to be included by the
+ConfigDirPropertySourceProvider config provider.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/ef18894e/sandbox/metamodels/simple/config/test3.properties
----------------------------------------------------------------------
diff --git a/sandbox/metamodels/simple/config/test3.properties b/sandbox/metamodels/simple/config/test3.properties
new file mode 100644
index 0000000..9ddef76
--- /dev/null
+++ b/sandbox/metamodels/simple/config/test3.properties
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+tamaya.ordinal=100000
+test3=3-overridden
+test5=value5
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/ef18894e/sandbox/metamodels/simple/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/metamodels/simple/pom.xml b/sandbox/metamodels/simple/pom.xml
index 6665762..14ee897 100644
--- a/sandbox/metamodels/simple/pom.xml
+++ b/sandbox/metamodels/simple/pom.xml
@@ -26,7 +26,7 @@ under the License.
         <version>0.1-incubating-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
-    <artifactId>tamaya-metamodel-simple</artifactId>
+    <artifactId>tamaya-metamodels-simple</artifactId>
     <name>Apache Tamaya Modules Metamodels - Simple</name>
     <description>Simple Tamaya Metamodel, e.g. feasible for SE commandline tools and simple use cases.</description>
     <packaging>jar</packaging>
@@ -34,6 +34,12 @@ under the License.
     <dependencies>
         <dependency>
             <groupId>org.apache.tamaya</groupId>
+            <artifactId>tamaya-java7-core</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tamaya</groupId>
             <artifactId>tamaya-api</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/ef18894e/sandbox/metamodels/simple/src/main/java/org/apache/tamaya/metamodel/simple/internal/ConfigDirPropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/sandbox/metamodels/simple/src/main/java/org/apache/tamaya/metamodel/simple/internal/ConfigDirPropertySourceProvider.java b/sandbox/metamodels/simple/src/main/java/org/apache/tamaya/metamodel/simple/internal/ConfigDirPropertySourceProvider.java
index 0e6d3fe..83784a8 100644
--- a/sandbox/metamodels/simple/src/main/java/org/apache/tamaya/metamodel/simple/internal/ConfigDirPropertySourceProvider.java
+++ b/sandbox/metamodels/simple/src/main/java/org/apache/tamaya/metamodel/simple/internal/ConfigDirPropertySourceProvider.java
@@ -52,7 +52,7 @@ public class ConfigDirPropertySourceProvider extends AbstractPathPropertySourceP
             location += "/";
         }
         if (!location.startsWith("file:")) {
-            location += "file:";
+            location = "file:" + location;
         }
         return location + "**/*.*";
     }
@@ -61,6 +61,11 @@ public class ConfigDirPropertySourceProvider extends AbstractPathPropertySourceP
     protected Collection<PropertySource> getPropertySources(URL url) {
         try {
             ConfigurationData config = ConfigurationFormats.readConfigurationData(url);
+            if (config == null) {
+                Logger.getLogger(getClass().getName()).log(Level.INFO,
+                        "Failed to read configuration from " + url);
+                return Collections.emptySet();
+            }
             return asCollection(new FlattenedDefaultPropertySource(config));
         } catch (Exception e) {
             Logger.getLogger(getClass().getName()).log(Level.SEVERE,

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/ef18894e/sandbox/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
----------------------------------------------------------------------
diff --git a/sandbox/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider b/sandbox/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
index 931db19..2e963e2 100644
--- a/sandbox/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
+++ b/sandbox/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
@@ -17,4 +17,4 @@
 # under the License.
 #
 org.apache.tamaya.metamodel.simple.internal.ConfigDirPropertySourceProvider
-org.apache.tamaya.metamodel.simple.internal.MetaInfConfigPropertySourceProvider
\ No newline at end of file
+org.apache.tamaya.metamodel.simple.internal.MetainfConfigPropertySourceProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/ef18894e/sandbox/metamodels/simple/src/test/java/org/apache/tamaya/metamodel/simple/SimpleTest.java
----------------------------------------------------------------------
diff --git a/sandbox/metamodels/simple/src/test/java/org/apache/tamaya/metamodel/simple/SimpleTest.java b/sandbox/metamodels/simple/src/test/java/org/apache/tamaya/metamodel/simple/SimpleTest.java
index 5492e25..677d8fc 100644
--- a/sandbox/metamodels/simple/src/test/java/org/apache/tamaya/metamodel/simple/SimpleTest.java
+++ b/sandbox/metamodels/simple/src/test/java/org/apache/tamaya/metamodel/simple/SimpleTest.java
@@ -5,7 +5,6 @@ import org.apache.tamaya.ConfigurationProvider;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 
 /**
  * Created by Anatole on 26.07.2015.
@@ -17,8 +16,11 @@ public class SimpleTest {
         Configuration config = ConfigurationProvider.getConfiguration();
         assertEquals(config.get("test1"), "1");
         assertEquals(config.get("test2"), "2");
-        assertEquals(config.get("test3"), "3");
+        // overridden by file config
+        assertEquals(config.get("test3"), "3-overridden");
         assertEquals(config.get("test4"), "4");
+        // added by file config
+        assertEquals(config.get("test5"), "value5");
     }
 
 }