I have a unit test that contains 6 test cases (@Test
-annotated methods) that all run perfectly when I run the Java file as a JUnit Test (from inside Eclipse workbench). But when I go to run a run-tests
Ant target from a buildscript, they fail with the following console output:
[junit] Running com.me.myproject.WidgetTest
[junit] Tests run: 6, Failures: 6, Errors: 0, Time elapsed: 1.737 sec
[junit] Test com.me.myproject.WidgetTest FAILED
Here is the JUnit section of the run-tests
target:
<junit fork="yes" forkmode="once" dir="${basedir}" printsummary="yes" haltonerror="no" haltonfailure="no">
<classpath>
<path refid="test.class.path"/>
<pathelement location="${mainBuildDir}"/>
<pathelement location="${testBuildDir}"/>
</classpath>
<formatter type="xml"/>
<batchtest todir="${genUnitTestReportsDir}">
<fileset dir="${testJavaSrcDir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
Anybody ever hear of this happening? Is there any way to get more (verbose) output from JUnit's ant task? Any good way to debug what's happening here? Thanks in advance!
showoutput
parameter of junit Ant task. ant.apache.org/manual/Tasks/junit.html – yatskevich