commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r637616 - /commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestSubConfiguration.java
Date Sun, 16 Mar 2008 17:38:24 GMT
Author: oheger
Date: Sun Mar 16 10:38:22 2008
New Revision: 637616

URL: http://svn.apache.org/viewvc?rev=637616&view=rev
Log:
Uncomment test using XPathExpressionEngine

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestSubConfiguration.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestSubConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestSubConfiguration.java?rev=637616&r1=637615&r2=637616&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestSubConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestSubConfiguration.java
Sun Mar 16 10:38:22 2008
@@ -26,6 +26,7 @@
 import junit.framework.TestCase;
 
 import org.apache.commons.configuration2.expr.ExpressionEngine;
+import org.apache.commons.configuration2.expr.xpath.XPathExpressionEngine;
 import org.apache.commons.configuration2.tree.ConfigurationNode;
 import org.easymock.EasyMock;
 
@@ -260,28 +261,27 @@
                 .getListDelimiter());
     }
 
-// TODO uncomment when XPathExpressionEngine has been ported
-//    /**
-//     * Tests changing the expression engine.
-//     */
-//    public void testSetExpressionEngine()
-//    {
-//        parent.setExpressionEngine(new XPathExpressionEngine());
-//        setUpSubnodeConfig();
-//        assertEquals("Wrong field name", TABLE_FIELDS[0][1], config
-//                .getString("fields/field[2]/name"));
-//        Set<String> keys = new HashSet<String>();
-//        for (Iterator<?> it = config.getKeys(); it.hasNext();)
-//        {
-//            keys.add(it.next().toString());
-//        }
-//        assertEquals("Wrong number of keys", 2, keys.size());
-//        assertTrue("Key 1 not contained", keys.contains("name"));
-//        assertTrue("Key 2 not contained", keys.contains("fields/field/name"));
-//        config.setExpressionEngine(null);
-//        assertTrue("Expression engine reset on parent", parent
-//                .getExpressionEngine() instanceof XPathExpressionEngine);
-//    }
+    /**
+     * Tests changing the expression engine.
+     */
+    public void testSetExpressionEngine()
+    {
+        parent.setExpressionEngine(new XPathExpressionEngine());
+        setUpSubnodeConfig();
+        assertEquals("Wrong field name", TABLE_FIELDS[0][1], config
+                .getString("fields/field[2]/name"));
+        Set<String> keys = new HashSet<String>();
+        for (Iterator<?> it = config.getKeys(); it.hasNext();)
+        {
+            keys.add(it.next().toString());
+        }
+        assertEquals("Wrong number of keys", 2, keys.size());
+        assertTrue("Key 1 not contained", keys.contains("name"));
+        assertTrue("Key 2 not contained", keys.contains("fields/field/name"));
+        config.setExpressionEngine(null);
+        assertTrue("Expression engine reset on parent", parent
+                .getExpressionEngine() instanceof XPathExpressionEngine);
+    }
 
     /**
      * Tests the configurationAt() method.



Mime
View raw message