commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1587021 - /commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/TestCombinedConfiguration.java
Date Sun, 13 Apr 2014 16:04:28 GMT
Author: oheger
Date: Sun Apr 13 16:04:28 2014
New Revision: 1587021

URL: http://svn.apache.org/r1587021
Log:
Added another test for getSource() with a nested combined configuration.

Changed a test with sub configurations to expose a problem with updating a
combined configuration: When accessing the model of a combined configuration
that has been invalidated it is not always reconstructed.

Modified:
    commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/TestCombinedConfiguration.java

Modified: commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/TestCombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/TestCombinedConfiguration.java?rev=1587021&r1=1587020&r2=1587021&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/TestCombinedConfiguration.java
(original)
+++ commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/TestCombinedConfiguration.java
Sun Apr 13 16:04:28 2014
@@ -550,6 +550,18 @@ public class TestCombinedConfiguration
     }
 
     /**
+     * Tests getSource() if a child configuration is again a combined configuration.
+     */
+    @Test
+    public void testGetSourceWithCombinedChildConfiguration()
+    {
+        setUpSourceTest();
+        CombinedConfiguration cc = new CombinedConfiguration();
+        cc.addConfiguration(config);
+        assertEquals("Wrong source", config, cc.getSource(TEST_KEY));
+    }
+
+    /**
      * Tests whether multiple sources of a key can be retrieved.
      */
     @Test
@@ -1028,9 +1040,9 @@ public class TestCombinedConfiguration
                 config.configurationAt(SUB_KEY, true);
         assertTrue("Wrong value before update", sub.getBoolean(TEST_KEY));
         srcConfig.setProperty(TEST_KEY, Boolean.FALSE);
+        assertFalse("Wrong value after update", sub.getBoolean(TEST_KEY));
         assertFalse("Wrong value from combined configuration",
                 config.getBoolean(SUB_KEY + '.' + TEST_KEY));
-        assertFalse("Wrong value after update", sub.getBoolean(TEST_KEY));
     }
 
     /**



Mime
View raw message