commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r764949 - in /commons/proper/configuration/trunk: conf/testExpression.xml pom.xml src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java
Date Tue, 14 Apr 2009 20:56:47 GMT
Author: rgoers
Date: Tue Apr 14 20:56:46 2009
New Revision: 764949

URL: http://svn.apache.org/viewvc?rev=764949&view=rev
Log:
DefaultConfigurationBuilder was not registering the lookup with itself

Modified:
    commons/proper/configuration/trunk/conf/testExpression.xml
    commons/proper/configuration/trunk/pom.xml
    commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
    commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java

Modified: commons/proper/configuration/trunk/conf/testExpression.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/conf/testExpression.xml?rev=764949&r1=764948&r2=764949&view=diff
==============================================================================
--- commons/proper/configuration/trunk/conf/testExpression.xml (original)
+++ commons/proper/configuration/trunk/conf/testExpression.xml Tue Apr 14 20:56:46 2009
@@ -10,7 +10,8 @@
           config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
     </result>
     <lookups>
-      <lookup config-prefix="expr" 
+      <lookup config-prefix="mdc" config-class="org.slf4j.ext.MDCStrLookup"/>
+      <lookup config-prefix="expr"
               config-class="org.apache.commons.configuration.interpol.ExprLookup">
         <variables>
           <variable name="String" value="Class:org.apache.commons.lang.StringUtils"/>
@@ -24,7 +25,7 @@
     </providers>
   </header>
   <override>
-    <multifile filePattern='$$${expr:String.right("$[sys:Id]", 2)}/testMultiConfiguration_$$${sys:Id}.xml'
+    <multifile filePattern='$$${expr:String.right("$[mdc:Id]", 2)}/testMultiConfiguration_$$${sys:Id}.xml'
                config-name="clientConfig" delimiterParsingDisabled="true">
        <expressionEngine
           config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>

Modified: commons/proper/configuration/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/pom.xml?rev=764949&r1=764948&r2=764949&view=diff
==============================================================================
--- commons/proper/configuration/trunk/pom.xml (original)
+++ commons/proper/configuration/trunk/pom.xml Tue Apr 14 20:56:46 2009
@@ -155,12 +155,12 @@
             <role>Java Developer</role>
           </roles>
         </developer>
-      
+
         <developer>
           <name>Ralph Goers</name>
           <id>rgoers</id>
           <email>rgoers@apache.org</email>
-          <organization>Intuit</organization>         
+          <organization>Intuit</organization>
           <timezone>-8</timezone>
           <roles>
             <role>Java Developer</role>
@@ -269,7 +269,15 @@
       <version>1.5.6</version>
       <scope>test</scope>
     </dependency>
-      
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-ext</artifactId>
+      <version>1.5.6</version>
+      <scope>test</scope>
+    </dependency>
+
+
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
@@ -315,7 +323,7 @@
       <artifactId>xml-apis</artifactId>
       <version>1.0.b2</version>
       <scope>provided</scope>
-    </dependency>    
+    </dependency>
 
     <dependency>
       <groupId>xml-resolver</groupId>
@@ -423,7 +431,7 @@
     <commons.binary.suffix></commons.binary.suffix>
     <commons.jira.id>CONFIGURATION</commons.jira.id>
     <commons.jira.pid>12310467</commons.jira.pid>
-  </properties> 
+  </properties>
 
   <build>
     <sourceDirectory>src/java</sourceDirectory>

Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java?rev=764949&r1=764948&r2=764949&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
(original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
Tue Apr 14 20:56:46 2009
@@ -706,6 +706,7 @@
             StrLookup lookup = (StrLookup) BeanHelper.createBean(decl);
             BeanHelper.setProperty(lookup, "configuration", this);
             ConfigurationInterpolator.registerGlobalLookup(key, lookup);
+            this.getInterpolator().registerLookup(key, lookup);
         }
     }
 

Modified: commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java?rev=764949&r1=764948&r2=764949&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java
(original)
+++ commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java
Tue Apr 14 20:56:46 2009
@@ -971,6 +971,7 @@
         factory.setFile(EXPRESSION_FILE);
         factory.setAttributeSplittingDisabled(true);
         System.getProperties().remove("Id");
+        org.slf4j.MDC.clear();
 
         CombinedConfiguration config = factory.getConfiguration(true);
         assertTrue("Incorrect configuration", config instanceof DynamicCombinedConfiguration);
@@ -981,6 +982,7 @@
     private void verify(String key, CombinedConfiguration config, int rows)
     {
         System.setProperty("Id", key);
+        org.slf4j.MDC.put("Id", key);
         int actual = config.getInt("rowsPerPage");
         assertTrue("expected: " + rows + " actual: " + actual, actual == rows);
     }



Mime
View raw message