The experimental POOSL Unit Testing Plug-in brings facilities to test the functionality of Data Classes.
This page describes facilities to test POOSL Data Classes. To do so, it uses some of the mechanisms from the Xpect testing framework; integrated in a JUnit environment, the tests are picked up from class and method annotations.
At the moment, the plugin requires the Plug-in Development Environment (PDE) Plug-in installed in Eclipse, for the JUnit integration with other plugins. Additionally, you need a properly set-up project, with the right plugin dependencies.
The plug-in can be installed by pointing Eclipse to one of the following update sites:
- Latest (stable, not released) at
- Continuous Integration (cutting edge updates) at
A Release update site will be available as soon as the POOSL Unit Testing Plug-in has been tested on other platforms than Windows 7.
A standalone version that can be run outside Eclipse is under development. The plug-in should work with the Maven Surefire execution, but this is still experimental and not yet thoroughly tested.
How to use
Download and extract the example project. Import the project into Eclipse through the
Import... -> Existing projects into workspace wizard.
Right click the project root or the
src/test/MyTests.java file. Select
Run as -> JUnit Test, and the POOSL Unit Tests will start and report the output to Eclipse. If you clicked the project root, all the JUnit tests will be executed. If you clicked the specific JUnit Test file, only that file will be started.
You can now start writing POOSL files that use
import unittest.poosl, and any Data Class that (directly!) extends
UnitTestCase will be registered as a testing unit. Take a look at the example Unit Tests in
/models/example.poosl in the example project. For the Unit Testing API, you can take a look at the methods in the
Some of its features include:
- Isolated test-cases, including
Teardownannotations on methods to provide testing fixtures.
- Test for expected errors.
- Automatically generating test models and running them with Rotalumis to check the execution.
- JUnit integration for test-cases and test-suites.
- JUnit Eclipse UI Integration for easy access to definitions of failed test.
You can also use your own version of Rotalumis, by specifying the location through an environment variable ROTALUMIS_BIN to the file location of the Rotalumis engine that you want to use.
- The double click handler is currently unable to properly locate the file where the test resides, when the project name (in .project) does not match the
Bug reports and feature requests
The POOSL Unit Testing Plug-in is not under active development, but bug reports and feature requests can be targeted to Joost van Pinxten.