Concordion >

Example

Here's a very simple example that demonstrates the basic behaviour of Concordion. Note that the HTML specifications, below, have a Concordion namespace declaration at the top and we use the <span> tag around the variable that we're interested in checking.

Assuming we have Java fixture code containing a method:

public String getGreeting() {
    return "Hello World!";
}

When we run the following active specification it should report a success, since the expectation in the specification (Hello World!) matches the actual result of the method.

<html xmlns:concordion="http://www.concordion.org/2007/concordion">
<body>
    <p>
        The greeting should be:
        <span concordion:assertEquals="greeting">Hello World!</span>
    </p>
</body>
</html>

On the other hand, this specfication should report a failure, since the expectation in the specification (Hello Bob!) does not match the result of the method (Hello World!).

<html xmlns:concordion="http://www.concordion.org/2007/concordion">
<body>
    <p>
        The greeting should be:
        <span concordion:assertEquals="greeting">Hello Bob!</span>
    </p>
</body>
</html>