Ant is crashing if I put a <formatter> tag inside <junit>. Here's my
target:
<target name="test-this" depends="build">
<junit fork="true" haltonfailure="true" showoutput="true"
printsummary="true">
<formatter type="plain"/>
<classpath>
<path refid="test.path"/>
</classpath>
<test name="MyTest"/>
</junit>
</target>
When I run this target I get the following error:
[junit] java.lang.NoSuchMethodError
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter.s
tartTest(PlainJUnitResultFormatter.java:188)
[junit] at
junit.framework.TestResult.startTest(TestResult.java:151)
[junit] at junit.framework.TestResult.run(TestResult.java:103)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTe
stRunner.java:231)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitT
estRunner.java:409)
[junit] Exception in thread "main"
If I take out the <formatter> tag everything works fine!
1) Any idea why this is happening?
2) (When I get this to work) is there a way to direct the output file to
a specified directory? I am assuming by default it will dump the output
in basedir.
Thanks.
Naresh