Project: JDT
Bug 19633 JUnit launch configurations are not honoring class path
Reported: 2002-06-07 14:01:38 | Status: verified fixed

If I make a junit test that needs different things on the classpath than what a project needs for building, and try to make a launch configuration that reflects that, it looks like the junit runner ignores the LC and just goes with the project build classpath. The concrete example I can give is an EJB, which is built as a generic J2EE component (using sun's j2ee SDK), and I want to test against Weblogic, but don't want to be forced to put weblogic.jar in the the build classpath. If I put the vendor-specific jar (i.e. weblogic.jar) into the build path, the junit test runs fine. If I put it into the launch configuration user classpath, the weblogic InitialContextFactory is not found (instantiated via reflection). If I put it into the bootstrap classpath, the InitialContextFactory is found, but weblogic blows up later on in the test, possibly due being loaded by the bootstrap CL. This problem is repeatable without J2EE app servers involved, and shows up any time a unit test is loading a class via reflection. The trivial case can be worked around by using the boostrap classpath, but the more significant one cannot.

Files changed in fix:
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/launcher/JUnitLaunchConfiguration.java