- If the Unit Test Assistant View is not already open, choose Parasoft> Show View> Unit Test Assistant from the Eclipse menu bar.
- Select the method in the editor.
- Click the Add test case(s) button to open the Unit Test Assistant dialog.
- Select the Parameterized option.
(JUnitParams only) If you use the JUnitParams framework, customize the following options:
- The maximum number of parameter sets created for one test case specifies the maximum number of rows with parameter variants that will be created for one test case.
- Generate test data to specifies where the test cases will be saved. Choose Code (default) or CSV from the drop-down menu. CVS supports
Info title About CSV
- CSV supports UTF-8 character encoding.
- The CSV files are saved in the same folder as your Java files. If the location does not match the resource folder specified by your build system, copy the CSV files to the appropriate location.
If you use the JUnitParams framework, ensure that the JUnitParams library is added to your Eclipse project.
- Select the methods you want to create test cases for.
- Click OK.
- View the tests to modify the values and uncomment sample assertions. If you use the JUnitParams framework, your test cases will include the preconfigured parametrization data (see Configuring Preferences to view and customize the settings).
- Run the test with UTA to collect coverage information and recommendations for possible improvements (see Executing Unit Tests with Unit Test Assistant).