Project: JDT
Bug 169166 [JUnit] JUnit does not report failure when a test fails if the exception thrown by the test fails itself in getMessage()
Reported: 2006-12-28 03:10:09 | Status: resolved fixed

Build ID: M20060629-1905 Steps To Reproduce: In the following example, JUnit reports no failures, doesn't finish properly (progress information is not updated to show that the test has concluded) and doesn't continue processing tests. import org.junit.Test; public class Sample { @Test public void testSomething() { throw new RuntimeException() { public String getMessage() { throw new IllegalArgumentException("whatever"); } }; } } More information:

Files changed in fix:
org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/junit3/JUnit3Listener.java org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/junit3/JUnit3TestReference.java org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/JUnit4TestListener.java