The basic structure to an rvtest XML fixture is:
<?xml version="1.0"?> <fixture> <name>SampleFixture</name> <stimuli> <stimulus name="Stimulus" delay="1000"> ... </stimulus> <stimulus name="XMLFormatStimulus" delay="1000"> ... </stimulus> </stimuli> <responses> <response name="TestResponseForURI" minexpected="1" maxexpected="2" comparisonMethod="EQUALS"> ... </response> </responses> <additionalData> <data key="key" value="value"/> </additionalData> </fixture>
Stimuli contain any number of Stimulus nodes and are used to drive an RV test fixture. A Stimulus represents one or more TibRv messages that should be sent as part of a test fixture. Each Stimulus element has the following required attributes.
Attribute | Description |
---|---|
name | The name of the stimulus. This is used for tracking and does not impact the test execution. |
delay | The interval to delay after sending a message. Specified in milliseconds. |
In the XML Format the Stimulus can defined using the following ways.
<stimulus name="TestStimulus" delay="1000"> <message> <subject>MSGTEST.INPUT</subject> <rvfield name="PinNumber" value="1234" type="string"/> <rvfield name="UserId" value="Albert Einstein" type="string"/> </message> </stimulus>
<stimulus name="URIStimulus" delay="1000"> <uri>xmlformatfile://mymessage.xml</uri> <subject>my.subject</subject> </stimulus>
Each fixture defines a series of Responses. The test fixture uses these as reference messages and performs a comparison between the actual and expected messages. This comparison is configurable. Each Response element has the following required attributes
Attribute | Description |
---|---|
name | The name of the response This is used for tracking and does not impact the test execution. |
minexpected | The minimum number of times this message must be received in the testing window. |
maxexpected | The maximum number of times the message must be received in the testing window. |
comparisonMethod | The comparison to be performed on the message. Allowed values are EQUALS, EQUALSIGNORE, and NONE |
Responses can be defined using the following ways:
<response name="TestResponse" minexpected="1" maxexpected="2" comparisonMethod="EQUALSIGNORE"> <ignoredFields> <ignoredField>ignore</ignoredField> </ignoredFields> <message> <subject>MSGTEST.OUTPUT</subject> <rvfield name="PinNumber" value="1234" type="string"/> <rvfield name="UserId" value="Albert Einstein" type="string"/> <rvfield name="OrderId" value="3.14" type="float"/> <rvfield name="TradingGroup" value="FX" type="string"/> </message> </response>
<response name="TestResponseForURI" minexpected="1" maxexpected="2" comparisonMethod="EQUALS"> <ignoredFields></ignoredFields> <uri>xmlformatfile://src/test/com/reuters/msgtest/message/rvmsg.xml</uri> <subject>my.response.msg.subject</subject> </response>