Automated Tests

SignServer uses JUnit for automated testing and test cases exist in multiple projects:

Unit Tests

Unit tests are run when building with Maven, unless -DskipTests is specified.

System Tests

System tests are placed in JAR files and can later be run with Ant by executing:

bin/ant systemtest:jars

Generally, tests are organized according to the following:

  • Each new module can include its own Unit tests.

  • Some components (i.e. Web Services) use their own test projects (SignServer-Test-*WS) in order to not include client-side code in their projects.

  • Legacy tests and system tests are placed in SignServer-Test-System.

Web Tests

SignServer also includes a WebTest module for automated testing of the web interface. For more information, see WebTest Module.

Test Coverage with Clover

To run Clover, copy the Clover installation folder (or make a symlink to it) and store it as lib/ext/clover-dir.

Note that if the project has been built previously, a dummy Clover folder will already exist with the name lib/ext/clover-dir and the following must be run to remove it:

bin/ant clean clover.clean build deploy
bin/ant ant test:run

Stop the application server and then run the following to gather the report:

ant clover.xml clover.html

To disable Clover, even if it is installed, run Ant with -Dno.clover=true.