Missing rows are marked with CSS class="missing"
on the <tr>
element.
In the example, below, we will also demonstrate how the verifyRows
command can be used to check multiple properties of objects in a collection.
Given a method getPeople()
that returns a Collection containing the following Person
objects:
First Name | Last Name | Birth Year |
---|---|---|
John | Travolta | 1954 |
Cliff | Richard | 1940 |
Britney | Spears | 1981 |
And the following instrumentation:
<table concordion:verifyRows="#person : getPeople()" xmlns:concordion="http://www.concordion.org/2007/concordion"> <tr> <th concordion:assertEquals="#person.firstName">First Name</th> <th concordion:assertEquals="#person.lastName">Last Name</th> <th concordion:assertEquals="#person.birthYear">Birth Year</th> </tr> <tr> <td>John</td> <td>Travolta</td> <td>1066</td> </tr> <tr> <td>Michael</td> <td>Jackson</td> <td>1958</td> </tr> <tr> <td>Britney</td> <td>Spears</td> <td>1981</td> </tr> <tr> <td>Mick</td> <td>Jagger</td> <td>1943</td> </tr> </table>
Results in this output:
<table concordion:verifyRows="#person : getPeople()" xmlns:concordion="http://www.concordion.org/2007/concordion"> <tr> <th concordion:assertEquals="#person.firstName">First Name</th> <th concordion:assertEquals="#person.lastName">Last Name</th> <th concordion:assertEquals="#person.birthYear">Birth Year</th> </tr> <tr> <td class="success">John</td> <td class="success">Travolta</td> <td class="failure"> <del class="expected">1066</del> <ins class="actual">1954</ins> </td> </tr> <tr> <td class="failure"> <del class="expected">Michael</del> <ins class="actual">Cliff</ins> </td> <td class="failure"> <del class="expected">Jackson</del> <ins class="actual">Richard</ins> </td> <td class="failure"> <del class="expected">1958</del> <ins class="actual">1940</ins> </td> </tr> <tr> <td class="success">Britney</td> <td class="success">Spears</td> <td class="success">1981</td> </tr> <tr class="missing"> <td>Mick</td> <td>Jagger</td> <td>1943</td> </tr> </table>
Notice that the Mick Jagger item was expected to be in the collection,
but was not, so the row is marked with class="missing"
.