Package org.apache.axiom.testutils.stax
Class XMLStreamReaderComparator
- java.lang.Object
-
- org.apache.axiom.testutils.stax.XMLStreamReaderComparator
-
public class XMLStreamReaderComparator extends Object
Helper class that compares the events produced by twoXMLStreamReaderobjects. 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 theXMLStreamReaderinterface. 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
Constructors Constructor Description XMLStreamReaderComparator(XMLStreamReader expected, XMLStreamReader actual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPrefix(String prefix)Add a prefix that should be used in testing theXMLStreamReader.getNamespaceURI(String)method.voidcompare()voidsetCompareCharacterEncodingScheme(boolean value)voidsetCompareEncoding(boolean value)voidsetCompareEntityReplacementValue(boolean value)Specify whether the replacement value for entity references (as reported byXMLStreamReader.getText()) should be compared.voidsetCompareInternalSubset(boolean compareInternalSubset)voidsetSortAttributes(boolean sortAttributes)voidsetTreatSpaceAsCharacters(boolean treatSpaceAsCharacters)
-
-
-
Constructor Detail
-
XMLStreamReaderComparator
public XMLStreamReaderComparator(XMLStreamReader expected, XMLStreamReader actual)
-
-
Method Detail
-
addPrefix
public void addPrefix(String prefix)
Add a prefix that should be used in testing theXMLStreamReader.getNamespaceURI(String)method.- Parameters:
prefix- the prefix to add
-
setCompareInternalSubset
public void setCompareInternalSubset(boolean compareInternalSubset)
-
setCompareEntityReplacementValue
public void setCompareEntityReplacementValue(boolean value)
Specify whether the replacement value for entity references (as reported byXMLStreamReader.getText()) should be compared. The default value for this option istrue.- Parameters:
value-trueif the replacement value should be compared;falseif replacement values for entity references are ignored
-
setCompareCharacterEncodingScheme
public void setCompareCharacterEncodingScheme(boolean value)
-
setCompareEncoding
public void setCompareEncoding(boolean value)
-
setSortAttributes
public void setSortAttributes(boolean sortAttributes)
-
setTreatSpaceAsCharacters
public void setTreatSpaceAsCharacters(boolean treatSpaceAsCharacters)
-
-