Re: Possible to use with Cobertura?

Ryan <[email protected]>
Newsgroups gmane.comp.jakarta.cactus.user
Message-ID <[email protected]>
Bret Kumler <bkumler <at> goldengate.com> writes:

> 
> <!-- Prepare the classes for instrumentation -->
>     <target name="instrument" depends="compile" description="Add
> Cobertura instrumentation">
>         <!-- instrument the application classes, writing the
> instrumented classes into ${instrumented.classes}.-->
> 
>         <cobertura-instrument datafile="${test.dir}/cobertura.ser"
> todir="${instrumented.classes}">
>             <ignore regex="org.apache.log4j.*"/>
> 
>             <fileset dir="${classes.dir}">
>                 <include name="**/*.class"/>
>                 <exclude name="**/*Test.class"/>
>             </fileset>
>         </cobertura-instrument>
>     </target>
> 
> Make sure u put the instrumented classes in the war file.
> 
> Also
> 
> <target name="test" depends="prepare.test" description="Run the tests on
> the defined container">
>         <mkdir dir="${test.results}/cactus"/>
>         <cactus warfile="${test-war.dir}/${app.name}-${app.version}.war"
> fork="yes"
>                 failureproperty="tests.failed" haltonerror="false">
> 
>             <!-- Configure the cactus task for logging -->
>             <cactusproperty server="false"
> 
> propertiesFile="${meta.dir}/${configtype}/test/logging_client.properties
> "/>
>             <cactusproperty server="true"
> 
> propertiesFile="${meta.dir}/${configtype}/test/logging_server.properties
> "/>
> 
>             <!-- Additional jars that will be added to the classpath
> used to start the
>              container (in addition to the container jars themseleves
> which are
>              automatically added by the <cactus> task
>             -->
>             <containerclasspath>
>                 <pathelement path="${test-props.dir}"/>
>             </containerclasspath>
> 
>             <classpath>
>             <pathelement path="${instrumented.classes}"/>
>             <pathelement path="${classes.dir}"/>
>             <pathelement location="${test-lib.dir}/veridata-tests.jar"/>
>             <path refid="test-compile.libs.path"/>
>             </classpath>
> 
>             <containerset>
>             <tomcat4x if="tomcat-dist.dir"
>                   dir="${tomcat-dist.dir}" port="${test.port}"
>                   output="${test.results}/cactus.out"
>                   todir="${test.results}/cactus"
>                   tmpdir="${test.temp.dir}"
>                   jvmArgs="${gg.home}
> -Dnet.sourceforge.cobertura.datafile=${test.dir}/cobertura.ser/≥
>             </containerset>
> 
>             <formatter type="brief" usefile="false"/>
>             <formatter type="xml"/>
> 
>             <batchtest>
>             <fileset dir="${test-classes.dir}">
>                 <include name="**/TestAll*.class"/>
>             </fileset>
>             </batchtest>
> 
>         </cactus>
> 
> <!-- Generate the JUnit reports -->
> 
>         <junitreport todir="${test.results}/cactus">
>             <fileset dir="${test.results}/cactus"
>                  includes="TEST-*.xml"/>
>             <report todir="${test.results}/cactus"
>                 format="frames"/>
>         </junitreport>
> 
>     </target>
> 
> <!-- Generate the cobertura reports -->
>     <target name="coverage" depends= "test" description="HTML coverage
> reports can be found in build/coverage">
> 
>     <mkdir dir="${test.results}/coverage"/>
> 
>     <cobertura-report srcdir="${src.dir}"
> destdir="${test.results}/coverage/"
> datafile="${test.dir}/cobertura.ser"/>
> 
>     <echo>
>         Cobertura reports have been generated.
>         The HTML report is ${test.results}/coverage/index.html
>     </echo>
> 
>     </target>
> 


Couple questions...

1) <!-- Configure the cactus task for logging -->
  <cactusproperty server="false"
    propertiesFile="${meta.dir}/${configtype}/test/logging_client.properties"/>
  <cactusproperty server="true"
    propertiesFile="${meta.dir}/${configtype}/test/logging_server.properties"/>

Are these logging configurations necessary to create Cobertura tset results?
and what is in your meta-dir directory?

2)

Where and how did you put the instumented classes into the war file?


3)
             <containerclasspath>
                 <pathelement path="${test-props.dir}"/>
             </containerclasspath>

What is in your test-props.dir directory?

4)         <classpath>
             ..
             ..
             <pathelement location="${test-lib.dir}/veridata-tests.jar"/>
             ..
          </classpath>

What is your veridata-tests.jar? and what does it contain?

5)<tomcat4x if="tomcat-dist.dir"
                   ..
                   ..
                   ..
                  ..
                   jvmArgs="${gg.home}
 -Dnet.sourceforge.cobertura.datafile=${test.dir}/cobertura.ser/≥
             </containerset>


for the jvmArgs property, what is your ${gg.home} directory and what does 
-Dnet.sourceforge.cobertura.datafile=${test.dir}/cobertura.ser/≥ tell me?


Thanks again for your help with this...much appreciated!

Ryan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.