I tested under JDK 1.6.0_04, JUnit 4.4, Ant 1.7.0 I made a simple junit 4 assert: assertEquals("t", "test"); I expected ant display the test results as below: [junit] Tests run: 1, Failures: 1, Errors: 0 but I got: [junit] Tests run: 1, Failures: 0, Errors: 1 then I add logging code to JUnitTestRunner.java for debugging. (in src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java) when string assertEquals fails, junit4 throws org.junit.ComparisonFailure but ant-junit's JUnitTestRunner uses junit.framework.AssertionFailedError. In order to correct problem, I had to fix wrapListener method. In case of other assertEquals fails, junit4 throws java.lang.AssertionError, so there's no problem at all. I got expected result as below: assertEquals(1, 2); [junit] Tests run: 1, Failures: 1, Errors: 0 only ComparisonFailure exception have the problem.
fixed with svn revision 704571
I didn't think the URL was relevant to this bug report, sorry.
*** Bug 47486 has been marked as a duplicate of this bug. ***