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 55273 Details for
Bug 166972
[Workbench] Migrate org.eclipse.ui.ide.workbench to IApplication
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
pde.junit.runtime patch
166972_org.eclipse.pde.junit.runtime.patch (text/plain), 3.31 KB, created by
Thomas Watson
on 2006-12-07 15:40:25 EST
(
hide
)
Description:
pde.junit.runtime patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2006-12-07 15:40:25 EST
Size:
3.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.junit.runtime >Index: src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java,v >retrieving revision 1.19 >diff -u -r1.19 UITestApplication.java >--- src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java 3 May 2006 13:30:31 -0000 1.19 >+++ src/org/eclipse/pde/internal/junit/runtime/UITestApplication.java 7 Dec 2006 20:36:19 -0000 >@@ -18,6 +18,8 @@ > import org.eclipse.core.runtime.IPlatformRunnable; > import org.eclipse.core.runtime.IProduct; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.equinox.app.IApplication; >+import org.eclipse.equinox.app.IApplicationContext; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.testing.ITestHarness; > import org.eclipse.ui.testing.TestableObject; >@@ -26,31 +28,44 @@ > * A Workbench that runs a test suite specified in the > * command line arguments. > */ >-public class UITestApplication implements IPlatformRunnable, ITestHarness { >+public class UITestApplication implements IApplication, ITestHarness { > > private static final String DEFAULT_APP_3_0 = "org.eclipse.ui.ide.workbench"; //$NON-NLS-1$ > > private TestableObject fTestableObject; >+ private IApplication application; > > /* (non-Javadoc) >- * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object) >+ * @see org.eclipse.equinox.app.IApplication#start(java.lang.Object) > */ >- public Object run(final Object args) throws Exception { >- IPlatformRunnable application = getApplication((String[]) args); >+ public Object start(IApplicationContext context) throws Exception { >+ String[] args = (String[]) context.getArguments().get(IApplicationContext.APPLICATION_ARGS); >+ Object app = getApplication(args); > >- Assert.assertNotNull(application); >+ Assert.assertNotNull(app); > > fTestableObject = PlatformUI.getTestableObject(); > fTestableObject.setTestHarness(this); >- return application.run(args); >+ if (app instanceof IApplication) { >+ application = (IApplication) app; >+ return application.start(context); >+ } >+ return ((IPlatformRunnable) app).run(args); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.equinox.app.IApplication#stop() >+ */ >+ public void stop() { >+ if (application != null) >+ application.stop(); > } >- > > /* > * return the application to run, or null if not even the default application > * is found. > */ >- private IPlatformRunnable getApplication(String[] args) throws CoreException { >+ private Object getApplication(String[] args) throws CoreException { > // Find the name of the application as specified by the PDE JUnit launcher. > // If no application is specified, the 3.0 default workbench application > // is returned. >@@ -70,8 +85,8 @@ > IConfigurationElement[] runs = elements[0].getChildren("run"); //$NON-NLS-1$ > if (runs.length > 0) { > Object runnable = runs[0].createExecutableExtension("class"); //$NON-NLS-1$ >- if (runnable instanceof IPlatformRunnable) >- return (IPlatformRunnable) runnable; >+ if (runnable instanceof IPlatformRunnable || runnable instanceof IApplication) >+ return runnable; > } > } > return null;
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 166972
:
55146
| 55273