Class CountingNodeTester
java.lang.Object
org.custommonkey.xmlunit.examples.CountingNodeTester
- All Implemented Interfaces:
NodeTester
- Direct Known Subclasses:
CountingNodeTester
Counts the number of nodes in a document to allow assertions to be made
using a NodeTest.
Examples and more at xmlunit.sourceforge.net
Examples and more at xmlunit.sourceforge.net
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
noMoreNodes
(NodeTest forTest) Called by NodeTest when all nodes have been iterated over: time to see if all the nodes that were expected were found.void
Reset the counter so that an instance can be reused for anotherNodeTest
void
A single Node is always valid
-
Constructor Details
-
CountingNodeTester
public CountingNodeTester(int expectedNumNodes)
-
-
Method Details
-
testNode
A single Node is always valid- Specified by:
testNode
in interfaceNodeTester
- Parameters:
aNode
-forTest
-
-
noMoreNodes
Called by NodeTest when all nodes have been iterated over: time to see if all the nodes that were expected were found. Note that this method also invokesresetCounter
so that the instance can be reused.- Specified by:
noMoreNodes
in interfaceNodeTester
- Parameters:
forTest
-- Throws:
NodeTestException
- if this instance was expecting more nodes
-
resetCounter
public void resetCounter()Reset the counter so that an instance can be reused for anotherNodeTest
-