Unable to see the coverage report on class level

468 views
Skip to first unread message

knaga...@cordys.com

unread,
Nov 1, 2012, 8:50:21 AM11/1/12
to jac...@googlegroups.com
I configure jacoco using ant. I am able to get the coverage report(in percentages). But unable to select a method and see the report.

This is my congiguration:

<target name="jacoco-report" depends="junit">
<jacoco:report>
<executiondata>
<file file="${jacoco.data}/merged.exec" />
</executiondata>

<!-- the class files and optional source files ... -->
<structure name="JaCoCo Ant Example">
<classfiles>
<fileset dir="${component.compiled.classes}/com/cordys/bpm/casemanagement">
<!--include name="com/cordys/bpm/casemanagement/*.*" /-->
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${component.src}/com/cordys/bpm/casemanagement">
<!--include name="com/cordys/bpm/casemanagement/*.*" /-->
</fileset>
</sourcefiles>
</structure>

<!-- to produce reports in different formats. -->
<html destdir="${jacoco.data}" />
<!--xml destfile="${jacoco.data}/report.xml" /-->
<!--csv destfile="${jacoco.data}/report.csv" /-->
</jacoco:report>
</target>

knaga...@cordys.com

unread,
Nov 1, 2012, 8:54:51 AM11/1/12
to jac...@googlegroups.com, knaga...@cordys.com

Marc R. Hoffmann

unread,
Nov 2, 2012, 2:23:45 AM11/2/12
to jac...@googlegroups.com
Are you sure that your class files have been compiled with debug
information?

See FAQ http://www.eclemma.org/jacoco/trunk/doc/faq.html


Why does the coverage report not show line coverage figures?

JaCoCo is based on class files analysis. To calculate line coverage
class files must contain line number attributes. For this your code must
be compiled with debug information.


Why does the coverage report coverage report not show highlighted source
code?

Make sure the following prerequisites are fulfilled to get source code
highlighting in JaCoCo coverage reports:

Class files must be compiled with debug information to contain line
numbers.
Source files must be properly supplied at report generation time.
I.e. specified source folders must be the direct parent of the folders
that define the Java packages.



Best regards,
-marc

knaga...@cordys.com

unread,
Nov 2, 2012, 2:55:26 AM11/2/12
to jac...@googlegroups.com
Yes.All java files are compiled with degub info on.

<javac srcdir="${build}" destdir="${build}" debug="on">
<classpath refid="classpath" />
<compilerarg value="-Xlint" />
<compilerarg value="-Xlint:-path" />
</javac>

Marc R. Hoffmann

unread,
Nov 2, 2012, 2:58:10 AM11/2/12
to jac...@googlegroups.com
Does your coverage report show a "Lines" column with counters for lines?
Like this one:

http://www.eclemma.org/jacoco/trunk/coverage/org.jacoco.core/org.jacoco.core.runtime/index.html

knaga...@cordys.com

unread,
Nov 2, 2012, 3:54:40 AM11/2/12
to jac...@googlegroups.com

Marc R. Hoffmann

unread,
Nov 2, 2012, 12:27:16 PM11/2/12
to jac...@googlegroups.com
Ok, I think I found the problem.

Your source fileset must be rooted exactly at the root of your package
hierarchy, so probably:

<fileset dir="${component.src}">
</fileset>

Best regards,
-marc

knaga...@cordys.com

unread,
Nov 4, 2012, 11:03:46 PM11/4/12
to jac...@googlegroups.com
Thanks Marc. Now it is working fine with your solution.

Regards,
Nagarjuna Reddy.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages