public class Config extends Object implements XMLDogConstants
configuration
Attach Config when instantiating XMLDog to provide your own configuration
Attributes for the Element Node to be excluded during comparison and Only the Attributes
to be used to compare the Element Nodes can be specified.
Elements to be ignored during the comparison can also be specified
Unique attributes for Element Nodes can be specified which will be used to identify matching
Element Nodes
APP_NAME, DEBUG, EVENT_NODE_IDENTICAL, EVENT_NODE_MISMATCH, EVENT_NODE_SIMILAR
Constructor and Description |
---|
Config()
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addExcludedAttribute(String elementName,
String attrName)
Adds Attribute to be excluded in the Element comparison.
|
void |
addExcludedAttributes(String elementName,
List attrNames)
Adds Attributes to be excluded in the Element comparison.
|
void |
addExcludedElement(String elementName)
Adds Element name to the excluded Elements Set.
|
void |
addIncludedAttribute(String elementName,
String attrName)
Adds Attribute to be included in the Element comparison.
|
void |
addIncludedAttributes(String elementName,
List attrNames)
Adds Attributes to be included in the Element comparison.
|
void |
addUniqueAttribute(String elementName,
String attrName)
Add Unique Attribute to the Element which will force Elements to be identical.
|
boolean |
applyEListToSiblings()
Checks if EList entries apply to the siblings or not.
|
Map |
getExcludedAttributesMap()
Gets excluded Attributes Map.
|
Set |
getExcludedElementsSet()
Gets excluded Elements Map.
|
Map |
getIncludedAttributesMap()
Gets included Attributes Map.
|
Map |
getUniqueAttributeMap()
Gets unique Attributes Map.
|
Map |
getXPathEList()
Gets Elist containing XPath.
|
boolean |
includesNodeValuesInXPath() |
boolean |
isCustomDifference()
Checks if Custom Difference is turned on.
|
boolean |
isDetailedMode()
Checks if XMLDog is working in the detailed mode.
|
boolean |
isExpandingEntityRefs()
Checks if XMLDog is expanding Entity References in the Documents.
|
boolean |
isIgnoringComments()
Checks if XMLDog is ignoring comments.
|
boolean |
isIgnoringOrder()
Gets IgnoringOrder flag.
|
boolean |
isIgnoringWhitespace()
Gets IgnoringWhitespace flag.
|
boolean |
isNamespaceAware()
Gets Namespace aware flag.
|
boolean |
isValidating()
Gets Validating flag.
|
boolean |
isXPathEListEnabled()
Checks if XPath elist is enabled.
|
Map |
loadXPathEList(String filename)
Loads XPath EList.
|
static void |
log(String msg)
Prints msg to System.out.
|
static void |
log(String msg,
Throwable t)
Prints msg and Exception to System.out.
|
static void |
main(String[] args) |
static String |
parseRegEx(String line)
Parses input string for the Regular Expression.
|
void |
setApplyEListToSiblings(boolean flag)
Sets the flag indicating whether EList entries should be applied to the siblings of the.
|
void |
setCustomDifference(boolean flag)
Sets Custom difference flag.
|
void |
setDetailedMode(boolean flag)
Sets if XMLDog is in the Detailed mode.
|
void |
setExpandingEntityRefs(boolean flag)
Sets if XMLDog is expanding Entity regferences in the Documents.
|
void |
setIgnoringComments(boolean flag)
Sets flag for ignoring XML Comments.
|
void |
setIgnoringOrder(boolean flag)
Sets IgnoringOrder flag.
|
void |
setIgnoringWhitespace(boolean flag)
Sets IgnoringWhitespace flag.
|
void |
setIncludeNodeValuesInXPath(boolean flag) |
void |
setNamespaceAware(boolean flag)
Sets Namespace aware flag.
|
void |
setValidating(boolean flag)
Sets Validating flag.
|
void |
setXPathEListEnabled(boolean flag)
Enables - disables XPath elist.
|
public void setValidating(boolean flag)
public boolean isValidating()
public void setIgnoringWhitespace(boolean flag)
public boolean isIgnoringWhitespace()
public void setIgnoringOrder(boolean flag)
Set this flag to true if the order in which the elements occur doesnt matter,
for stricter comparison set it to false
public boolean isIgnoringOrder()
This flag is used to determine if order in which elements occur in Golden
and current Document is ignored
public void setNamespaceAware(boolean flag)
public boolean isNamespaceAware()
public void setIgnoringComments(boolean flag)
public boolean isIgnoringComments()
public void setExpandingEntityRefs(boolean flag)
public boolean isExpandingEntityRefs()
public void setDetailedMode(boolean flag)
A Detailed mode forces XMLDog to continue finding the
differences in the entire Document versus a Non-Detailed mode
will stop processing the Document as soon as first difference is found.
Use this feature based on the for performance and Application requirements.
public boolean isDetailedMode()
public void setIncludeNodeValuesInXPath(boolean flag)
public boolean includesNodeValuesInXPath()
public void setCustomDifference(boolean flag)
If Custom difference is set to true, Differences will be logged identical to
XMLUnit
DifferenceConstants
public boolean isCustomDifference()
If Custom difference is turned on, each Node difference as defined in DifferenceConstants
will be logged
DifferenceConstants, NodeDetail
public void setApplyEListToSiblings(boolean flag)
same type or not
public boolean applyEListToSiblings()
public void addIncludedAttribute(String elementName, String attrName)
public void addIncludedAttributes(String elementName, List attrNames)
public void addExcludedAttribute(String elementName, String attrName)
public void addExcludedAttributes(String elementName, List attrNames)
public void addUniqueAttribute(String elementName, String attrName)
public void addExcludedElement(String elementName)
public Map getExcludedAttributesMap()
public Map getIncludedAttributesMap()
public Map getUniqueAttributeMap()
public Set getExcludedElementsSet()
public void setXPathEListEnabled(boolean flag)
flag
- the boolean flagpublic boolean isXPathEListEnabled()
public Map loadXPathEList(String filename)
Elist is a list of XPath expressions to exclude Nodes represented by the XPath expression
from the comparison
public static String parseRegEx(String line)
e.g. Line containing Regular Expression for Attribute value
/emp/[@name="value"]
public Map getXPathEList()
public static void log(String msg)
public static void main(String[] args)
Copyright © 2021. All rights reserved.