Not getting Jacoco Report, even after test cases run fine

356 views
Skip to first unread message

Bangar Milind

unread,
Mar 12, 2014, 12:37:56 PM3/12/14
to jac...@googlegroups.com
Hello,

I am having strange issue with Jacoco (0.6.5.*).

My current environment is :

JDK : 1.6
Eclipse : Juno

Its a Maven project, which uses Aspects (part of separate JAR) file used as dependency within parent POM.

Attaching the output which I am getting after running the coverage.

There are only 3 Unit Tests against which I am running Jacoco, but not sure where the problem is.

Is it something to do with use of AspectJ??? 

The test cases run absolutle fine, with jacoco.exec getting generated, except that it does not have coverage data in it.... Would be clear from the attachments.

Any help please!!!!

Milind

 
Jacoco Report.pptx
pom.xml

Bangar Milind

unread,
Mar 12, 2014, 4:28:25 PM3/12/14
to jac...@googlegroups.com
I read in forum that reports are normally not generated if classes under coverage are not the same the ones at runtime. How do we ensure the same.

In my POM, class files in question are same. Is there a way to find out the classes generated (I tried classdumpDir, but not getting any classes created). through instrumentation etc.

Marc R. Hoffmann

unread,
Mar 12, 2014, 5:27:21 PM3/12/14
to jac...@googlegroups.com
Hi,

if you use AspectJ with runtime weaving this will modify the classes
seen by the JaCoCo agent and will not allow to create proper reports.

There are some options to overcome this limitation:

1) Make sure the JaCoCo agent is the first agent on the command line if
you use multiple agents.
2) Don't use load-time weaving, use compile-time weaving instead.
3) Use JaCoCo offline instrumentation (not recommended)

Best regards,
-marc

Bangar Milind

unread,
Mar 13, 2014, 3:22:00 AM3/13/14
to jac...@googlegroups.com
Hi Marc,

Thanks for the response. The Aspects are in a separate JAR, wherein we do not have control.

Milind


On Wednesday, 12 March 2014 16:37:56 UTC, Bangar Milind wrote:

Bangar Milind

unread,
Mar 13, 2014, 5:45:59 AM3/13/14
to jac...@googlegroups.com
A silly  question.. 

Jacoco has components like report/core/build/agent and we always configure agent to run for code coverage, which is fine. But for reports there is a separate JAR within org.jacoco.report folder. So, is it like this is also triggered based on goal mentioned in POM?

Milind

Bangar Milind

unread,
Mar 13, 2014, 5:48:23 AM3/13/14
to jac...@googlegroups.com

Henrik Horneber

unread,
Mar 13, 2014, 6:12:45 AM3/13/14
to jac...@googlegroups.com
It should not make a difference whether  your aspects are in a different jar or not.

The point Marc is making: when do those aspects get woven into your classes?

During compile time or during runtime (load time).

For use with jacoco you should use compile time. Make sure they get woven only once, and not one time for testing/coverage generation, and one time for report generation.


--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"I find many of the machines of violence very attractive. Tanks, airplanes, warships, especially aircraft carriers."
- 14th Dalai Lama

Bangar Milind

unread,
Mar 13, 2014, 9:43:55 AM3/13/14
to jac...@googlegroups.com
Hi, thanks for the help.

This time as suggested, classes were compiled and then Jacoco was run through command line.

I am getting the following message "Analyzed bundle 'gw-location-stub' with 0 classes".

What does it signify?

Thanks
Milind

Milind Bangar

unread,
Mar 13, 2014, 6:11:43 PM3/13/14
to jac...@googlegroups.com


--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/Hr4ydy1YX50/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.

Bangar Milind

unread,
Mar 17, 2014, 5:32:44 AM3/17/14
to jac...@googlegroups.com

Henrik Horneber

unread,
Mar 17, 2014, 6:15:58 AM3/17/14
to jac...@googlegroups.com
Hi,

Out of curiosity, what did you change to make it work? Did you switch on compile-time weaving or was more work necessary?

regards,
Henrik

Milind Bangar

unread,
Mar 23, 2014, 7:19:15 AM3/23/14
to jac...@googlegroups.com
Hi Marc,

Sorry for late reply . Yes, by changing aspects to compile time weaving did the trick.

Regards
Milind

Sent from my iPad
> --
> You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/Hr4ydy1YX50/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages