Build: 20070629-6.0.0-M1 comes with Ant 1.7, my existing ANT script now bombs when running its junit task – this worked “out of the box” with earlier versions of MyEclipse – because that came with 1.6.x ANT.
My now failing task is:
<target name="run-unit-tests" depends="build-unit-tests, emma-jars" unless="dont-run-unit-tests">
<mkdir dir="${build-reports.dir}/reports/xml"/>
<junit haltonfailure="false" fork="yes" forkmode="once" printsummary="withOutAndErr" failureproperty="junit-has-errors" dir="${basedir}" includeantruntime="true">
<classpath refid="project.class.path"/>
<classpath refid="emma.classpath"/>
<classpath>
<pathelement path="${emma.test.dir}/somejar.jar" />
...
</classpath>
<jvmarg value="-Demma.coverage.out.file=${emma.test.dir}/emma-results.ec" />
<batchtest fork="yes" todir="${build-reports.dir}/reports/xml">
<formatter type="xml"/>
<fileset dir="${build.dir}/test">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
</junit>
</target>
My failing results are (I get variations of this with other projects I am testing):
run-unit-tests:
[junit] Running com.mypackage.MyTest
[junit] Tests run: 4, Failures: 0, Errors: 4, Time elapsed: 0.453 sec
[junit] Exception in thread "main" java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.close(Ljava/io/Writer;)V
[junit] at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuite(XMLJUnitResultFormatter.java:174)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite(JUnitTestRunner.java:620)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:453)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:743)
[junit] Running com.servicepower.util.TimerTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Tests FAILED (crashed)
I can resolve this by changing my ANT home to 1.6.5 from MyEclipse 5.5 and it works again, but I’d rather not have to do that!