commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r629085 - in /commons/proper/configuration/branches/configuration2_experimental: src/main/java/org/apache/commons/configuration2/ src/test/java/org/apache/commons/configuration2/ src/test/resources/ xdocs/
Date Tue, 19 Feb 2008 12:07:18 GMT
Author: ebourg
Date: Tue Feb 19 04:07:15 2008
New Revision: 629085

URL: http://svn.apache.org/viewvc?rev=629085&view=rev
Log:
Added the <environment/> tag to the configuration descriptor

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/resources/testDigesterConfiguration3.xml
    commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java?rev=629085&r1=629084&r2=629085&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
Tue Feb 19 04:07:15 2008
@@ -291,12 +291,16 @@
     private static final ConfigurationProvider XML_PROVIDER = new XMLConfigurationProvider();
 
     /** Constant for the provider for JNDI sources. */
-    private static final ConfigurationProvider JNDI_PROVIDER = new ConfigurationProvider(
-            JNDIConfiguration.class);
+    private static final ConfigurationProvider JNDI_PROVIDER =
+            new ConfigurationProvider(JNDIConfiguration.class);
 
     /** Constant for the provider for system properties. */
-    private static final ConfigurationProvider SYSTEM_PROVIDER = new ConfigurationProvider(
-            SystemConfiguration.class);
+    private static final ConfigurationProvider SYSTEM_PROVIDER =
+            new ConfigurationProvider(SystemConfiguration.class);
+
+    /** Constant for the provider for environment properties. */
+    private static final ConfigurationProvider ENVIRONMENT_PROVIDER =
+            new ConfigurationProvider(EnvironmentConfiguration.class);
 
     /** Constant for the provider for plist files. */
     private static final ConfigurationProvider PLIST_PROVIDER = new FileExtensionConfigurationProvider(
@@ -309,12 +313,12 @@
 
     /** An array with the names of the default tags. */
     private static final String[] DEFAULT_TAGS =
-    {"properties", "xml", "hierarchicalXml", "jndi", "system", "plist", "configuration"};
+    {"properties", "xml", "hierarchicalXml", "jndi", "system", "environment", "plist", "configuration"};
 
     /** An array with the providers for the default tags. */
     private static final ConfigurationProvider[] DEFAULT_PROVIDERS =
     {PROPERTIES_PROVIDER, XML_PROVIDER, XML_PROVIDER, JNDI_PROVIDER,
-            SYSTEM_PROVIDER, PLIST_PROVIDER, BUILDER_PROVIDER};
+            SYSTEM_PROVIDER, ENVIRONMENT_PROVIDER, PLIST_PROVIDER, BUILDER_PROVIDER};
 
     /**
      * The serial version UID.

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java?rev=629085&r1=629084&r2=629085&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
Tue Feb 19 04:07:15 2008
@@ -589,8 +589,10 @@
 
         // test SystemConfiguration
         assertNotNull(config.getProperty("java.version"));
-        assertEquals(System.getProperty("java.version"), config
-                .getString("java.version"));
+        assertEquals(System.getProperty("java.version"), config.getString("java.version"));
+
+        // test EnvironmentConfiguration
+        assertNotNull("JAVA_HOME property not found", config.getProperty("JAVA_HOME"));
     }
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/resources/testDigesterConfiguration3.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/resources/testDigesterConfiguration3.xml?rev=629085&r1=629084&r2=629085&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/resources/testDigesterConfiguration3.xml
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/resources/testDigesterConfiguration3.xml
Tue Feb 19 04:07:15 2008
@@ -4,6 +4,7 @@
 <configuration>
   <additional>
     <system/>
+    <environment/>
     <xml fileName="test.xml"/>
     <hierarchicalXml fileName="testDigesterConfigurationInclude1.xml" at="tables"/>
     <properties fileName="testDigesterConfigurationInclude2.properties" at="mail"/>

Modified: commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml?rev=629085&r1=629084&r2=629085&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml (original)
+++ commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml Tue
Feb 19 04:07:15 2008
@@ -50,6 +50,10 @@
       <action dev="ebourg" type="remove">
         HierarchicalXMLConfiguration has been removed, XMLConfiguration should be used instead.
       </action>
+      <action dev="ebourg" type="add">
+        The &lt;environment/> tag can be specified in a configuration descriptor
+        in order to create an EnvironmentConfiguration.          
+      </action>
     </release>
 
     <release version="1.6" date="in SVN" description="">



Mime
View raw message