|Re: [equinox-dev] Starting an application (testing)|
You could use the org.osgi.service.application.ApplicationDescriptor service. Each eclipse application gets a ApplicationDescriptor service registered for it. The ApplicationDescriptor.launch method can then be used to launch a test application. The reason this approach is not used is because the application PDE uses to launch (app id org.eclipse.pde.junit.runtime.coretestapplication) is considered a global singleton application. This prevents the application container from launching any other applications while the coretestapplication is running.
By default applications (defined with a org.eclipse.core.runtime.applications extension) run on the main thread and are global singletons. If the application org.eclipse.pde.junit.runtime.coretestapplication changed its cardinality to "1" instead of the default "singleton-global" then at least we could run test applications. But we would still contend with the main thread. You would only be able to run test applications that specified they can run on any thread.
In the org.eclipse.osgi.tests project we have session tests that use the application org.eclipse.pde.junit.runtime.coretestapplicationnonmain to run a separate session with an app that does not run on the main thread. This allows us to test the different application types with the application container. This is overly complex and likely not what you want to do just to perform some unit tests ;-)
But it would be nice to get the org.eclipse.pde.junit.runtime.coretestapplication to change its cardinality to "1" so we could launch non-main threaded applications in our tests.
"Ian Bull" ---01/19/2009 01:26:43 PM---Hi guys,
"Ian Bull" <irbull@xxxxxxxxxxxxxxxxx>
01/19/2009 01:26 PM
[equinox-dev] Starting an application (testing)