commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1546646 - in /commons/proper/configuration/trunk/src: main/java/org/apache/commons/configuration/builder/combined/ test/java/org/apache/commons/configuration/builder/combined/
Date Fri, 29 Nov 2013 20:55:15 GMT
Author: oheger
Date: Fri Nov 29 20:55:15 2013
New Revision: 1546646

URL: http://svn.apache.org/r1546646
Log:
Removed addChildParameters() method from CombinedBuilderProperties.

This method is no longer needed as the initialization mechanism has been
replaced by another one based on default parameters handlers.

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParametersImpl.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderProperties.java
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParametersImpl.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParametersImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParametersImpl.java?rev=1546646&r1=1546645&r2=1546646&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParametersImpl.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderParametersImpl.java
Fri Nov 29 20:55:15 2013
@@ -320,21 +320,6 @@ public class CombinedBuilderParametersIm
     }
 
     /**
-     * {@inheritDoc} This implementation stores the passed in object in an
-     * internal collection. From there it can be queried later to perform
-     * initialization of a combined builder's child configuration sources.
-     */
-    public CombinedBuilderParametersImpl addChildParameters(
-            BuilderParameters params)
-    {
-        if (params != null)
-        {
-            childParameters.add(params);
-        }
-        return this;
-    }
-
-    /**
      * Returns a collection with default parameter objects for child
      * configuration sources. This collection contains the same objects (in the
      * same order) that were passed to {@code addChildParameters()}. The

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderProperties.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderProperties.java?rev=1546646&r1=1546645&r2=1546646&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderProperties.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/combined/CombinedBuilderProperties.java
Fri Nov 29 20:55:15 2013
@@ -92,29 +92,6 @@ public interface CombinedBuilderProperti
     T setDefinitionBuilderParameters(BuilderParameters params);
 
     /**
-     * Adds a parameters object with default parameters for child configuration
-     * sources. With this method an arbitrary number of parameters objects can
-     * be set. When creating builders for child configuration sources, their
-     * parameters are initialized with all matching properties from these
-     * default parameters. For instance, this method could be called passing in
-     * a parameters object for XML configurations. Then all XML configuration
-     * sources declared in the definition configuration will be initialized with
-     * the properties defined here. If a parameters object for a base class is
-     * passed (e.g. {@code FileBasedBuilderParametersImpl} or
-     * {@code BasicBuilderParameters}), all parameter objects derived from these
-     * base classes are initialized with the corresponding properties. So by
-     * making use of classes in the hierarchy of parameter objects, default
-     * values for specific types of configuration sources can be set in a
-     * fine-grained way. (It is still possible to override properties for a
-     * specific configuration source in the definition file.) This method can be
-     * called multiple times for defining different default parameter objects.
-     *
-     * @param params the default parameters object (can be <b>null</b>)
-     * @return a reference to this object for method chaining
-     */
-    T addChildParameters(BuilderParameters params);
-
-    /**
      * Sets a {@code DefaultParametersManager} object responsible for managing the default
      * parameter handlers to be applied on child configuration sources. When creating
      * builders for child configuration sources their parameters are initialized using

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParametersImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParametersImpl.java?rev=1546646&r1=1546645&r2=1546646&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParametersImpl.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedBuilderParametersImpl.java
Fri Nov 29 20:55:15 2013
@@ -23,9 +23,7 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.commons.beanutils.PropertyUtils;
@@ -36,10 +34,8 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.builder.ConfigurationBuilder;
 import org.apache.commons.configuration.builder.DefaultParametersHandler;
 import org.apache.commons.configuration.builder.DefaultParametersManager;
-import org.apache.commons.configuration.builder.PropertiesBuilderParametersImpl;
 import org.apache.commons.configuration.builder.XMLBuilderParametersImpl;
 import org.apache.commons.configuration.builder.fluent.FileBasedBuilderParameters;
-import org.apache.commons.configuration.tree.ExpressionEngine;
 import org.easymock.EasyMock;
 import org.junit.Test;
 
@@ -354,47 +350,6 @@ public class TestCombinedBuilderParamete
     }
 
     /**
-     * Tests whether default parameters for child sources can be added.
-     */
-    @Test
-    public void testAddChildParameters()
-    {
-        ExpressionEngine engine = EasyMock.createMock(ExpressionEngine.class);
-        CombinedBuilderParametersImpl params =
-                new CombinedBuilderParametersImpl();
-        XMLBuilderParametersImpl xmlParams = new XMLBuilderParametersImpl();
-        xmlParams.setExpressionEngine(engine);
-        xmlParams.setValidating(true);
-        assertSame("Wrong result (1)", params,
-                params.addChildParameters(xmlParams));
-        PropertiesBuilderParametersImpl prpParams =
-                new PropertiesBuilderParametersImpl();
-        prpParams.setIncludesAllowed(false);
-        assertSame("Wrong result (2)", params,
-                params.addChildParameters(prpParams));
-        Collection<? extends BuilderParameters> list =
-                params.getDefaultChildParameters();
-        assertEquals("Wrong number of parameters objects", 2, list.size());
-        Iterator<? extends BuilderParameters> it = list.iterator();
-        assertSame("Wrong parameters object (1)", xmlParams, it.next());
-        assertSame("Wrong parameters object (2)", prpParams, it.next());
-    }
-
-    /**
-     * Tests whether a null parameters object is handled correctly by
-     * addChildParameters().
-     */
-    @Test
-    public void testAddChildParametersNullParams()
-    {
-        CombinedBuilderParametersImpl params =
-                new CombinedBuilderParametersImpl();
-        params.addChildParameters((BuilderParameters) null);
-        assertTrue("Got child parameters", params.getDefaultChildParameters()
-                .isEmpty());
-    }
-
-    /**
      * Tests whether a default parameters manager is dynamically created if it has not
      * been set.
      */



Mime
View raw message