Testing a sequence of message flow nodes in a single test case
You can test a sequence of message flow nodes by using the evaluate()
method or the propagate()
method.
Before you begin
About this task
You can test a sequence of message flow nodes, by using either the
evaluate()
method or the propagate()
method, as described in the following topics:
.When you use the
propagate()
or evaluate()
method to test a
section of a message flow, you can configure an additional NodeSpy or NodeStub on the message flow,
to perform the following actions:- Observe and validate the message content at any node in the message flow
- Prevent message propagation past a specific message flow node terminal, by using the
setStopAtTerminal()
method - Substitute the operation of a message flow node
When you are testing a part of a message flow, you can stop the message flow before it completes,
by using the setStopAtInputTerminal()
and
setStopAtOutputTerminal()
methods on a node spy. For information about how to do
this, see Stopping a flow before it completes.
For information about verifying exceptions that were caught while propagating, see Verifying exceptions.
You can also test an individual message flow node (without propagating the message to any
subsequent message flow nodes), by using the
evaluate()
method on a node spy and
setting the singleNodeTest parameter to
true
: /**
* Calls the specified input terminal of the message flow node with the supplied message assembly.
*
* @param testAssembly The message assembly to call the node that contains
* the test time message trees
* @param singleNodeTest when true, prevents message propagation from any of the
* output terminals on the message flow node
* @param inputTerminalName The name of the input terminal to call
* @throws TestException Why the invocation failed
*/
public void evaluate(final TestMessageAssembly testAssembly, boolean singleNodeTest, String inputTerminalName) throws TestException