commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1417638 - in /commons/proper/configuration/trunk/src: main/java/org/apache/commons/configuration/builder/combined/ test/java/org/apache/commons/configuration/builder/combined/ test/resources/
Date Wed, 05 Dec 2012 20:44:19 GMT
Author: oheger
Date: Wed Dec  5 20:44:18 2012
New Revision: 1417638

URL: http://svn.apache.org/viewvc?rev=1417638&view=rev
Log:
Added more features to CombinedConfigurationBuilder: support for combiner configuration and
custom builder providers.

Added:
    commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml   (with
props)
Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParameters.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedConfigurationBuilder.java
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParameters.java
    commons/proper/configuration/trunk/src/test/resources/testExtendedXMLConfigurationProvider.xml

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParameters.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParameters.java?rev=1417638&r1=1417637&r2=1417638&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParameters.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParameters.java
Wed Dec  5 20:44:18 2012
@@ -17,6 +17,7 @@
 package org.apache.commons.configuration.builder.combined;
 
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -53,6 +54,17 @@ public class CombinedBuilderParameters i
     /** The definition configuration builder. */
     private ConfigurationBuilder<? extends HierarchicalConfiguration> definitionBuilder;
 
+    /** A map with registered configuration builder providers. */
+    private final Map<String, ConfigurationBuilderProvider> providers;
+
+    /**
+     * Creates a new instance of {@code CombinedBuilderParameters}.
+     */
+    public CombinedBuilderParameters()
+    {
+        providers = new HashMap<String, ConfigurationBuilderProvider>();
+    }
+
     /**
      * Looks up an instance of this class in the specified parameters map. This
      * is equivalent to {@code fromParameters(params, false};}
@@ -119,6 +131,94 @@ public class CombinedBuilderParameters i
     }
 
     /**
+     * Registers the given {@code ConfigurationBuilderProvider} for the
+     * specified tag name. This means that whenever this tag is encountered in a
+     * configuration definition file, the corresponding builder provider is
+     * invoked.
+     *
+     * @param tagName the name of the tag (must not be <b>null</b>)
+     * @param provider the {@code ConfigurationBuilderProvider} (must not be
+     *        <b>null</b>)
+     * @return a reference to this object for method chaining
+     * @throws IllegalArgumentException if a required parameter is missing
+     */
+    public CombinedBuilderParameters registerProvider(String tagName,
+            ConfigurationBuilderProvider provider)
+    {
+        if (tagName == null)
+        {
+            throw new IllegalArgumentException("Tag name must not be null!");
+        }
+        if (provider == null)
+        {
+            throw new IllegalArgumentException("Provider must not be null!");
+        }
+
+        providers.put(tagName, provider);
+        return this;
+    }
+
+    /**
+     * Registers all {@code ConfigurationBuilderProvider}s in the given map to
+     * this object which have not yet been registered. This method is mainly
+     * used for internal purposes: a {@code CombinedConfigurationBuilder} takes
+     * the providers contained in a parameters object and adds all standard
+     * providers. This way it is possible to override a standard provider by
+     * registering a provider object for the same tag name at the parameters
+     * object.
+     *
+     * @param providers a map with tag names and corresponding providers
+     * @return a reference to this object for method chaining (must not be
+     *         <b>null</b> or contain <b>null</b> entries
+     * @throws IllegalArgumentException if the map with providers is <b>null</b>
+     *         or contains <b>null</b> entries
+     */
+    public CombinedBuilderParameters registerMissingProviders(
+            Map<String, ConfigurationBuilderProvider> providers)
+    {
+        if (providers == null)
+        {
+            throw new IllegalArgumentException(
+                    "Map with providers must not be null!");
+        }
+
+        for (Map.Entry<String, ConfigurationBuilderProvider> e : providers
+                .entrySet())
+        {
+            if (!this.providers.containsKey(e.getKey()))
+            {
+                registerProvider(e.getKey(), e.getValue());
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Returns an (unmodifiable) map with the currently registered
+     * {@code ConfigurationBuilderProvider} objects.
+     *
+     * @return the map with {@code ConfigurationBuilderProvider} objects (the
+     *         keys are the tag names)
+     */
+    public Map<String, ConfigurationBuilderProvider> getProviders()
+    {
+        return Collections.unmodifiableMap(providers);
+    }
+
+    /**
+     * Returns the {@code ConfigurationBuilderProvider} which is registered for
+     * the specified tag name or <b>null</b> if there is no registration for
+     * this tag.
+     *
+     * @param tagName the tag name
+     * @return the provider registered for this tag or <b>null</b>
+     */
+    public ConfigurationBuilderProvider providerForTag(String tagName)
+    {
+        return providers.get(tagName);
+    }
+
+    /**
      * {@inheritDoc} This implementation returns a map which contains this
      * object itself under a specific key. The static {@code fromParameters()}
      * method can be used to extract an instance from a parameters map.

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedConfigurationBuilder.java?rev=1417638&r1=1417637&r2=1417638&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedConfigurationBuilder.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedConfigurationBuilder.java
Wed Dec  5 20:44:18 2012
@@ -34,6 +34,7 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.SubnodeConfiguration;
 import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.commons.configuration.beanutils.BeanDeclaration;
+import org.apache.commons.configuration.beanutils.BeanHelper;
 import org.apache.commons.configuration.beanutils.XMLBeanDeclaration;
 import org.apache.commons.configuration.builder.BasicConfigurationBuilder;
 import org.apache.commons.configuration.builder.BuilderListener;
@@ -437,6 +438,9 @@ public class CombinedConfigurationBuilde
             ENV_PROVIDER*/
     };
 
+    /** A map with the default configuration builder providers. */
+    private static final Map<String, ConfigurationBuilderProvider> DEFAULT_PROVIDERS_MAP;
+
     /**
      * A specialized {@code StrLookup} object which operates on the combined
      * configuration constructed by this builder. This object is used as
@@ -458,9 +462,6 @@ public class CombinedConfigurationBuilde
 //        }
 //    };
 //
-    /** Stores a map with the registered configuration builder providers. */
-    private final Map<String, ConfigurationBuilderProvider> providers =
-            new HashMap<String, ConfigurationBuilderProvider>();
 
     /** The builder for the definition configuration. */
     private ConfigurationBuilder<? extends HierarchicalConfiguration> definitionBuilder;
@@ -471,6 +472,9 @@ public class CombinedConfigurationBuilde
     /** The object with data about configuration sources. */
     private ConfigurationSourceData sourceData;
 
+    /** Stores the current parameters object. */
+    private CombinedBuilderParameters currentParameters;
+
     /** Stores the base path to the configuration sources to load. */
     private String configurationBasePath;
 
@@ -481,7 +485,6 @@ public class CombinedConfigurationBuilde
     public CombinedConfigurationBuilder()
     {
         super(CombinedConfiguration.class);
-        initialize();
     }
 
     /**
@@ -493,7 +496,6 @@ public class CombinedConfigurationBuilde
     public CombinedConfigurationBuilder(Map<String, Object> params)
     {
         super(CombinedConfiguration.class, params);
-        initialize();
     }
 
     /**
@@ -506,15 +508,6 @@ public class CombinedConfigurationBuilde
     public CombinedConfigurationBuilder(Map<String, Object> params, boolean allowFailOnInit)
     {
         super(CombinedConfiguration.class, params, allowFailOnInit);
-        initialize();
-    }
-
-    /**
-     * Initializes this instance.
-     */
-    private void initialize()
-    {
-        registerDefaultProviders();
     }
 
     /**
@@ -545,55 +538,6 @@ public class CombinedConfigurationBuilde
     }
 
     /**
-     * Adds a {@code ConfigurationBuilderProvider} for the specified tag.
-     * Whenever this tag is encountered in the configuration definition file
-     * this provider will be called to create the configuration builder object.
-     *
-     * @param tagName the name of the tag in the configuration definition file
-     *        (must not be <b>null</b>
-     * @param provider the provider for this tag (must not be <b>null</b>
-     * @throws IllegalArgumentException if a required parameter is missing
-     */
-    public void addConfigurationProvider(String tagName,
-            ConfigurationBuilderProvider provider)
-    {
-        if (tagName == null)
-        {
-            throw new IllegalArgumentException("Tag name must not be null!");
-        }
-        if (provider == null)
-        {
-            throw new IllegalArgumentException("Provider must not be null!");
-        }
-
-        providers.put(tagName, provider);
-    }
-
-    /**
-     * Removes the {@code ConfigurationBuilderProvider} for the specified tag name.
-     *
-     * @param tagName the tag name
-     * @return the removed configuration provider or <b>null</b> if none was
-     * registered for that tag
-     */
-    public ConfigurationBuilderProvider removeConfigurationProvider(String tagName)
-    {
-        return providers.remove(tagName);
-    }
-
-    /**
-     * Returns the {@code ConfigurationBuilderProvider} for the given tag.
-     *
-     * @param tagName the name of the tag
-     * @return the provider that was registered for this tag or <b>null</b> if
-     * there is none
-     */
-    public ConfigurationBuilderProvider providerForTag(String tagName)
-    {
-        return providers.get(tagName);
-    }
-
-    /**
      * Returns the configuration provided by this builder. If the boolean
      * parameter is <b>true</b>, the configuration definition file will be
      * loaded. It will then be parsed, and instances for the declared
@@ -612,7 +556,6 @@ public class CombinedConfigurationBuilde
         initFileSystem();
         initSystemProperties();
         configureEntityResolver();
-        registerConfiguredProviders();
         registerConfiguredLookups();
 
 //        CombinedConfiguration result = createResultConfiguration();
@@ -787,12 +730,15 @@ public class CombinedConfigurationBuilde
         }
 
         ConfigurationSourceData data = getSourceData();
-        createAndAddConfigurations(result, data.getOverrideBuilders(), data);
+        initNodeCombinerListNodes(result, config, KEY_OVERRIDE_LIST);
+        registerConfiguredProviders(config);
 
+        createAndAddConfigurations(result, data.getOverrideBuilders(), data);
         if (!data.getUnionBuilders().isEmpty())
         {
             CombinedConfiguration addConfig = createAdditionalsConfiguration(result);
             result.addConfiguration(addConfig, ADDITIONAL_NAME);
+            initNodeCombinerListNodes(addConfig, config, KEY_ADDITIONAL_LIST);
             createAndAddConfigurations(addConfig, data.getUnionBuilders(), data);
         }
     }
@@ -824,36 +770,6 @@ public class CombinedConfigurationBuilde
     }
 
     /**
-     * Registers the default configuration providers supported by this class.
-     * This method will be called during initialization. It registers
-     * configuration providers for the tags that are supported by default.
-     */
-    protected void registerDefaultProviders()
-    {
-        for (int i = 0; i < DEFAULT_TAGS.length; i++)
-        {
-            addConfigurationProvider(DEFAULT_TAGS[i], DEFAULT_PROVIDERS[i]);
-        }
-    }
-
-    /**
-     * Registers providers defined in the configuration.
-     *
-     * @throws ConfigurationException if an error occurs
-     */
-    protected void registerConfiguredProviders() throws ConfigurationException
-    {
-//        List<SubnodeConfiguration> nodes = configurationsAt(KEY_CONFIGURATION_PROVIDERS);
-//        for (SubnodeConfiguration config : nodes)
-//        {
-//            XMLBeanDeclaration decl = new XMLBeanDeclaration(config);
-//            String key = config.getString(KEY_PROVIDER_KEY);
-//            addConfigurationProvider(key, (BaseConfigurationBuilderProvider) BeanHelper
-//                    .createBean(decl));
-//        }
-    }
-
-    /**
      * Registers StrLookups defined in the configuration.
      *
      * @throws ConfigurationException if an error occurs
@@ -938,6 +854,34 @@ public class CombinedConfigurationBuilde
 //    }
 
     /**
+     * Returns the {@code ConfigurationBuilderProvider} for the given tag. This
+     * method is called during creation of the result configuration. (It is not
+     * allowed to call it at another point of time; result is then
+     * unpredictable!) It supports all default providers and custom providers
+     * added through the parameters object as well.
+     *
+     * @param tagName the name of the tag
+     * @return the provider that was registered for this tag or <b>null</b> if
+     *         there is none
+     */
+    protected ConfigurationBuilderProvider providerForTag(String tagName)
+    {
+        return currentParameters.providerForTag(tagName);
+    }
+
+    /**
+     * Initializes the current parameters object. This object has either been
+     * passed at builder configuration time or it is newly created. In any
+     * case, it is manipulated during result creation.
+     */
+    private void setUpCurrentParameters()
+    {
+        currentParameters =
+                CombinedBuilderParameters.fromParameters(getParameters(), true);
+        currentParameters.registerMissingProviders(DEFAULT_PROVIDERS_MAP);
+    }
+
+    /**
      * Obtains the data object for the configuration sources and the
      * corresponding builders. This object is created on first access and reset
      * when the definition builder sends a change event. This method is called
@@ -966,12 +910,34 @@ public class CombinedConfigurationBuilde
     private ConfigurationSourceData createSourceData()
             throws ConfigurationException
     {
+        setUpCurrentParameters();
         ConfigurationSourceData result = new ConfigurationSourceData();
         result.initFromDefinitionConfiguration(getDefinitionConfiguration());
         return result;
     }
 
     /**
+     * Registers providers defined in the configuration.
+     *
+     * @param defConfig the definition configuration
+     * @throws ConfigurationException if an error occurs
+     */
+    private void registerConfiguredProviders(HierarchicalConfiguration defConfig)
+            throws ConfigurationException
+    {
+        List<SubnodeConfiguration> nodes =
+                defConfig.configurationsAt(KEY_CONFIGURATION_PROVIDERS);
+        for (SubnodeConfiguration config : nodes)
+        {
+            XMLBeanDeclaration decl = new XMLBeanDeclaration(config);
+            String key = config.getString(KEY_PROVIDER_KEY);
+            currentParameters.registerProvider(key,
+                    (BaseConfigurationBuilderProvider) BeanHelper
+                            .createBean(decl));
+        }
+    }
+
+    /**
      * Adds a listener at the given definition builder which resets this builder
      * when a reset of the definition builder happens. This way it is ensured
      * that this builder produces a new combined configuration when its
@@ -997,6 +963,26 @@ public class CombinedConfigurationBuilde
     }
 
     /**
+     * Initializes the list nodes of the node combiner for the given combined
+     * configuration. This information can be set in the header section of the
+     * configuration definition file for both the override and the union
+     * combiners.
+     *
+     * @param cc the combined configuration to initialize
+     * @param defConfig the definition configuration
+     * @param key the key for the list nodes
+     */
+    private static void initNodeCombinerListNodes(CombinedConfiguration cc,
+            HierarchicalConfiguration defConfig, String key)
+    {
+        List<Object> listNodes = defConfig.getList(key);
+        for (Object listNode : listNodes)
+        {
+            cc.getNodeCombiner().addListNode((String) listNode);
+        }
+    }
+
+    /**
      * Queries the current {@code Configuration} objects from the given builders
      * and adds them to the specified combined configuration.
      *
@@ -1031,6 +1017,27 @@ public class CombinedConfigurationBuilde
     }
 
     /**
+     * Creates the map with the default configuration builder providers.
+     *
+     * @return the map with default providers
+     */
+    private static Map<String, ConfigurationBuilderProvider> createDefaultProviders()
+    {
+        Map<String, ConfigurationBuilderProvider> providers =
+                new HashMap<String, ConfigurationBuilderProvider>();
+        for (int i = 0; i < DEFAULT_TAGS.length; i++)
+        {
+            providers.put(DEFAULT_TAGS[i], DEFAULT_PROVIDERS[i]);
+        }
+        return providers;
+    }
+
+    static
+    {
+        DEFAULT_PROVIDERS_MAP = createDefaultProviders();
+    }
+
+    /**
      * A data class for storing information about all configuration sources
      * defined for a combined builder.
      */

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParameters.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParameters.java?rev=1417638&r1=1417637&r2=1417638&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParameters.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParameters.java
Wed Dec  5 20:44:18 2012
@@ -16,9 +16,11 @@
  */
 package org.apache.commons.configuration.builder.combined;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -26,6 +28,7 @@ import java.util.Map;
 import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.commons.configuration.builder.BasicConfigurationBuilder;
 import org.apache.commons.configuration.builder.ConfigurationBuilder;
+import org.easymock.EasyMock;
 import org.junit.Test;
 
 /**
@@ -87,4 +90,124 @@ public class TestCombinedBuilderParamete
         assertSame("Builder was not set", builder,
                 params.getDefinitionBuilder());
     }
+
+    /**
+     * Tests whether the map with providers is initially empty.
+     */
+    @Test
+    public void testGetProvidersInitial()
+    {
+        CombinedBuilderParameters params = new CombinedBuilderParameters();
+        assertTrue("Got providers", params.getProviders().isEmpty());
+    }
+
+    /**
+     * Tests whether a new builder provider can be registered.
+     */
+    @Test
+    public void testRegisterProvider()
+    {
+        ConfigurationBuilderProvider provider =
+                EasyMock.createMock(ConfigurationBuilderProvider.class);
+        EasyMock.replay(provider);
+        String tagName = "testTag";
+        CombinedBuilderParameters params = new CombinedBuilderParameters();
+        assertSame("Wrong result", params,
+                params.registerProvider(tagName, provider));
+        Map<String, ConfigurationBuilderProvider> providers =
+                params.getProviders();
+        assertEquals("Wrong number of providers", 1, providers.size());
+        assertSame("Wrong provider (1)", provider, providers.get(tagName));
+        assertSame("Wrong provider (2)", provider,
+                params.providerForTag(tagName));
+    }
+
+    /**
+     * Tries to register a provider without a tag name.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testRegisterProviderNoTag()
+    {
+        new CombinedBuilderParameters().registerProvider(null,
+                EasyMock.createMock(ConfigurationBuilderProvider.class));
+    }
+
+    /**
+     * Tries to register a null provider.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testRegisterProviderNoProvider()
+    {
+        new CombinedBuilderParameters().registerProvider("aTag", null);
+    }
+
+    /**
+     * Tests that the map with providers cannot be modified.
+     */
+    @Test(expected = UnsupportedOperationException.class)
+    public void testGetProvidersModify()
+    {
+        CombinedBuilderParameters params = new CombinedBuilderParameters();
+        params.getProviders().put("tag",
+                EasyMock.createMock(ConfigurationBuilderProvider.class));
+    }
+
+    /**
+     * Tests whether missing providers can be registered.
+     */
+    @Test
+    public void testRegisterMissingProviders()
+    {
+        ConfigurationBuilderProvider provider1 =
+                EasyMock.createMock(ConfigurationBuilderProvider.class);
+        ConfigurationBuilderProvider provider2 =
+                EasyMock.createMock(ConfigurationBuilderProvider.class);
+        ConfigurationBuilderProvider provider3 =
+                EasyMock.createMock(ConfigurationBuilderProvider.class);
+        String tagPrefix = "testTag";
+        CombinedBuilderParameters params = new CombinedBuilderParameters();
+        params.registerProvider(tagPrefix, provider1);
+        Map<String, ConfigurationBuilderProvider> map =
+                new HashMap<String, ConfigurationBuilderProvider>();
+        map.put(tagPrefix, provider2);
+        map.put(tagPrefix + 1, provider3);
+        assertSame("Wrong result", params, params.registerMissingProviders(map));
+        assertEquals("Wrong number of providers", 2, params.getProviders()
+                .size());
+        assertSame("Wrong provider (1)", provider1,
+                params.providerForTag(tagPrefix));
+        assertSame("Wrong provider (2)", provider3,
+                params.providerForTag(tagPrefix + 1));
+    }
+
+    /**
+     * Tries to register a null map with missing providers.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testRegisterMissingProvidersNullMap()
+    {
+        new CombinedBuilderParameters().registerMissingProviders(null);
+    }
+
+    /**
+     * Tries to register a map with missing providers containing a null entry.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testRegisterMissingProvidersNullEntry()
+    {
+        Map<String, ConfigurationBuilderProvider> map =
+                new HashMap<String, ConfigurationBuilderProvider>();
+        map.put("tag", null);
+        new CombinedBuilderParameters().registerMissingProviders(map);
+    }
+
+    /**
+     * Tests the result for an unknown provider.
+     */
+    @Test
+    public void testProviderForUnknown()
+    {
+        CombinedBuilderParameters params = new CombinedBuilderParameters();
+        assertNull("Got a provider", params.providerForTag("someTag"));
+    }
 }

Modified: commons/proper/configuration/trunk/src/test/resources/testExtendedXMLConfigurationProvider.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/resources/testExtendedXMLConfigurationProvider.xml?rev=1417638&r1=1417637&r2=1417638&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/resources/testExtendedXMLConfigurationProvider.xml
(original)
+++ commons/proper/configuration/trunk/src/test/resources/testExtendedXMLConfigurationProvider.xml
Wed Dec  5 20:44:18 2012
@@ -18,37 +18,11 @@
 <!-- Test configuration definition file that demonstrates complex initialization -->
 <configuration>
   <header>
-    <result delimiterParsingDisabled="true">
-      <nodeCombiner config-class="org.apache.commons.configuration.tree.OverrideCombiner"/>
-      <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
-    </result>
     <providers>
       <provider config-tag="test"
-                config-class="org.apache.commons.configuration.DefaultConfigurationBuilder$XMLConfigurationProvider"
-                configurationClass="org.apache.commons.configuration.TestDefaultConfigurationBuilder$ExtendedXMLConfiguration"/>
+                config-class="org.apache.commons.configuration.builder.combined.TestCombinedConfigurationBuilder$BuilderProviderTestImpl"
+                propertyKey="testKey"/>
     </providers>
-    <combiner>
-      <override>
-        <list-nodes>
-          <node>table</node>
-          <node>list</node>
-        </list-nodes>
-      </override>
-    </combiner>
   </header>
-  <system/>
-  <properties fileName="test.properties" throwExceptionOnMissing="true"
-    config-name="properties">
-    <reloadingStrategy config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"
-      refreshDelay="10000"/>
-  </properties>
-  <!-- Fetch the file name from a variable -->
-  <test fileName="${test_file_xml}" config-name="xml">
-    <expressionEngine config-class="org.apache.commons.configuration.tree.DefaultExpressionEngine"
-      propertyDelimiter="/" indexStart="[" indexEnd="]"/>
-  </test>
-  <additional>
-    <xml config-name="combiner1" fileName="${test_file_combine}"/>  -->
-    <xml config-name="combiner2" fileName="testcombine2.xml"/>
-  </additional>
+  <test/>
 </configuration>
\ No newline at end of file

Added: commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml?rev=1417638&view=auto
==============================================================================
--- commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml (added)
+++ commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml Wed
Dec  5 20:44:18 2012
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+   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.
+-->
+<!-- Test configuration definition file that demonstrates complex initialization
+     of the result configuration in the header section.
+-->
+<configuration>
+  <header>
+    <result delimiterParsingDisabled="true" forceReloadCheck="true"
+      ignoreReloadExceptions="true">
+      <nodeCombiner config-class="org.apache.commons.configuration.tree.OverrideCombiner"/>
+      <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
+    </result>
+    <combiner>
+      <override>
+        <list-nodes>
+          <node>table</node>
+          <node>list</node>
+        </list-nodes>
+      </override>
+    </combiner>
+  </header>
+  <properties fileName="test.properties" throwExceptionOnMissing="true"
+    config-name="properties">
+  </properties>
+  <additional>
+    <xml config-name="combiner1" fileName="testcombine1.xml"/>  -->
+    <xml config-name="combiner2" fileName="testcombine2.xml"/>
+  </additional>
+</configuration>

Propchange: commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: commons/proper/configuration/trunk/src/test/resources/testResultInitialization.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message