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 Tue, 01 Jul 2003 21:39:31 GMT
rdonkin     2003/07/01 14:39:31

  Modified:    betwixt/src/test/org/apache/commons/betwixt/xmlunit
                        XmlTestCase.java
  Log:
  Improved xml unit tester
  
  Revision  Changes    Path
  1.7       +23 -5     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XmlTestCase.java	24 Mar 2003 20:22:21 -0000	1.6
  +++ XmlTestCase.java	1 Jul 2003 21:39:31 -0000	1.7
  @@ -70,6 +70,7 @@
   import java.io.File;
   import java.io.IOException;
   import java.io.StringReader;
  +import java.io.StringWriter;
   
   import javax.xml.parsers.DocumentBuilder;
   import javax.xml.parsers.DocumentBuilderFactory;
  @@ -321,7 +322,8 @@
               }
   
               assertEquals(
  -                        (null == message ? "(Unequal child nodes)" : message + "(Unequal
child nodes)"), 
  +                        (null == message ? "(Unequal child nodes@" + nodeOne.getNodeName()
+")": 
  +                                message + "(Unequal child nodes @" + nodeOne.getNodeName()
+")"), 
                           listOne.size(), 
                           listTwo.size());           
                           
  @@ -361,6 +363,22 @@
           }
           
           return domFactory;
  +    }
  +    
  +    protected Document parseString(StringWriter writer) {
  +        try { 
  +        
  +            return createDocumentBuilder().parse(new InputSource(new StringReader(writer.getBuffer().toString())));
  +        
  +        } catch (SAXException e) {
  +            fail("Cannot create parse string: " + e.toString());
  +        
  +        } catch (IOException e) {
  +            fail("Cannot create parse string: " + e.toString());
  +        
  +        } 
  +        // just to keep the compiler happy
  +        return null;
       }
       
       protected Document parseString(String string) {
  
  
  

---------------------------------------------------------------------
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