commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r657960 - /commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfiguration.java
Date Mon, 19 May 2008 20:26:20 GMT
Author: oheger
Date: Mon May 19 13:26:20 2008
New Revision: 657960

URL: http://svn.apache.org/viewvc?rev=657960&view=rev
Log:
Added a unit test for the addNodes() method when attribute nodes are involved

Modified:
    commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfiguration.java

Modified: commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfiguration.java?rev=657960&r1=657959&r2=657960&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfiguration.java
Mon May 19 13:26:20 2008
@@ -28,6 +28,7 @@
 import org.apache.commons.configuration.HierarchicalConfiguration.Node;
 import org.apache.commons.configuration.event.ConfigurationEvent;
 import org.apache.commons.configuration.event.ConfigurationListener;
+import org.apache.commons.configuration.tree.ConfigurationNode;
 import org.apache.commons.configuration.tree.DefaultConfigurationNode;
 import org.apache.commons.configuration.tree.DefaultExpressionEngine;
 import org.apache.commons.configuration.tree.ExpressionEngine;
@@ -675,6 +676,20 @@
     }
 
     /**
+     * Tests adding an attribute node with the addNodes() method.
+     */
+    public void testAddNodesAttributeNode()
+    {
+        Collection nodes = new ArrayList();
+        ConfigurationNode nd = createNode("length", "10");
+        nd.setAttribute(true);
+        nodes.add(nd);
+        config.addNodes("tables.table(0).fields.field(1)", nodes);
+        assertEquals("Attribute was not added", "10", config
+                .getString("tables.table(0).fields.field(1)[@length]"));
+    }
+
+    /**
      * Tests removing children from a configuration node.
      */
     public void testNodeRemove()



Mime
View raw message