Class SWTTestBase

java.lang.Object
uk.ac.gda.test.helpers.swt.SWTTestBase

public class SWTTestBase extends Object
Helper class for running SWT unit tests. To use it, extend this class, and then use the 'shell' field as the parent Composite for your tests. This class will take care of setting up the display and the shell, and disposing of them appropriately.

The test runner must be configured to have a virtual display avalable e.g. Xvfb

  • Field Details

    • display

      protected static org.eclipse.swt.widgets.Display display
    • shell

      protected org.eclipse.swt.widgets.Shell shell
  • Constructor Details

    • SWTTestBase

      public SWTTestBase()
  • Method Details

    • initializeDisplay

      public static void initializeDisplay()
    • initializeShell

      public void initializeShell()
    • destroyShell

      public void destroyShell()
    • destroyDisplay

      public static void destroyDisplay()
    • newShell

      protected void newShell()