ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Vidaver <>
Subject Empty xml file when test case times out
Date Mon, 09 Dec 2002 23:00:48 GMT
         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 :

[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" 
               <pathelement location="${testbuild}" />
               <path refid="junit.classpath" />
               <formatter type="xml" />
               <batchtest fork="yes" 
                 <fileset dir="${testbuild}">
                   <include name="**/*Test.class" />

         <target name="report" depends="test-module, make_reports" 
description="junit reporting">
           <junitreport todir="${build_out}/reports">
             <fileset dir="${build_out}/reports">
               <include name="*.xml"/>
             <report format="frames" todir="${build_out}/report/html"/>

         This seems like a bug - or am I doing something wrong?


Gordon Vidaver

Gordon Vidaver                  BBN Technologies                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:   <>
For additional commands, e-mail: <>

View raw message