Class RecursiveElementNameAndTextQualifier
- java.lang.Object
-
- org.custommonkey.xmlunit.examples.RecursiveElementNameAndTextQualifier
-
- All Implemented Interfaces:
ElementQualifier
public class RecursiveElementNameAndTextQualifier extends java.lang.Object implements ElementQualifier
Compares all Element and Text nodes in two pieces of XML. Allows elements of complex, deeply nested types that are returned in different orders but have the same content to be recognized as comparable.
-
-
Field Summary
Fields Modifier and Type Field Description private ElementSelector
es
-
Constructor Summary
Constructors Constructor Description RecursiveElementNameAndTextQualifier()
Uses element names and the text nested an arbitrary level of child elements deeper into the element to compare elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
qualifyForComparison(org.w3c.dom.Element currentControl, org.w3c.dom.Element currentTest)
Returns result of recursive comparison of all the nodes of a control and test element.
-
-
-
Field Detail
-
es
private final ElementSelector es
-
-
Constructor Detail
-
RecursiveElementNameAndTextQualifier
public RecursiveElementNameAndTextQualifier()
Uses element names and the text nested an arbitrary level of child elements deeper into the element to compare elements. Checks all nodes, not just first child element.Does not ignore empty text nodes.
-
-
Method Detail
-
qualifyForComparison
public boolean qualifyForComparison(org.w3c.dom.Element currentControl, org.w3c.dom.Element currentTest)
Returns result of recursive comparison of all the nodes of a control and test element.- Specified by:
qualifyForComparison
in interfaceElementQualifier
- Parameters:
currentControl
- an Element from the control XML NodeListcurrentTest
- an Element from the test XML NodeList- Returns:
- true if the elements are comparable, false otherwise
-
-