Click here to see your recently viewed pages and most viewed pages.

JUnit Factory Class Generation


The Generate Factory Classes menu item automates the creation of factory classes. A factory class is a class that contains static methods that return instances of a specific class. Factory classes are used during the generation of test cases. The documentation for the JUnit Test Case Generator contains a description of the use of factory classes.

To generate a factory class for a given target class, select the target class in the Package Explorer, then select the CodePro > Generate Factory Classes menu item. The location and name of the factory class are controlled by the settings on the factory class preference page.