Hi,
Using ant 1.5.1 and JUnit 3.8.1 I'm trying to use the timeout
feature of the junit target with the junitreport target. If I actually
have a test case that times out, the junit target produces an empty xml
file as a result, which leads to the following error with JUnitReport :
report:
[junitreport] [Fatal Error] :-1:-1: Premature end of file.
[junitreport] The file
D:\build\ds\build_out\reports\TEST-test.FortyCharTest.xml is not a valid XML
document. It is possibly corrupted.
[junitreport] the file D:\build\ds\build_out\reports\TESTS-TestSuites.xml
is not a valid testsuite X
ML document
[junitreport] Using Xalan version: Xalan Java 2.2.D11
[junitreport] Transform time: 951ms
If you look at TEST-test.FortyCharTest.xml, it's empty. (FortyCharTest is
a test case with a static suite () method.)
The ant build targets are :
<target name="test-module" depends="compile-tests"
if="junit.present" description="Run JUnit tests">
<junit fork="yes" dir="" timeout="10000" showoutput="true"
printsummary="yes">
<classpath>
<pathelement location="${testbuild}" />
<path refid="junit.classpath" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes"
todir="${build_out}/reports">
<fileset dir="${testbuild}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="report" depends="test-module, make_reports"
description="junit reporting">
<junitreport todir="${build_out}/reports">
<fileset dir="${build_out}/reports">
<include name="*.xml"/>
</fileset>
<report format="frames" todir="${build_out}/report/html"/>
</junitreport>
</target>
This seems like a bug - or am I doing something wrong?
Thanks,
Gordon Vidaver
Gordon Vidaver BBN Technologies
[EMAIL PROTECTED] Office 6/303
617 873-3558 10 Moulton St.
617 873-2616 (fax) Cambridge, MA 02138
866-322-9311 (toll free)
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
- Re: Empty xml file when test case times out Gordon Vidaver
- Re: Empty xml file when test case times out Stefan Bodewig