Project: JDT
Bug 14702 JUnit plugin displays incorrect Failure Trace when using JUnit decorator
Reported: 2002-04-25 16:50:40 | Status: resolved fixed

The suite method we're running: public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new TD_DecoratorOne(new TestSuite(TC_SomeTest.class))); suite.addTest(new TD_DecoratorTwo(new TestSuite(TC_SomeTest.class))); return suite; } // One of the methods in TC_SomeTest protected void testQuery() { ... some assertEquals()... with a customized message reflecting the decorator that was run. } Assume testQuery() fails when run in each decorator (our decorators are subclasses of TestSetup). System.out.println() reflects the customized message. The JUnit SwingUI reflects the customized message. The JUnit TextUI reflects the customized message. The Eclipse JUnit plugin Failure Trace shows the message for the most recent failure for BOTH failures rather than the correct customized message for each failure. We think the potential source of the problem is that the 2 tests have the same name and it looks like TestRunInfo is basing the failure trace display on the test name (see the equals() method). This may not be the source of the problem...just a guess after looking at the plugin for about 10 minutes. Due to this problem, we really can't depend on the JUnit plugin whenever we use decorators, because the failure message isn't accurate. Other than this issue, we're quite fond of the JUnit plugin and would love to use it.

Files changed in fix:
org.eclipse.jdt.junit.core/src/org/eclipse/jdt/junit/ITestRunListener.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/launcher/JUnitMainTab.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/runner/MessageIds.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/FailureRunView.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/HierarchyRunView.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/ITestRunListener2.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/ITestRunView.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/JUnitProgressBar.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/RemoteTestRunnerClient.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/RerunAction.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunInfo.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/JUnitStubUtility.java org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/ITestRunListener.java