ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r664608 - /ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/DOMUtilTest.java
Date Mon, 09 Jun 2008 02:55:30 GMT
Author: kevj
Date: Sun Jun  8 19:55:29 2008
New Revision: 664608

URL: http://svn.apache.org/viewvc?rev=664608&view=rev
Log:
-fix test, problem was caused by addition of license comment and using incorrect method to
get the doc root element

Modified:
    ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/DOMUtilTest.java

Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/DOMUtilTest.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/DOMUtilTest.java?rev=664608&r1=664607&r2=664608&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/DOMUtilTest.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/DOMUtilTest.java
Sun Jun  8 19:55:29 2008
@@ -17,33 +17,33 @@
  */
 package org.apache.tools.ant.taskdefs.optional.junit;
 
-import junit.framework.TestCase;
+import java.io.IOException;
+import java.io.InputStream;
 
 import javax.xml.parsers.DocumentBuilder;
 
+import junit.framework.TestCase;
+
 import org.apache.tools.ant.util.JAXPUtils;
 import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
-import java.io.InputStream;
-import java.io.IOException;
-
 public class DOMUtilTest extends TestCase {
     public void testListChildNodes() throws SAXException, IOException {
         DocumentBuilder db = JAXPUtils.getDocumentBuilder();
         InputStream is = this.getClass().getClassLoader().getResourceAsStream("taskdefs/optional/junit/matches.xml");
         Document doc = db.parse(is);
-        NodeList nl = DOMUtil.listChildNodes(doc.getFirstChild(), new FooNodeFilter(), true);
-        assertEquals(nl.getLength(), 3);
+        NodeList nl = DOMUtil.listChildNodes(doc.getDocumentElement(), new FooNodeFilter(),
true);
+        assertEquals("expecting 3", 3, nl.getLength());
     }
     public class FooNodeFilter implements DOMUtil.NodeFilter {
         public boolean accept(Node node) {
             if (node.getNodeName().equals("foo")) {
                 return true;
             }
-            return false;  //To change body of implemented methods use File | Settings |
File Templates.
+            return false;
         }
     }
 }



Mime
View raw message