The first thing to do is to stop the debugging of Modelio in Eclipse.
Edit and fix the code
In the following example, we want to change the suffix of test classes from "Test" to "-test".
Step 1 – In Eclipse, look for the following in the "createTestCase" method of the "TestCaseCreator":
1
String testClassName = classToTest.getName() + "Test";
Step 2 – Update the code as follows:
1
String testClassName = classToTest.getName() + "-test";
Step 3 – Save the modification: go to "File –> Save" or use the [CTRL] + [S] combination keys
Compile in Eclipse
The module can then be repackaged in Eclipse. To do so, in Eclipse, right-click on "junit / pom.xml" to open its contextual menu, then select "Run As" –> "Maven install".
After the building, the module is stored in the target directory.
Reopen the test project
-
Restart Modelio in debug mode
-
Open the test project
-
Redeploy the JUnit module:
Right-clik on the Test work model to open its contextual menu, then select "Administration –> Deploy a module directory from a jmdac file…"
-
Execute the "Create a test case" command
Retrieve the modified code
The modification made in the createTestCase class source must be reversed in the JUnit_sample Studio project.
-
Open the JUnit_sample Studio project.
-
Search for the class named "TestCaseCreator": Enter "TestCaseCreator" in the fast search field and hit Enter.
-
The "TestCaseCreator" class is selected in the model browser. Open the Java property view and click on the
"Update model from sources" button.