|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ca.intelliware.amakihi.fixture.BaseReturnValueValidator | +--ca.intelliware.amakihi.fixture.SampleReturnValueValidator
Implement a validation strategy that compares a sample of the returned data. Consider the following example:
Imagine that the following output is returned by the communication handler:
<Service> <returnValue> <foo> <a1>simpleText a1</a1> <a2>simpleText a2</a2> <a3>simpleText a3</a3> </foo> </returnValue> </Service>
Now, imagine that a script has been written with the following
output
block:
<output> <returnValue format="sample"> <foo> <a1>simpleText a1</a1> <a3>simpleText a3</a3> </foo> </returnValue> </output>
This script is a valid sample of the returned data. For each of the expected elements we can say that:
<a1>
is located immediately after
<foo>
).
Note that the third condition implies that the expected output block must
start at the highest-level node (in this case, <foo>
.
Inner classes inherited from class ca.intelliware.amakihi.fixture.BaseReturnValueValidator |
BaseReturnValueValidator.MatchResult, BaseReturnValueValidator.NonMatchResult, BaseReturnValueValidator.PerfectMatchResult |
Constructor Summary | |
SampleReturnValueValidator()
|
Method Summary | |
protected BaseReturnValueValidator.MatchResult |
findMatchingActualNode(org.w3c.dom.Element actualNode,
org.w3c.dom.Element expectedNode)
|
protected BaseReturnValueValidator.MatchResult |
findMatchingActualNode(org.w3c.dom.Node actualNode,
org.w3c.dom.Node expectedNode)
Determines whether or not the expected value is a sample of the actualNode, or one of its following siblings and returns the matching node. |
protected BaseReturnValueValidator.MatchResult |
findMatchingActualTextNode(org.w3c.dom.Text actualNode,
org.w3c.dom.Text expectedNode)
Find a text node match. |
protected BaseReturnValueValidator.MatchResult |
findMatchingChildNodes(org.w3c.dom.Element actualNode,
org.w3c.dom.Element expectedNode)
|
protected BaseReturnValueValidator.MatchResult |
nodesAreEqual(org.w3c.dom.Element expected,
org.w3c.dom.Element actual)
Check to see if two nodes are equal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SampleReturnValueValidator()
Method Detail |
protected BaseReturnValueValidator.MatchResult nodesAreEqual(org.w3c.dom.Element expected, org.w3c.dom.Element actual)
nodesAreEqual
in class BaseReturnValueValidator
protected BaseReturnValueValidator.MatchResult findMatchingActualNode(org.w3c.dom.Node actualNode, org.w3c.dom.Node expectedNode)
Determines whether or not the expected value is a sample of the actualNode, or one of its following siblings and returns the matching node.
protected BaseReturnValueValidator.MatchResult findMatchingActualNode(org.w3c.dom.Element actualNode, org.w3c.dom.Element expectedNode)
protected BaseReturnValueValidator.MatchResult findMatchingChildNodes(org.w3c.dom.Element actualNode, org.w3c.dom.Element expectedNode)
protected BaseReturnValueValidator.MatchResult findMatchingActualTextNode(org.w3c.dom.Text actualNode, org.w3c.dom.Text expectedNode)
Find a text node match. Text nodes have no child nodes so we say that two text nodes match if their text data matches.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |