*/
private Object getApplication(String[] args) throws CoreException {
// Find the name of the application as specified by the PDE JUnit launcher.
// If no application is specified, the 3.0 default workbench application
// is returned.
IExtension extension =
Platform.getExtensionRegistry().getExtension(
Platform.PI_RUNTIME,
Platform.PT_APPLICATIONS,
getApplicationToRun(args));
Assert.isNotNull(extension);
// If the extension does not have the correct grammar, return null.
// Otherwise, return the application object.
IConfigurationElement[] elements = extension.getConfigurationElements();
if (elements.length > 0) {
IConfigurationElement[] runs = elements[0].getChildren("run"); //$NON-NLS-1$
if (runs.length > 0) {
Object runnable = runs[0].createExecutableExtension("class"); //$NON-NLS-1$
if ((runnable instanceof IPlatformRunnable) || (runnable instanceof IApplication))