Running a Test
This topic describes how to create and run a test configuration.
Before you can run a test, generate the test suite's Java code and create a test deployment.
- Open the Launch Configuration dialog box by clicking Run > Run.
- The Perspectives tab lets you specify whether the perspective should change during debug, run, and profile operations. To change the default switching behavior for a mode, click its arrow and select the perspective from the drop-down list. When you finish setting the perspectives, click New to create a new test configuration. The Test tab opens, as shown below.
- Enter a name for the configuration in the Name field. Select one or more tests to include in the configuration, and select one or more deployments. A deployment specifies where to run the test and which test assets to use. Click Execution Results to display that tab, as shown below.
In the Location box navigate to the folder where you want to store the test results file, and enter a name for the file in the Name field. Select Override existing Execution Results resource to overwrite the test results file each time you run the test configuration. Click Common to display the Common tab, as shown below.
- When you run a test configuration, Eclipse creates a file, with a .launch suffix, containing metadata. If you select Local, Eclipse stores this file in your workspace's metadata folder, which is not visible to other users. If you want other users to have access to the file, select Shared, click Browse, and navigate to a folder in your workspace where you want to store the file. To have the test configuration appear in the Run, Debug, or Profile favorites toolbar menus, select the appropriate boxes. Select Launch in background to have Eclipse run the test configuration in the background. If you do not run the configuration in the background, you cannot do anything in Eclipse until it finishes running the configuration.
- Click Apply to save the settings for the configuration. Click Run to launch the configuration.
Parent topic
JUnit test overview
Previous topic: Generating Java code
Next topic: Analyzing JUnit test results