Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324846 - Test failure in PluginsNotLoadedTest when run from AllZRHTests
Summary: Test failure in PluginsNotLoadedTest when run from AllZRHTests
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 09:32 EDT by Markus Keller CLA
Modified: 2010-09-15 03:13 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-09-09 09:32:19 EDT
In HEAD, we have a test failure in org.eclipse.jdt.text.tests.PluginsNotLoadedTest#testPluginsNotLoaded():

junit.framework.AssertionFailedError: Wrong bundles loaded:
- org.eclipse.ui.console

	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at org.eclipse.jdt.text.tests.PluginsNotLoadedTest.testPluginsNotLoaded(PluginsNotLoadedTest.java:259)
...

This *only* happens when run from AllZRHTests (doesn't fail in the build). Could be caused by the new OpenFromClipboardAction class which directly references types from the org.eclipse.ui.console plug-in.
Comment 1 Markus Keller CLA 2010-09-09 09:36:25 EDT
Assigning to Dani for now. I'm not sure if it's really worth adding dances to delay the loading of org.eclipse.ui.console when org.eclipse.jdt.debug.ui is loaded. I would just add the console bundle to the AllZRHTests.
Comment 2 Deepak Azad CLA 2010-09-09 10:06:57 EDT
> Could be caused by the new OpenFromClipboardAction class which directly
> references types from the org.eclipse.ui.console plug-in.
Probably not, o.e.jdt.debug.ui already had references to the same types.
Comment 3 Markus Keller CLA 2010-09-09 14:14:57 EDT
> Probably not, o.e.jdt.debug.ui already had references to the same types.

Yes, but the question is: When are the classes with such references loaded? A required plug-in is only loaded when the first of its classes is loaded.

The cause is indeed the org.eclipse.jdt.internal.debug.ui.actions.OpenFromClipboardAction class that is referenced from /org.eclipse.jdt.debug.ui/plugin.xml:

EquinoxRegistryStrategy#createExecutableExtension(..) line: 184	

	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
	at java.lang.Class.getConstructor0(Class.java:2671)
	at java.lang.Class.newInstance0(Class.java:321)
	at java.lang.Class.newInstance(Class.java:303)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:153)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:675)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:378)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:286)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
	at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
	at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
	at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
	at java.lang.Class.getConstructor0(Class.java:2671)
	at java.lang.Class.newInstance0(Class.java:321)
	at java.lang.Class.newInstance(Class.java:303)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:259)
	at org.eclipse.ui.internal.PluginAction.createDelegate(PluginAction.java:122)
	at org.eclipse.ui.internal.WWinPluginAction.refreshActionList(WWinPluginAction.java:165)
	at org.eclipse.ui.plugin.AbstractUIPlugin$1.run(AbstractUIPlugin.java:486)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3515)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3164)
	at org.eclipse.jdt.text.tests.performance.EditorTestHelper.runEventQueue(EditorTestHelper.java:196)
	at org.eclipse.jdt.text.tests.performance.EditorTestHelper.runEventQueue(EditorTestHelper.java:192)
	at org.eclipse.jdt.text.tests.performance.EditorTestHelper.runEventQueue(EditorTestHelper.java:188)
	at org.eclipse.jdt.text.tests.performance.EditorTestHelper.openInEditor(EditorTestHelper.java:127)
	at org.eclipse.jdt.text.tests.MarkOccurrenceTest.openJavaEditor(MarkOccurrenceTest.java:160)
	at org.eclipse.jdt.text.tests.MarkOccurrenceTest.setUp(MarkOccurrenceTest.java:100)
Comment 4 Markus Keller CLA 2010-09-09 14:19:52 EDT
Given that the ConsolePlugin doesn't even have a start(..) method, I still think we should just adapt the test.
Comment 5 Dani Megert CLA 2010-09-14 02:16:03 EDT
Simple steps in the workbench (open CU and CF editor, open context menu) do not load the Console plug-in, so it's not too much of a deal. The reason for this is that in a new workbench the JDT Debug UI plug-in is not yet loaded and hence the delegate (OpenFromClipboardAction) is not loaded.

Fixed in 'AllZRHTests' by adding the console plug-in to the list of loaded plug-ins.
Comment 6 Dani Megert CLA 2010-09-15 03:13:12 EDT
Verified in I20100914-0100.