Community
Participate
Working Groups
Build Identifier: 20100617-1415 We get this exception if our junit plugin tests are launched only the required plugins. Among the selected required plugins are org.eclipse.ui and org.eclipse.ui.workbench. Reproducible: Always Steps to Reproduce: In a class our plugin under test we have the following imports: import org.eclipse.debug.ui.console.IConsole; import org.eclipse.debug.ui.console.IConsoleLineTracker; When instansiating the class we have Caused by: java.lang.IllegalStateException: Workbench has not been created yet. at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92) at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.startup(LaunchingResourceManager.java:542) at org.eclipse.debug.internal.ui.DebugUIPlugin.getLaunchingResourceManager(DebugUIPlugin.java:301) at org.eclipse.debug.internal.ui.DebugUIPlugin.start(DebugUIPlugin.java:502) Our real case actually is the Tycho test infrastucture which under the hood runs an eclipse installation with the required bundles only.
Created attachment 178768 [details] the exeption trace
Created attachment 178769 [details] console output
How does it determine the 'required' bundles? If you use the Configuration Dialog to create a specific launch config, select your plugin(s) and then hit the 'Add Required Plug-ins' button does the resulting config work? If it does perhaps you might look for a discrepancy between what it has and what your current one computes ??
You cannot access debug UI classes until the workbench is fully initialized (cannot access most things that come out of org.eclipse.ui/org.eclipse.ui.workbench). When you run your junit plugin tests, what application are you using (either directly, or through your product)? PW