All Downloads are FREE. Search and download functionalities are using the official Maven repository.

test.ca.odell.glazedlists.swt.SwtTestCase Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
/* Glazed Lists                                                 (c) 2003-2007 */
/* http://publicobject.com/glazedlists/                      publicobject.com,*/
/*                                                     O'Dell Engineering Ltd.*/
package ca.odell.glazedlists.swt;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import ca.odell.glazedlists.GuiTestCase;

/**
 * Utility class for running JUnit tests with SWT code.
 *
 * 

This class has the following behaviour: * *

    *
  • Extending classes must not define any testXXX() methods. * They should define only guiTestXXX() methods.
  • * *
  • If one test fails, they all fail.
  • *
* * This class provides both the SWT {@link Display} and {@link Shell} for the * test methods available via {@link #getDisplay()} and {@link #getShell()}. * * @author Holger Brands * @author James Lemieux * @author Jesse Wilson */ public class SwtTestCase extends GuiTestCase { private Display display; private Shell shell; protected final void executeOnGUIThread(Runnable runnable) { display = new Display(); shell = new Shell(display); try { display.syncExec(runnable); } finally { display.dispose(); } } protected Display getDisplay() { return display; } protected Shell getShell() { return shell; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy