Active Tests

This section introduces the XUnit and the WUnit frameworks and describes the tests suites that intend to cover the full functional spectrum of the engine.

Running the XUnit tests suites

The XUnit tests suites can be applied if you have downloaded RefleX's full distribution. Open a console and at the prompt, type the following command from the RefleX home directory (note that the (line cut) (line cut) icon means that you MUST NOT insert a line break) :

 $ java -cp reflex-0.4.0.jar:xunit-0.4.0.jar:libext/hsqldb.jar org.inria.ns.reflex.ReflexCLI (line cut)
     -driver org.hsqldb.jdbcDriver (line cut)
     run doc/tests/xunit/run-tests.xcl

This will run the 5 XUnit test suites below (unit tests for RefleX, XML-Oriented Programming, Tutorial tests, XPath tests, and XInclude test suite) and aggregate the reports.

Note that some warnings might appear in the standard output or error while running the tests suites.

XUnit cookbook

XUnit is to XML-oriented Programming as JUnit is to Java programs : XUnit uses Active Tags as a simple framework to write repeatable tests. With XUnit, you can well-try and improve your own Active Tags program as well as external XML processes such as XSLT. But you are also encouraged to use XUnit for testing Java programs that are producing XML documents.


WUnit : unit tests for Web applications

WUnit aims to design unit tests for Web applications thanks to :

  • a client emulator (a non-visual browser) with operations for filling HTML forms, clicking on links and buttons, managing cookies, sending URLs to a target server,
  • a server emulator, that can be used for Web applications made with servlets or with the Active Tags Web module available in RefleX (which is accessible with a servlet too).


Unit tests for RefleX

The following test suites consist on using active tags and other active materials of each module to proove that the basic features of the engine are working as expected. As they are basic tests, much more elaborate scenarii are available in the XOP section.


XML-oriented Programming

In order to demonstrate the viability of the Active Tags technology as a system for XML-oriented Programming, some use cases taken from W3C's XML Processing Model Requirements and Use Cases are implemented.


Tutorial tests

This section contains some additional tests that aims to check that new releases of RefleX won't break the examples runnable in the tutorial section.


XInclude test suite

RefleX embeds its own XInclude engine with support of XPointer (XPath) for DOM and even for SAX. The 174 tests applied here are taken from the W3C's XInclude test suite.


XPath test suite

This XPath test suite aims to validate the XPath implementation used in RefleX. RefleX is based on Jaxen + additional hacks that legitimate the presence of this test suite. The XPath test suite is those supplied by Jaxen, but each test is run inside an active sheet to check that the RefleX layer doesn't break the engine. For that matter, RefleX fixes some bugs that are present in Jaxen (see what fails in the JUnit test).


JUnit tests

Here are the JUnit tests achieved at the lowest level of the engine. They ensure that the basic features on which relies all the machinery are working correctly.