commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/xmlunit XmlTestCase.java
Date Wed, 19 Mar 2003 21:56:29 GMT
rdonkin     2003/03/19 13:56:29

  Modified:    betwixt/src/test/org/apache/commons/betwixt/xmlunit
                        XmlTestCase.java
  Log:
  Fixed some nasty bugs which meant that the test weren't actually be carried out! Luckly,
everything seems to be right anyway.
  
  Revision  Changes    Path
  1.5       +14 -8     jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/xmlunit/XmlTestCase.java
  
  Index: XmlTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/xmlunit/XmlTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XmlTestCase.java	13 Feb 2003 18:41:49 -0000	1.4
  +++ XmlTestCase.java	19 Mar 2003 21:56:29 -0000	1.5
  @@ -94,7 +94,7 @@
     */
   public class XmlTestCase extends TestCase {
   
  -    private static final boolean debug = false;
  +    protected static boolean debug = false;
   
       DocumentBuilderFactory domFactory;
   
  @@ -114,6 +114,8 @@
                                   org.w3c.dom.Document documentTwo)
                                       throws 
                                           AssertionFailedError {
  +        log("Testing documents:" + documentOne.getDocumentElement().getNodeName() 
  +            + " and " + documentTwo.getDocumentElement().getNodeName());
           xmlAssertIsomorphicContent(documentOne, documentTwo, false);
       }
   
  @@ -149,7 +151,8 @@
           xmlAssertIsomorphic(
                               message, 
                               documentOne.getDocumentElement(), 
  -                            documentTwo.getDocumentElement());
  +                            documentTwo.getDocumentElement(),
  +                            orderIndependent);
       }
    
       
  @@ -302,13 +305,14 @@
               List listTwo = sanitize(nodeTwo.getChildNodes());
   
               if (orderIndependent) {
  +                log("[Order Independent]");
                   Comparator nodeByName = new NodeByNameComparator();
                   Collections.sort(listOne, nodeByName);
                   Collections.sort(listTwo, nodeByName);
               }
               
               Iterator it = listOne.iterator();
  -            Iterator iter2 = listOne.iterator();
  +            Iterator iter2 = listTwo.iterator();
               while (it.hasNext() & iter2.hasNext()) {
                   Node nextOne = ((Node)it.next());
                   Node nextTwo = ((Node)iter2.next());
  @@ -322,7 +326,7 @@
                           listTwo.size());           
                           
               it = listOne.iterator();
  -            iter2 = listOne.iterator();
  +            iter2 = listTwo.iterator();
               while (it.hasNext() & iter2.hasNext()) {	
                   Node nextOne = ((Node)it.next());
                   Node nextTwo = ((Node)iter2.next());
  @@ -416,6 +420,8 @@
                   if ( !( nodes.item(i).getNodeValue() == null ||  
                           nodes.item(i).getNodeValue().trim().length() == 0 )) {
                       list.add(nodes.item(i));
  +                } else {
  +                    log("Ignoring text node:" + nodes.item(i).getNodeValue());
                   }
               } else {
                   list.add(nodes.item(i));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message