Browse Source

JUnit's filtertrace swallows the assert failure message if it contains the word 'more' as reported on the user list - http://mail-archives.apache.org/mod_mbox/ant-user/201107.mbox/%3CCAPsH_EDFnhkW4Y4r87U2jmN2gKPAyK6ZJX5F-4ohC6tJ9rXi6Q@mail.gmail.com%3E

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1154190 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 14 years ago
parent
commit
087f028977
1 changed files with 36 additions and 0 deletions
  1. +36
    -0
      src/tests/antunit/taskdefs/optional/junit/xmlformatter-test.xml

+ 36
- 0
src/tests/antunit/taskdefs/optional/junit/xmlformatter-test.xml View File

@@ -87,4 +87,40 @@ public class A extends TestCase {
value="AssertionFailedError: &&"/>
</target>

<target name="XtestMessageWithTheWordMore">
<mkdir dir="${input}/org/example"/>
<echo file="${input}/org/example/A.java"><![CDATA[
package org.example;
import junit.framework.TestCase;
public class A extends TestCase {
public void testX() {
assertTrue("Expected more than one result", 0 > 1);
}
public void testY() {
assertTrue("Expected less than one result", 2 < 1);
}
}
]]></echo>
<mkdir dir="${output}"/>
<javac srcdir="${input}" destdir="${output}">
<classpath refid="junit"/>
</javac>
<junit fork="true">
<classpath refid="junit"/>
<classpath location="${output}"/>
<batchtest todir="${output}">
<fileset dir="${output}">
<include name="**/A.class" />
</fileset>
</batchtest>
<formatter type="xml"/>
</junit>
<au:assertResourceContains
resource="${output}/TEST-org.example.A.xml"
value="junit.framework.AssertionFailedError: Expected less than one result"/>
<au:assertResourceContains
resource="${output}/TEST-org.example.A.xml"
value="junit.framework.AssertionFailedError: Expected more than one result"/>
</target>

</project>

Loading…
Cancel
Save