jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Turley <syn...@synath.com>
Subject More coverage issues
Date Thu, 25 Aug 2005 15:08:09 GMT
I took Bret Kumler's suggestion and got Cobertura.  I'm having a bit of 
a problem with it though.  I don't think cobertura is dumping the 
coverage information soon enough after running the cactus tests.  The 
tests run and then Tomcat starts shutting down and then I get the 
following error:

[cactus] INFO: Illegal access: this web application instance has been 
stopped already (the eventual following stack trace is caused by an 
error thrown for debugging purposes as well as to attempt to terminate 
the thread which caused the illegal access, and has no functional impact)

When I get that error, my cobertura.ser file is suddenly empty and the 
report fails with an EOFException.

Anyone have any thoughts on how to fix this?  Apparently the coverage 
information isn't dumped until the JVM exits.  Is there a way to have 
the tests run on a different fork than the container control part of the 

In case anyone cares to see it, here's part of my build.xml:

    <target name="cactus">
        <cactus warfile="${dist.home}/${app.name}.war" fork="yes"
                <path refid="cactus.classpath"/>
                       <fileset dir="${lib.dir}">
                        <include name="struts.jar"/>
            <classpath location="${build.instrumented-classes.dir}"/>
            <classpath location="${build.classes.dir}"/>
            <classpath location="${cactus.test.classes.dir}"/>
            <sysproperty key="net.sourceforge.cobertura.datafile"
            <!--<cactusproperty server="false"
                <cactusproperty server="true"
            <containerset timeout="180000">
                <!-- cactus automatically uses the system temp directory
                     for a temporary tomcat installation.  The directory
                     is as follows: env.TMP/cactus/tomcat5 .  To specify
                     a different temp directory, use the tmpdir 
attribute -->
                      dir="${env.TOMCAT_HOME}" port="8081"
            <formatter type="brief" usefile="false"/>
            <formatter type="xml"/>
            <batchtest todir="${build.reports.dir}">
               <fileset dir="${cactus.test.classes.dir}" 

--David Turley

P.S.  To Bret Kumler, I didn't have any problems with Struts and 
StrutsTestCase when I switched to Cobertura.  I could post more of my 
build.xml if you'd like, but I don't know that it would be much help...

View raw message