Chapter 11. Automated Testing of Plug-ins

JUnit and SWTBot – automated testing of plug-ins

JUnit is the testing framework of choice for Eclipse applications, and can be used to run either pure Java tests or plug-in tests. If user interfaces need to be exercised, then SWTBot provides a facade onto the underlying Eclipse application, and can be used to drive menus, dialogs, and views.

In this chapter, we will:

  • Create a JUnit test running as pure Java code
  • Create a JUnit test running as a plug-in
  • Write a UI test using SWTBot
  • Interrogate views and work with dialogs
  • Wait for a condition to occur before continuing

Using JUnit for automated testing

One of the original automated unit testing frameworks, JUnit has been in use at Eclipse for over a decade. Part ...

Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.