JUnit Transformation

Return to Introduction  Previous page  Next page

The purpose of the JUnit transformation is to create a class with test methods for all public methods of an existing Java class.  The resulting class can then be generated and the tests filled out and run by JUnit.

So from the java model we originally transformed from our PIM:


We transform to:


Note that for each class in the java model, a corresponding test class has been created.  Each of these test classes contains a test method for every public method in the source class, plus the methods required to appropriately set up the tests.  It is your responsibility to fill in the details of each test.

See Also