Testing Framework

General information

There are different kind of tests:

How to run the tests

After downloading the Yanel source (either via Git or as snapshot) one can run the tests all at once (as we do it for example with Jenkins) or run the various tests individually.

If you want to run all at once (including build and start of Yanel), then execute the shell script

./src/build/targets/continuous-integration/reCI 8080 8443 8005 8009 /home/michi/local/canoo-webtest-3.0-R_1758
whereas please make sure to have Canoo webtests installed.


If you want to run the tests individually, then it's necessary to build and start yanel before running the tests.

IMPORTANT: If you want to run the htmlunit tests, you have to start tomcat and configure the host and url inside


One can also set realm specific variables, like for example the realm prefix:


which then can be retrieved via the Java Test class:

    protected void setUp() throws Exception {
        this.testName = "My Test";
        // INFO: Overwrite htmlunit configuration (src/test/htmlunit/local.htmlunit-properties.xml) and add element <my-realm-prefix>
        REALM_PREFIX = config.getString("htmlunit.my-realm-prefix");


Then execute in $YANEL_HOME:

./build.sh test


To run single tests standalone:


./build.sh -f src/test/build.xml junit -Dtest.class.name=org.wyona.yanel.impl.map.MapImplTest

./build.sh -f src/test/build.xml htmlunit -Dtest.class.name=org.wyona.yanel.htmlunit.yanelwebsite.SimpleWebTest


To run Yanel specific Canoo webtests (including junit and htmlunit):

./build.sh test -Dwebtest.home.dir=/usr/local/canoo-webtest-3.0-R_1758 -Dwebtest.config.host=localhost -Dwebtest.config.protocol=http -Dwebtest.config.port=8080 -Dheadless=


whereas if the global property 'headless' is set, then also the Canoo property 'wt.headless' is set within src/build/targets/test.xml, which means no monitor is displayed and no browser is opened to display the Canoo results.

Some Canoo web-tests are located at

whereas also see the README.txt files within these directories.


To run realm specific Canoo webtests

./build.sh -f src/realms/yanel-website/src/test/canoo/build.xml
or to run a specific target
./build.sh -f src/realms/yanel-website/src/test/canoo/build.xml MY_TARGET_NAME


whereas make sure to configure the properties within the realm first, e.g.


To run JMeter tests, use the "jmeter" target:

./build.sh [-f path/to/build.xml] jmeter


Debugging and Logging

The log level can be set inside src/test/htmlunit/local.htmlunit-properties.xml (debugLevel), whereas the log messages are written to standard output. The log is setup inside src/test/htmlunit/org/wyona/yanel/htmlunit/AbstractHtmlUnitTest.java.


How to write tests

Where to place core tests:

Where to place resource tests:

Choose the name of the class according to the following convention:

*Test.java e.g. MyResourceTest.java for junit tests

*WebTest.java e.g. MyResourceWebTest.java for htmlunit tests

The tests which adhere to these conventions will be executed automatically by the testing framework.

Have a look at the existing tests to see how it works, e.g. in the xml resource.

You can find more example htmlunit tests at: https://github.com/wyona/lenya/tree/master/htmlunit (Username:anonymous Password: anonymous).

For writing JMeter tests, see the JMeter page.


In the case of Mac OS X (at least Snow Leopard) and Java 1.6 one needs to add xalan-2.7.0.jar to the directory /Library/Java/Extensions (also see http://blog.jonasbandi.net/2009/06/running-canoo-webtest-30-on-os-x.html).


Continuous Integration / Delivery /Deployment

Please see http://continuous.wyona.com/en/projects/yanel/index.html regarding code modifications and associated tests.

Your comments are much appreciated

Is the content of this page unclear or you think it could be improved? Please add a comment and we will try to improve it accordingly.