org.apache.axiom.testutils.stax
Class XMLStreamReaderComparator

java.lang.Object
  extended by junit.framework.Assert
      extended by org.apache.axiom.testutils.stax.XMLStreamReaderComparator

public class XMLStreamReaderComparator
extends junit.framework.Assert

Helper class that compares the events produced by two XMLStreamReader objects. Note that this class is not meant to be used to compare two XML documents (the error reporting would not be clear enough for that purpose), but to validate implementations of the XMLStreamReader interface. It uses a brute force approach: for each event, all methods (that don't modify the reader state) are called on both readers and the results (return values or exceptions thrown) of these invocations are compared to each other.


Constructor Summary
XMLStreamReaderComparator(javax.xml.stream.XMLStreamReader expected, javax.xml.stream.XMLStreamReader actual)
           
 
Method Summary
 void addPrefix(java.lang.String prefix)
          Add a prefix that should be used in testing the XMLStreamReader.getNamespaceURI(String) method.
 void compare()
           
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLStreamReaderComparator

public XMLStreamReaderComparator(javax.xml.stream.XMLStreamReader expected,
                                 javax.xml.stream.XMLStreamReader actual)
Method Detail

addPrefix

public void addPrefix(java.lang.String prefix)
Add a prefix that should be used in testing the XMLStreamReader.getNamespaceURI(String) method.

Parameters:
prefix - the prefix to add

compare

public void compare()
             throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.