How to run the unit tests of the Eclipse JFace UI toolkit

Sometimes your are not able to extend your application by plug-ins and you have to make changes to the Eclipse code itself. In this case you should use the existing Eclipse JUnit tests to validate your changes. I’m currently working at the JFace Bundle so I’m trying to take advantage of the existing JFace unit tests (currently 966).

The unit tests for the JFace Bundle are placed in the org.eclipse.ui.tests plug-in. This plug-in includes also several other tests for the plattform.ui.

To run this tests also the following plug-ins are needed:

Just clone this repositories and import the plug-ins into your workspace.

It is also required to have a API Baseline configured. You do this by Window > Preferences > Plug-in Development > API Baselines
In my case I added the Baseline of my current Kepler installation.

To test the full JFace TestSuite, you only need to run the “JFace-All Tests.launch” run configuration from the org.eclipse.ui.tests plugin.

After the run, the testresults hopfully look like in the following screenshot :-)

Screenshot of the JFace JUnit run

Screenshot of the JFace JUnit run

Source:http://wiki.eclipse.org/Eclipse/Testing

This entry was posted in Eclipse, Hendrik Still. Bookmark the permalink.