ModelJUnit Eclipse E4 Plugin (modeljunit-e4)¶
The Eclipse E4 plugin provides the same FSM graph, coverage chart, animator, and results panels as the standalone JavaFX application — but embedded directly inside the Eclipse IDE as workbench views.
Note: The E4 plugin lives in a separate repository at
modeljunit-e4. This guide covers installation and usage; for source and build instructions, refer to that repository's README.
Prerequisites¶
| Requirement | Version |
|---|---|
| Eclipse IDE | 2024-06 (4.32) or later |
| Java runtime | 21 or later |
| Eclipse plugin | e(fx)clipse 3.10+ (usually pre-installed in Eclipse IDE for Java) |
Installation¶
From the update site ZIP¶
- In Eclipse: Help → Install New Software…
- Click Add… then Archive… and browse to the update site
.zipproduced by runningmvn packagein themodeljunit-e4repository. - Expand the category ModelJUnit and tick all features.
- Click Next → Next → Accept licence → Finish.
- Restart Eclipse when prompted.
Building the update site ZIP yourself¶
git clone <modeljunit-e4-repo-url>
cd modeljunit-e4
mvn clean package
# The zip is produced at: releng/modeljunit-e4-updatesite/target/modeljunit-e4-updatesite-*.zip
The Four Views¶
Open the views via Window → Show View → Other… → ModelJUnit:
| View | Description |
|---|---|
| FSM Graph | SmartGraph visualisation of the model's state machine |
| Coverage Chart | Real-time line chart of state/transition/pair coverage |
| Animator | Manual step-by-step FSM navigation |
| Results | Action log for the current test run |
The views behave identically to their counterparts in the standalone modeljunit-fx application — see the JavaFX GUI guide for details on each panel.
Connecting to a Model Class¶
- Open the FSM Graph view.
- Click the Load Model… toolbar button (folder icon).
- In the dialog, select the project and then the class implementing
FsmModel. Classes are discovered from the active workspace project's build path. - Click Load — the graph renders immediately and the other views activate.
Tip: The plugin observes workspace build events. If you edit and save your model class, click Reload (circular arrow) to refresh without reopening the dialog.
Running Tests from Eclipse¶
With a model loaded:
- Switch to the Results view.
- Click Run in the toolbar; choose the algorithm (Random, Greedy, etc.) and step count in the pop-up.
- Progress updates live in the Coverage Chart.
- After the run, the Results view shows the full action log and a coverage summary.
Errors in your model (assertion failures, exceptions) are highlighted in red and linked to the relevant source line via the Eclipse error marker mechanism.
Troubleshooting¶
| Problem | Fix |
|---|---|
| Views not visible after install | Window → Reset Perspective |
| Graph renders blank | Ensure JavaFX is on the module path; check the Eclipse -vm argument points to JDK 21 |
ClassNotFoundException on model load |
Verify the model class is compiled and on the project's build path |
| Plugin not found in Install dialog | Confirm the ZIP was built with mvn package (not just mvn compile) |