ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 45028] New: ant-junit treats ComparisonFailure as Error
Date Sun, 18 May 2008 15:18:21 GMT

           Summary: ant-junit treats ComparisonFailure as Error
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks

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 for debugging.
(in src/main/org/apache/tools/ant/taskdefs/optional/junit/

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.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message