Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 113889 Details for
Bug 249146
UI tests not running in a UI thread
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Patch to UITestApplication
patch.txt (text/plain), 1.99 KB, created by
Quentin Ochem
on 2008-09-30 12:54:50 EDT
(
hide
)
Description:
Patch to UITestApplication
Filename:
MIME Type:
Creator:
Quentin Ochem
Created:
2008-09-30 12:54:50 EDT
Size:
1.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.test >Index: src/org/eclipse/test/UITestApplication.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.test/src/org/eclipse/test/UITestApplication.java,v >retrieving revision 1.12 >diff -u -r1.12 UITestApplication.java >--- src/org/eclipse/test/UITestApplication.java 6 Jun 2007 18:13:19 -0000 1.12 >+++ src/org/eclipse/test/UITestApplication.java 30 Sep 2008 16:47:26 -0000 >@@ -21,7 +21,10 @@ > import org.eclipse.core.runtime.Platform; > import org.eclipse.equinox.app.IApplication; > import org.eclipse.equinox.app.IApplicationContext; >+import org.eclipse.jface.dialogs.ErrorDialog; >+import org.eclipse.jface.util.SafeRunnable; > >+import org.eclipse.swt.widgets.Display; > import org.eclipse.ui.IWindowListener; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchWindow; >@@ -125,13 +128,40 @@ > return DEFAULT_APP_3_0; > } > >+ private static class SimpleTestableWorker extends TestableObject { >+ >+ public void testingFinished() { >+ // force events to be processed, and ensure the close is done in the UI thread >+ Display.getDefault().syncExec(new Runnable() { >+ public void run() { >+ PlatformUI.getWorkbench().close(); >+ } >+ }); >+ } >+ } >+ > /** > * In 3.0 mode > * > */ > private Object runApplication(Object application, Object args) throws Exception { >+ > fTestableObject = PlatformUI.getTestableObject(); >- fTestableObject.setTestHarness(this); >+ >+ String [] argsStr = (String []) args; >+ >+ for (int j = 0; j < argsStr.length; j++) { >+ if (argsStr [j].equals ("-testJob")) { >+ if (j + 1 < argsStr.length) { >+ if (argsStr [j + 1].equals ("worker")) { >+ fTestableObject = new SimpleTestableWorker (); >+ } >+ } >+ } >+ } >+ >+ PlatformUI.getTestableObject().setTestHarness(this); >+ > if (application instanceof IPlatformRunnable) { > return ((IPlatformRunnable) application).run(args); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 249146
: 113889