Validating Multiple Expects
With Sequencing Validation
When running a test, several messages can be output from different modules and come to different validators. In this case we do not want to impose that SO 1 will come before SO 2 to a validator because it is just hazardous.
<test name="test_multiple_expects_3"> <flow>flow1</flow> <description>Test multiple expects into different modules in a different order</description> <inject mod="getSo"> <so orderId="1"> <sod> <attr name="verb" value="toPort1"/> </sod> </so> </inject> <inject mod="getSo"> <so orderId="2"> <sod> <attr name="verb" value="toPort2"/> </sod> </so> </inject> <expect mod="port2"> <so orderId="2"/> </expect> <expect mod="port1"> <so orderId="1"/> </expect> </test>
Without Sequencing Validation
If you inject SO 1, SO 2, and then so 3, the sequence of SOs coming to the validator is as follows:
To do that, use the test::validateExpectSequencing attribute.<test name="test_multiple_expects_4" validateExpectSequencing="true">> <flow>flow1</flow>> <description>Test multiple expects into one module validating sequencing</description> <inject mod="getSo"> <so orderId="1"/> </inject>> <inject mod="getSo"> <so orderId="2"/> </inject>> <inject mod="getSo"> <so orderId="3"/> </inject> <expect mod="port1"> <so orderId="1"/> </expect> <expect mod="port1"> <so orderId="2"/> </expect> <expect mod="port1"> <so orderId="3"/> </expect> </test>
Copyright © Cloud Software Group, Inc. All rights reserved.