Community
Participate
Working Groups
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();
Created attachment 146271 [details] Patch to guard against test runner exceptions
Seems reasonable. Thanks for the contribution.