Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 306010

Summary: org.eclipse.pde.junit.runtime test applications use main and are global singletons
Product: [Eclipse Project] PDE Reporter: Thomas Watson <tjwatson>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: chatziparaskewas, darin.eclipse, gunnar, kane.mx, kane.zhu, markus.kell.r
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug

Description Thomas Watson CLA 2010-03-16 09:47:02 EDT
All of the pde junit applications except coretestapplicationnonmain are defined to run on the main thread and are global singleton.  This causes some issues when testing actual applications.  For example, with the uitestapplication.  The org.eclipse.pde.internal.junit.runtime.UITestApplication is forced to query the applications extension point its self and create the executable extension instead of letting the Eclipse application container do the proper work of getting the application running on the main thread.

We should at least have an option to launch a junit application that is main threaded and is not a singleton.  We do have coretestapplicationnonmain application that I use for session tests to exercise the eclipse application container.  But I am not sure if that can be used in general.  Many times developers have no need to run a session test and it adds lots of complications.

It would be nice if we could just have applications like uitestapplication run on "any" thread and have a cardinality of "1" instead of being global singletons.  This way they could launch the "real" application using the proper ApplicationDescriptor for the application that is to be launched during the test.

This may not be needed if there was some easy recommended way of using coretestapplicationnonmain when launching a JUnit Plug-in Test.  The end result is that we should allow test code to be executed on a non-main thread in such a way that the main thread is not locked for application launching and the application container is not locked because a global singleton application is already running.

Sorry for the disjointed bug report.  I am not sure on what the proper solution to this issue is at the moment. :)
Comment 1 Meng Xin Zhu CLA 2010-03-17 05:46:22 EDT
We launch Junit test as [No application]-headless mode.
And only 'org.eclipse.pde.build.Build' is listed in the application list.
Comment 2 Gunnar Wagenknecht CLA 2011-02-13 16:10:49 EST
I think we should address this one-by-one. I modified the patch in bug 311979 to set the cardinality to 1 for the non-UI thread test application. This allows to implement tests for headless OSGi applications.
Comment 3 Eclipse Genie CLA 2019-08-30 13:01:05 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Thomas Watson CLA 2019-08-30 13:30:40 EDT
At this point I think it is fair to state that we have no plans to address this.  Closing as wontfix.