Package org.appng.testsupport.validation
Class AttributeValueDifferenceHandler
- java.lang.Object
-
- org.appng.testsupport.validation.DifferenceHandler
-
- org.appng.testsupport.validation.AttributeValueDifferenceHandler
-
- All Implemented Interfaces:
DifferenceListener
public class AttributeValueDifferenceHandler extends DifferenceHandler
ADifferenceListener
which ignores the values of certain attributes.
For example, if setting up aAttributeValueDifferenceHandler
like thisDifferenceHandler handler = new AttributeValueDifferenceHandler("required");
the following nodes would be considered as identical:<field name="foo" type="text" required="true"> <value>bar</value> </field>
and<field name="foo" type="text" required="false"> <value>bar</value> </field>
NoteAttributeValueDifferenceHandler
is getting applied to the whole document, ignoring everyDifference
in the value of any attribute 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 AttributeValueDifferenceHandler(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
-
AttributeValueDifferenceHandler
public AttributeValueDifferenceHandler(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
-
-