01: /*
02: * (c) Copyright IBM Corp. 2000, 2001.
03: * All Rights Reserved.
04: */
05: package org.eclipse.pde.internal.junit.ui;
06:
07: import org.eclipse.swt.widgets.Display;
08: import org.eclipse.ui.internal.Workbench;
09: import org.eclipse.jface.window.Window;
10:
11: /**
12: * A Workbench that runs a test suite specified in the
13: * command line arguments.
14: */
15: public class UITestApplication extends Workbench {
16: /**
17: * Run an event loop for the workbench.
18: */
19:
20: protected void runEventLoop(Window.IExceptionHandler handler) {
21: // Dispatch all events.
22: Display display = Display.getCurrent();
23: while (true) {
24: try {
25: if (!display.readAndDispatch())
26: break;
27: } catch (Throwable e) {
28: break;
29: }
30: }
31:
32: // Run all tests.
33: String[] arguments = getCommandLineArgs();
34:
35: RemotePluginTestRunner.main(arguments);
36: // Close the workbench.
37: close();
38: }
39: }
|