Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 288343 - UITestApplication does not guard against exception in runTests
Summary: UITestApplication does not guard against exception in runTests
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-02 07:28 EDT by Carsten Reckord CLA
Modified: 2009-09-02 10:55 EDT (History)
1 user (show)

See Also:


Attachments
Patch to guard against test runner exceptions (1.11 KB, patch)
2009-09-02 07:30 EDT, Carsten Reckord CLA
caniszczyk: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Reckord CLA 2009-09-02 07:28:54 EDT
User-Agent:       Opera/9.64 (Windows NT 6.0; U; en) Presto/2.1.1
Build Identifier: I20090611-1540

Currently, the UITestApplication used in PDE Tests does not protect against exceptions occuring in the TestableObject's runTests(...) method. Any exception thrown there will lead to the Test application not being shut down. That's not much of a problem in an interactive environment, where the user can just close the application, but it is problematic in an automated testing environment.

Reproducible: Always

Steps to Reproduce:
1. Create a PDE Debug configuration with a separate test plugin (or fragment)
2. Add all required plugins to the launch configuration
3. Remove the plugin under test from the launch configuration
4. Run the test
5. The test run will fail and the test application will continue to run




The reason for the failure in this case is the missing plugin in the launch configuration that leads to an exception similar to this:

java.lang.IllegalArgumentException: No Classloader found for plug-in plugin.under.test
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getClassLoader(RemotePluginTestRunner.java:77)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getTestClassLoader(RemotePluginTestRunner.java:71)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

The reason that the application is not shutting down is that the exception causes the UITestApplication.runTests() method to exit without calling 	fTestableObject.testingFinished();
Comment 1 Carsten Reckord CLA 2009-09-02 07:30:13 EDT
Created attachment 146271 [details]
Patch to guard against test runner exceptions
Comment 2 Chris Aniszczyk CLA 2009-09-02 10:54:40 EDT
Seems reasonable.

Thanks for the contribution.