Bug 62503 Classloader problem with older versions of JUnit [JUnit]
I have a project with a version 3.6 junit.jar on the classpath. In 3.0M8 when I run a test with an assertEquals() that fails, I get this error: java.lang.NoClassDefFoundError: junit/framework/ComparisonFailure at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.addFailure(RemoteTestRunner.java:533) at junit.framework.TestResult.addFailure(TestResult.java:46) at junit.framework.TestResult.runProtected(TestResult.java:127) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:131) at junit.framework.TestSuite.runTest(TestSuite.java:173) at junit.framework.TestSuite.run(TestSuite.java:168) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182) Exception in thread "main" This used to work with Eclipse 2.1 (which also had JUnit 3.8.1 built in), and it disappears when I upgrade my copy of junit.jar to 3.8.1 to match the Eclipse one.
org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java
TestResult result= new TestResult();
		rerunTest.run(result);
		notifyTestReran(result, Integer.toString(testId), className, testName);
	}
	/**
	 * Prepare a single test to be run standalone. If the test case class provides
	 * a static method Test setUpTest(Test test) then this method will be invoked.
	 * Instead of calling the test method directly the "decorated" test returned from
	 * setUpTest will be called. The purpose of this mechanism is to enable
	 * tests which requires a set-up to be run individually.
	 */
	private Test setupTest(Class reloadedTestClass, Test reloadedTest) {
		Method setup= null;
		try {
			setup= reloadedTestClass.getMethod(SET_UP_TEST_METHOD_NAME, new Class[] {Test.class});
		} catch (SecurityException e1) {
			return reloadedTest;
		} catch (NoSuchMethodException e) {
			return reloadedTest;
		}
		if (setup.getReturnType() != Test.class)
			return warning(JUnitMessages.getString("RemoteTestRunner.error.notestreturn")); 
		if (!Modifier.isPublic(setup.getModifiers()))
			return warning(JUnitMessages.getString("RemoteTestRunner.error.shouldbepublic"));  
		if (!Modifier.isStatic(setup.getModifiers()))
			return warning(JUnitMessages.getString("RemoteTestRunner.error.shouldbestatic"));  
		try {
			Test test= (Test)setup.invoke(null, new Object[] {reloadedTest});
			if (test == null)
				return warning(JUnitMessages.getString("RemoteTestRunner.error.nullreturn"));