Bug 209510 - [JUnit] launching Junit4 tests with 1.4 silently fails
Summary: [JUnit] launching Junit4 tests with 1.4 silently fails
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Brian Bauman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 217011
Blocks:
  Show dependency tree
 
Reported: 2007-11-12 10:53 EST by Jeff McAffer CLA
Modified: 2008-01-31 12:40 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2007-11-12 10:53:53 EST
in M3

i had a mess of tests I was developing using a 1.5 based system.  In trying to track down a bug I switched the launch config to us Java 1.4 and launched.  Nothing worked, not even the breakpoints.  In the end it was a dumb error on my part as the launch config was setup to use Junit 4 which required Java 1.5.

It would be real nifty if somehow the user could be warned that the launch they are setting up will not work.
Comment 1 Darin Wright CLA 2007-11-12 10:55:11 EST
Moving to JUI. They own JUnit launcher.
Comment 2 Martin Aeschlimann CLA 2007-11-12 12:20:18 EST
I couldn't reproduce this.

Do you have a precise description of the scenario?
- Normal Java project or PDE project
- what were the compiler compliance settings
- what was the VM version selected
- Which JUnit version on the classpath
- If it was a PDE project, which execution environment was set
- was the test you ran a JUnit 3 test (extends TestCase) or a JUnit 4 test (@Test)

We tried hard to not swallow any error messages and support users by giving error dialogs when for example starting JUnit 4 tests with a JUnit 3 runner.
Comment 3 Jeff McAffer CLA 2007-11-12 21:11:22 EST
- PDE project
- Tests are actually Junit 3 tests
- EE set to 1.4 (with corresponding compliance settings)
- Launch config says use Junit 4
- Launch JRE is 1.5
- Right click on a test class and say Run as ... > Junit plugin test

All is happy

- Change JRE to 1.4.2_08 for the launch configuration and run => silent failure 

Of course, I too am now having trouble reproducing.  I did spend about 45 min on this this morning.  Pinged Darin and as I was describing it to him I realized that Junit was set to Junit 4.  Changed that and all worked.  It may have been a particular test?  
Comment 4 Martin Aeschlimann CLA 2007-11-27 05:15:11 EST
I think I got the problem:
The following exception is in the log
Caused by: java.lang.IllegalArgumentException: No Classloader found for plug-in org.eclipse.jdt.junit4.runtime
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getClassLoader(RemotePluginTestRunner.java:73)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.readPluginArgs(RemotePluginTestRunner.java:88)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.init(RemotePluginTestRunner.java:78)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:57)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:122)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)


- the example plug-in specifies EE 1.4
- it has a plug-in dependency to EE 1.5

- the launcher picks a EE 1.4 JRE to launch. Maybe it would be a good time to warn that the plug-in has requirements with a higher EE?

Moving to PDE.
Comment 5 Brian Bauman CLA 2008-01-29 17:41:11 EST
I think I finally figured out a solution :)
Comment 6 Brian Bauman CLA 2008-01-31 12:40:53 EST
With the fix applied in 217011, this is working in PDE UI now.  This will help poor souls who inadvertently create an invalid junit configuration.