test.ca.odell.glazedlists.swt.SwtTestCase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glazedlists_java15 Show documentation
Show all versions of glazedlists_java15 Show documentation
Event-driven lists for dynamically filtered and sorted tables
/* 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