Concordion > Extension > Listeners >

Processing Listeners

Concordion processing steps can be observed using the following listeners:

Example

An extension is installed that listens to assertEquals, assertTrue, assertFalse and execute commands. When the following instrumentation:

<p>The square root of <span concordion:set="#num">16.0</span> is <span concordion:assertEquals="sqrt(#num)">4.0</span></p>

is run with a fixture that performs the arithmetical operations, the logged events are:

Event
Concordion Built
Before Parsing Document
Before Processing [Resource: /testrig]
Success '4.0'
After Processing [Resource: /testrig]

Example with concordion:example

An extension is installed with a ConcordionBuildListener, DocumentParsingListener, SpecificationProcesssingListener, ExampleListener and AssertEqualsListener. When the following instrumentation:

<div concordion:example="before">
</div>

<div concordion:example="example1">
<p>The square root of <span concordion:set="#num">16.0</span> is <span concordion:assertEquals="sqrt(#num)">4.0</span></p>
</div>

<div concordion:example="example2">
<p>The square root of <span concordion:set="#num">9.0</span> is <span concordion:assertEquals="sqrt(#num)">3.0</span></p>
</div>

is run with a fixture that performs the arithmetical operations, the logged events are:

Event
Concordion Built
Before Parsing Document
Before Processing [Resource: /testrig]
Before example 'example1'
Success '4.0'
After example 'example1'
Before example 'example2'
Success '3.0'
After example 'example2'
After Processing [Resource: /testrig]

Example with mixture of concordion:example and anonymous example

An extension is installed with a ConcordionBuildListener, DocumentParsingListener, SpecificationProcesssingListener, ExampleListener and AssertEqualsListener. When the following instrumentation:

<div concordion:example="before">
</div>

<div concordion:example="example1">
<p>The square root of <span concordion:set="#num">16.0</span> is <span concordion:assertEquals="sqrt(#num)">4.0</span></p>
</div>

<p>The square root of <span concordion:set="#num">9.0</span> is <span concordion:assertEquals="sqrt(#num)">3.0</span></p>

is run with a fixture that performs the arithmetical operations, the logged events are:

Event
Concordion Built
Before Parsing Document
Before Processing [Resource: /testrig]
Success '3.0'
Before example 'example1'
Success '4.0'
After example 'example1'
After Processing [Resource: /testrig]