You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by "Ranganathan, Shobana" <SR...@DIRECTV.com> on 2010/03/31 17:29:14 UTC

getting code coverage using runservertests

Hi,


How can I get code coverage using runservertests if I run my test against a cobertura instrumented class? What I have below does not work. A browser is opened and the test case executes fine but I do not get any coverage.


<runservertests

    testurl="http://localhost:${test.port}/test/ServletRedirector?Cactus_Service=RUN_TEST"

    starttarget="start.tomcat.40"

    stoptarget="stop.tomcat.40"

    testtarget="test"/>


<target name="test">
        <exec executable="${browser}" spawn="true">
          <arg value="${cactus.url}/ServletTestRunner?suite=com.xyz.TestBroadbandMgr"/>
        </exec>
        <antcall target="coveragetest" />

  </target>

      <target name="coveragetest">
            <cobertura-report srcdir="src"
            destdir="${reports.cobertura.dir}"
            datafile="${basedir}/cobertura.ser"/>
            <echo>
                    Cobertura reports have been generated.
                    The HTML report is ${reports.cobertura.dir}/index.html
                </echo>

        </target>




Regards,
Shobana