Here are the parts of my build.xml I think are relevant:

   <target name="instrument" description="Add jcoverage instrumentation">
       <instrument todir="${build.instrumented-classes.dir}">
         <ignore regex="org.apache.log4j.*"/>
         <fileset dir="${build.classes.dir}">
           <include name="**/*.class"/>
         </fileset>
       </instrument>
   </target>
<target name="make-war">
       <war destfile="${dist.home}/pre.war" webxml="${local.web.xml}">
<fileset dir="${web.home}" excludes="WEB-INF/,SESSIONS.ser,**/*.iml" /> <!-- Need to exclude the WEB-INF directory to keep from getting duplicate versions of files in the WAR-->
         <lib dir="${lib.dir}"/>

<webinf dir="${build.dir}" excludes="web.xml,classes/,lib/, coverage/, instrumented-classes/, reports/, test-classes/" /> <classes dir="${build.instrumented-classes.dir}" includes="**/*.class,**/*.properties" />
       </war>
<cactifywar srcfile="${dist.home}/pre.war" destfile="${dist.home}/${app.name}.war"> <classes dir="${build.test-classes.dir}" includes="**/*CactusTest.class"/>
         </cactifywar>
   </target>

   <target name="cactus">
       <cactus warfile="${dist.home}/${app.name}.war" fork="yes"
         failureproperty="tests.failed">
       <classpath location="${build.instrumented-classes.dir}"/>
       <classpath location="${build.classes.dir}"/>
       <classpath location="${build.test-classes.dir}"/>
       <classpath>
           <path refid="cactus.classpath"/>
           <fileset dir="${lib.dir}">
               <!-- needed because some of the tests use StrutsTestCase-->
               <include name="struts.jar"/>
           </fileset>
       </classpath>
<!--<cactusproperty server="false"
               propertiesFile="logging.properties"/>
       <cactusproperty server="true"
               propertiesFile="logging.properties"/>-->
       <containerset timeout="180000">
           <tomcat5x
                 dir="${env.TOMCAT_HOME}" port="8081"
               serverxml="${basedir}/server.xml"
           />
       </containerset>
       <formatter type="brief" usefile="false"/>
       <formatter type="xml"/>
       <batchtest todir="${build.reports.dir}">
<fileset dir="${build.test-classes.dir}" includes="**/*CactusTest.class"/>
       </batchtest>
     </cactus>
   </target>


Here's the process, and it's virtually identical to yours. I initialize some directories, compile my classes, instrument them, make my war with the instrumented classes, launch cactus with that war. That's when I check the jcoverage.ser file in an editor. Most of the time the file exists but is empty, but occasionally it stuff in it and everything is fine and dandy... It's when it's empty that I get an EOFException in the reports phase... I have run the exact same thing twice in a row and the first time everything would work and the next time it doesn't. Do you see anything in there that would cause this kind of behavior?

Quentin Pouplard wrote:

David Turley wrote:
   Has anyone had any success with jcoverage or emma with cactus

We successfuly run jcoverage with cactus, basically our ant script does
the following: - instrument the classes - make a war with instrumented
classes - launch cactus test with this war - collect all the
jcoverage.ser file - merge them and create the report

It works for us. We use tomcat as server and nothing special.

Maybe if you could give us more info, I would be able (or anyone else)
to help more.

Best regards,

Quentin Pouplard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to