This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes Cobertura Zero Reports Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Cobertura Zero Reports" Watch "Cobertura Zero Reports" New topic

Cobertura Zero Reports

Manish Indudhar

Joined: Dec 22, 2008
Posts: 1

I added the cobertura tags in our existing build file, made few changes in the build file and ran it. Well it did generate the reports but with Zero
Percertage Coverage. Can any one help me out with my build file.

<target name="test" depends="junit,junitreport,coverage" description="Runs unit tests and creates a report" />

<!-- Modified for coverage reports -->
<target name="coverage" depends="cover-test, coverage-report-html" description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports."/>

<target name="instrument">
<!--delete file="cobertura.ser"/>
<delete dir="${instrumented.dir}" /-->
<delete file="cobertura.ser"/>

<cobertura-instrument todir="${instrumented.dir}">
<fileset dir="${build.classes}">
<include name="**/*.class" />
<exclude name="**/Test*.class" />

<target name="cover-test" depends="instrument">
<junit printsummary="yes" haltonfailure="off" fork="yes" forkmode="once">
<classpath refid="cobertura.classpath" />
<classpath location="instrumented.dir"/>
<classpath refid="build.classpath" />
<formatter type="xml" />
<batchtest fork="yes" todir="${junit.dir}">
<fileset dir="${src.dir}">
<include name="**/*Test*.java" />

<!--target name="coverage-check">
<cobertura-check branchrate="34" totallinerate="100" />

<target name="coverage-report">
<Generate an XML file containing the coverage data using
the "srcdir" attribute.
<cobertura-report srcdir="${src.dir}" destdir="${coverage.xml.dir}" format="xml" />

<target name="coverage-report-html">
<cobertura-report destdir="${coverage.html.dir}">
<fileset dir="${src.dir}">
<include name="**/*.java"/>

I would appriciate the help.
Don't get me started about those stupid light bulbs.
subject: Cobertura Zero Reports
Similar Threads
java.lang.classnotfoundexception in junit report
Can't get the code coverage output using Cobertura + Testng + Ant
Emma and JUnit
ANT issues - Unable to create JUnit Reports- Please help
Testing using ANT