Having issue with code coverage stats for the server code running on tomcat using jacoco

34 views
Skip to first unread message

Phani K

unread,
May 14, 2018, 9:32:33 AM5/14/18
to JaCoCo and EclEmma Users
Hi,

We are developing server application using Tomcat. We have written bunch of servlets and many integration tests. All my Integration tests does is make calls to server and verify the response. We would like to get the code coverage for the integration tests. 
As part of it we started exploring jacoco.  My server runs on one machine and integration tests run on another machine. I copied jacoco.jar outside tomcat folder and update setenv.sh (CATALINA_OPTS) and started tomcat 
 - javaagent:/home/phani/jacocoagent.jar=destfile=/home/users/adkumar/dascoverage.exec 
Ran my tests. It created .exec file after stopping the tomcat. When I open the report in Eclemma it shown the coverage as 0%. I am not sure what I am missing here. Can someone help me to get the code coverage for my server code?
Thanks.

Regards
Phani

Marc Hoffmann

unread,
May 14, 2018, 11:55:16 AM5/14/18
to jac...@googlegroups.com

Hi Phani,

this question has been asked many times here before, also documentation should give you a starting point.

1) Execution data is written only at a proper shutdown of JaCoCo. Please click on the "Session" link in the HTML classes. Are you classes listed?

2) If the classes are listed but not linked and the corresponding report shows now coverage you need to make sure you use the exact same classes at runtime than at report generation time.

Regards,
-marc

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/c2fc97e5-4779-434a-9c78-71822af73fba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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