public final class FieldDiffHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FACET_ELEMENT |
static String |
NAME_ATTRIBUTE |
static String |
SCHEMA_ELEMENT |
static String |
TYPE_ATTRIBUTE |
Constructor and Description |
---|
FieldDiffHelper() |
Modifier and Type | Method and Description |
---|---|
static PropertyDiff |
applyPropertyHierarchyToDiff(PropertyDiff firstPropertyDiff,
List<PropertyHierarchyNode> propertyHierarchy)
Sets the property diff hierarchy.
|
static boolean |
computeFieldDiff(DocumentDiff docDiff,
org.custommonkey.xmlunit.NodeDetail controlNodeDetail,
org.custommonkey.xmlunit.NodeDetail testNodeDetail,
int fieldDifferenceCount,
org.custommonkey.xmlunit.Difference difference)
Computes a field diff.
|
static String |
getPropertyType(Node node)
Gets the node property type.
|
public static final String FACET_ELEMENT
public static final String SCHEMA_ELEMENT
public static final String NAME_ATTRIBUTE
public static final String TYPE_ATTRIBUTE
public static boolean computeFieldDiff(DocumentDiff docDiff, org.custommonkey.xmlunit.NodeDetail controlNodeDetail, org.custommonkey.xmlunit.NodeDetail testNodeDetail, int fieldDifferenceCount, org.custommonkey.xmlunit.Difference difference) throws ClientException
First gets all needed elements to compute the field diff:
Every time we encounter a list, a complex or a content node going up in the DOM tree from the property node to the prefixed field node, we add it to the property hierarchy. If it is a list item node, we set its index in the hierarchy. If it is a complex item node, we set its name in the hierarchy. If it is a content item node (ie. "encoding", "mime-type", "filename" or "digest"), we set its name in the hierarchy. Example: complex list The "true" property's hierarchy is: [{list,"0"},{complex, "complexBoolean"}] The "jack" property's hierarchy is: [{list,"1"},{complex, "complexString"}] The "UTF-8" property's hierarchy is: [{list,"0"},{complex, "complexString"},{content, "encoding"}]
joe true UTF-8 text/plain My_file.txt 5dafdabf966043c8c8cef20011e939a2 jack false
docDiff
- the doc diffcontrolNodeDetail
- the control node detailtestNodeDetail
- the test node detailfieldDifferenceCount
- the field difference countadddifference
- the differenceClientException
- the client exceptionpublic static String getPropertyType(Node node)
node
- the nodepublic static PropertyDiff applyPropertyHierarchyToDiff(PropertyDiff firstPropertyDiff, List<PropertyHierarchyNode> propertyHierarchy) throws ClientException
firstPropertyDiff
- the first property diffpropertyHierarchy
- the property hierarchyClientException
- the client exceptionCopyright © 2015 Nuxeo SA. All rights reserved.