In this section, a simplified example of real module development will be presented. The chosen subject is the development of a "JUnit" Module which provides facilities to build unit tests for a Java application model.

The Modelio JUnit module builds a Java unit test model based on the user model following a simple paradigm: each class in the model that has to be JUnit-tested produces a corresponding JUnit test class.

The test model is then generated using the standard Modelio Java Designer module, which also manages the compilation and execution of the Java code.

The features of this example JUnit module are reduced to:

In order to clearly identify the test case classes from the model and to be able to delete the test cases when the tested class is removed from the model, two stereotypes are defined :

The following figure gives an example of a model class Motor and its test case class MotorTest created by our module.

image
Example of model with JUnit test case

<< Modelio Studio commands

Index

Creating the JUnit Studio project >>