Databases Reference
In-Depth Information
We can then add assertions to this wire by clicking on the green plus sign. This
will bring up the
Create Assert
dialog box. Across the top, we can choose the type
of assertion:
•
Assert Input
allows us to test the value of the input to the component or
reference
Assert Output
lets us verify the response from a component or reference
Assert Callback
is used to check the value of an asynchronous callback
Assert Fault
tests the values of a fault thrown by a component or reference
•
•
•
When asserting faults, we can select the fault from a list of faults declared in the
reference that the wire is connected to.
The
Assert Target
can be any XPath expression created by using the
Browse
button.
Note that you cannot enter free form XPath expressions. This allows you to select
either the entire message or a subset. Note that the XPath browser does not support
repeating elements due to a
maxOccurs
property greater than 1, so you cannot select
individual elements in an array. If the subset is a single element, then the comparison
is done on a single value. If the
Assert Target
is the whole message, then a sample
response can be generated using the
Generate Sample
button. If the
Assert Target
is
a document fragment, then the
Generate Sample
button will be grayed out. Similar
to the initialization message, it is possible to save the
Assert Value
to a file for
reuse in other tests. When comparing documents and document fragments, it will
generally be better to use the
Compare By
value of
xml-similar
, as this allows for
different namespace prefixes to the same namespace and also allows attributes to be
in different orders.