org.custommonkey.xmlunit
public class DifferenceEngine extends Object implements DifferenceConstants
See Also: differenceFound
Nested Class Summary | |
---|---|
protected static class | DifferenceEngine.DifferenceFoundException
Marker exception thrown by the protected compare() method and passed
upwards through the call stack to the public compare() method. |
Constructor Summary | |
---|---|
DifferenceEngine(ComparisonController controller)
Simple constructor |
Method Summary | |
---|---|
void | compare(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier)
Entry point for Node comparison testing. |
protected void | compare(Object expected, Object actual, Node control, Node test, DifferenceListener listener, Difference difference)
If the expected and actual values are unequal then inform the listener of
a difference and throw a DifferenceFoundException. |
protected void | compareAttribute(Attr control, Attr test, DifferenceListener listener)
Compare two attributes |
protected void | compareCDataSection(CDATASection control, CDATASection test, DifferenceListener listener)
Compare two CDATA sections |
protected void | compareComment(Comment control, Comment test, DifferenceListener listener)
Compare two comments |
protected void | compareDocument(Document control, Document test, DifferenceListener listener, ElementQualifier elementQualifier)
Compare two Documents for doctype and then element differences |
protected void | compareDocumentType(DocumentType control, DocumentType test, DifferenceListener listener)
Compare two DocumentType nodes |
protected void | compareElement(Element control, Element test, DifferenceListener listener)
Compare 2 elements and their attributes |
protected void | compareHasChildNodes(Node control, Node test, DifferenceListener listener)
Compare the number of children, and if the same, compare the actual
children via their NodeLists. |
protected void | compareNode(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier)
First point of call: if nodes are comparable it compares node values then
recurses to compare node children. |
protected boolean | compareNodeBasics(Node control, Node test, DifferenceListener listener)
Compares node type and node namespace characteristics: basically
determines if nodes are comparable further |
protected void | compareNodeChildren(Node control, Node test, DifferenceListener listener, ElementQualifier elementQualifier)
Compare the number of children, and if the same, compare the actual
children via their NodeLists. |
protected void | compareNodeList(NodeList control, NodeList test, int numNodes, DifferenceListener listener, ElementQualifier elementQualifier)
Compare the contents of two node list one by one, assuming that order
of children is NOT important: matching begins at same position in test
list as control list. |
protected void | compareProcessingInstruction(ProcessingInstruction control, ProcessingInstruction test, DifferenceListener listener)
Compare two processing instructions |
protected void | compareText(Text control, Text test, DifferenceListener listener)
Compare text |
Parameters: controller the instance used to determine whether a Difference detected by this class should halt further comparison or not
See Also: haltComparison
Parameters: control Control XML to compare test Test XML to compare listener Notified of any {@link Difference differences} detected during node comparison testing elementQualifier Used to determine which elements qualify for comparison e.g. when a node has repeated child elements that may occur in any sequence and that sequence is not considered important.
Parameters: expected actual control test listener differenceType
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException
Parameters: control test listener elementQualifier
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException
Parameters: control test listener elementQualifier
Throws: DifferenceFoundException
Parameters: control test listener
Returns: true if the nodes are comparable further, false otherwise
Throws: DifferenceFoundException
Parameters: control test listener elementQualifier
Throws: DifferenceFoundException
Parameters: control test numNodes convenience parameter because the calling method should know the value already listener elementQualifier used to determine which of the child elements in the test NodeList should be compared to the current child element in the control NodeList.
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException
Parameters: control test listener
Throws: DifferenceFoundException