Creating tests for plug-ins

You can test Eclipse plug-ins the same way as any other Java applications, with method-level or scenario-based test patterns.

Before creating a test for a plug-in, you must have a plug-in project and a plug-in test project. If you do not already have a plug-in test project, the wizard will help you create one.
Note: Plug-in test projects are not the same as other test projects. If you are testing a plug-in, you must use a specific plug-in test project.
To create a component test for an Eclipse plug-in:
  1. Click File > New > Other > Component Test > Plug-in > Plug-in Component Test and then click Next.

    This starts the Create Plug-in Component Test wizard.

  2. On the first wizard page, select the plug-in component test project that will contain the new test or click New to create a new plug-in component test project, and click Next.

    At this point, a static analysis is performed on the plug-in source files associated with the test project. These files were selected during the creation of the plug-in test project and serve to define the scope of the test. (The list of files in the project can be updated by modifying the test project's Test Scope properties).

    When the analysis is complete, you will see a list of components in a table format and sorted according to the computed metrics. You can use the guidance that these metrics provide to help you decide which classes or components are most important for you to test. Components with highlighted values or high numerical values are considered high-priority test candidates.

  3. Select the components you want to include in the test and click Next.
  4. On the Select a test pattern page, select the test pattern that you want to use and click Next.
  5. Follow the wizard steps exactly in the same manner as for a plain Java component test.

The result is a new test suite along with a test behavior script and one test case for each method selected.

Related tasks
Creating method-level Java tests
Creating scenario-based Java tests
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.