Package org.appng.testsupport.validation
Class TextValueDifferenceHandler
- java.lang.Object
-
- org.appng.testsupport.validation.DifferenceHandler
-
- org.appng.testsupport.validation.TextValueDifferenceHandler
-
- All Implemented Interfaces:
DifferenceListener
public class TextValueDifferenceHandler extends DifferenceHandler
ADifferenceListener
which ignores the (text/cdata) values of certain elements.
For example, if setting up aTextValueDifferenceHandler
like thisDifferenceHandler handler = new TextValueDifferenceHandler("value");
the following nodes would be considered as identical:<field name="foo" type="text"> <value>bar</value> </field>
and<field name="foo" type="text"> <value>foo</value> </field>
NoteTextValueDifferenceHandler
is getting applied to the whole document, ignoring everyDifference
in the text value of any element with the defined name. If a more precise distinction is required, useXPathDifferenceHandler
instead.- Author:
- Matthias Müller
-
-
Field Summary
-
Fields inherited from interface org.custommonkey.xmlunit.DifferenceListener
RETURN_ACCEPT_DIFFERENCE, RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL, RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR, RETURN_UPGRADE_DIFFERENCE_NODES_DIFFERENT
-
-
Constructor Summary
Constructors Constructor Description TextValueDifferenceHandler(String... ignored)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
differenceFound(Difference difference)
-
Methods inherited from class org.appng.testsupport.validation.DifferenceHandler
skippedComparison
-
-
-
-
Constructor Detail
-
TextValueDifferenceHandler
public TextValueDifferenceHandler(String... ignored)
- Parameters:
ignored
- name(s) of the attribute(s) to ignore the value for
-
-
Method Detail
-
differenceFound
public int differenceFound(Difference difference)
- Specified by:
differenceFound
in interfaceDifferenceListener
- Specified by:
differenceFound
in classDifferenceHandler
-
-