ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Vidaver <gvida...@bbn.com>
Subject Empty xml file when test case times out
Date Mon, 09 Dec 2002 23:00:48 GMT
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
gvidaver@bbn.com                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:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message