Concordion > Extension > Listeners >

Listeners for Executing Tables

When executing tables, Concordion notifies listeners of execute events for each row of the table. Execute listeners are notified that execution is complete prior to the assertions being evaluated.

Example

An extension is installed that logs assertEquals and execute commands. When the following instrumentation:

<table concordion:execute="#username = generateUsername(#fullName)">
    <tr>
        <th concordion:set="#fullName">Full Name</th>
        <th concordion:assertEquals="#username">Username</th>
    </tr>
    <tr>
        <td>Fred Bloggs</td>
        <td>fredbloggs</td>
    </tr>
    <tr>
        <td>John Doe</td>
        <td>johndoe</td>
    </tr>
    <tr>
        <td>Winston Churchill</td>
        <td>winston</td>
    </tr>
</table>

is run with a method generateUsername() that returns the full name in lowercase with spaces removed, the logged events are:

Event
Set #fullName = 'Fred Bloggs'
Execute 'Fred Bloggs, fredbloggs'
Success 'fredbloggs'
Set #fullName = 'John Doe'
Execute 'John Doe, johndoe'
Success 'johndoe'
Set #fullName = 'Winston Churchill'
Execute 'Winston Churchill, winston'
Failure expected:'winston' actual:'winstonchurchill'