Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

E4/Compatibility/Testing

< E4‎ | Compatibility
Revision as of 17:00, 7 January 2010 by Remysuen.ca.ibm.com (Talk | contribs) (Creation)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page describes how to run the 3.x API tests with a workbench that's backed by e4's compatibility layer.

Setup

  1. Download a recent e4 SDK here.
  2. Import the following projects into your workspace. You will have compiler errors.
<?xml version="1.0" encoding="UTF-8"?>
<psf version="2.0">
<provider id="org.eclipse.team.cvs.core.cvsnature">
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,org.eclipse.core.tests.harness,org.eclipse.core.tests.harness"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.core.services,org.eclipse.e4.core.services"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,e4/org.eclipse.e4.ui/bundles/org.eclipse.e4.ide.application,org.eclipse.e4.ide.application"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,org.eclipse.test.performance,org.eclipse.test.performance"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,e4/org.eclipse.e4.ui/bundles/org.eclipse.ui,org.eclipse.ui"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,e4/org.eclipse.e4.ui/bundles/org.eclipse.ui.ide,org.eclipse.ui.ide"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,e4/org.eclipse.e4.ui/bundles/org.eclipse.ui.ide.application,org.eclipse.ui.ide.application"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,org.eclipse.ui.tests,org.eclipse.ui.tests"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,org.eclipse.ui.tests.harness,org.eclipse.ui.tests.harness"/>
<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,e4/org.eclipse.e4.compatibility/bundles/org.eclipse.ui.workbench,org.eclipse.ui.workbench"/>
</provider>
</psf>

Running the tests

  1. Select a test from the org.eclipse.ui.tests bundle, such as org.eclipse.ui.tests.api.IWorkbenchPageTest for example.
  2. If there are compiler errors indicating incorrect imports, try using 'Organize Imports' to get rid of them or to have them point to the e4 variant of the internal.
  3. Right-click on the file > Debug As > JUnit Plug-in Test.
  4. This will fail. Open the launch configuration dialog.
  5. Select the launch configuration that was just generated and go to the 'Main' tab.
  6. Change the target product to org.eclipse.e4.ide.application.product.
  7. Try running the test again. It should work now.

Known issues

  1. If you get a NullPointerException in OSGiContextStrategy like the stack trace below, you are seeing bug 299070. To workaround the problem, you can checkout org.eclipse.e4.core.services from CVS and then apply the patch that's there until a proper fix has been checked in.
 java.lang.NullPointerException
	at org.eclipse.e4.internal.core.services.osgi.OSGiContextStrategy.addingService(OSGiContextStrategy.java:71)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)
	at org.eclipse.e4.internal.core.services.osgi.OSGiContextStrategy.lookup(OSGiContextStrategy.java:123)
	at org.eclipse.e4.core.services.internal.context.EclipseContext.internalGet(EclipseContext.java:347)
	at org.eclipse.e4.core.services.internal.context.EclipseContext.get(EclipseContext.java:316)
	at org.eclipse.ui.PlatformUI.getTestableObject(PlatformUI.java:171)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:43)

Back to the top