Hi Ashish,

our FAQ <https://www.jacoco.org/jacoco/trunk/doc/faq.html> contains some 
information about this. Did you already check?

Regards,
-marc

Why does a class show as not covered although it has been executed?

First make sure execution data has been collected. For this select the Sessions 
link on the top right corner of the HTML report and check whether the class in 
question is listed. If it is listed but not linked the class at execution time 
is a different class file. Make sure you're using the exact same class file at 
runtime as for report generation. Note that some tools (e.g. EJB containers, 
mocking frameworks) might modify your class files at runtime. Please see the 
chapter about class ids <https://www.jacoco.org/jacoco/trunk/doc/classids.html> 
for a detailed discussion.




> On 28. May 2024, at 11:31, Ashish Ranjan Sinha <ashishranjan2...@gmail.com> 
> wrote:
> 
> Hi,
> 
> I am using Jacoco 0.8.11 for OpenJDK17. We are using Runtime instrumentation 
> for instrumenting the .class files under the multiple packages. I am 
> attaching the java agent to the JVM and restarting my system. Then running my 
> Junits which is integrated test running separately on Jenkins pipeline. Once 
> the Junits are run, jacoco.exec is flushed with executable data collected 
> during junits. I am generating the report using the Jacoco cli command and 
> storing the report under coverage/index.html.
> 
> However, I observe some of the classes having 0% despite the associated Junit 
> test running against it. When compared with Cobertura coverage report, the 
> jacoco report shows very less coverage for the same set of classes and 
> Junits. 
> 
> 
> Need some guidance as what I am doing wrong here.
> 
> 
> Regards,
> Ashish.
> 
> 
> -- 
> 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+unsubscr...@googlegroups.com 
> <mailto:jacoco+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/c7eb0406-d655-477d-a1c0-41c5ddf8117en%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/c7eb0406-d655-477d-a1c0-41c5ddf8117en%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/0A96274F-D78F-4A8C-ABEC-4B6ED831ECE3%40mountainminds.com.

Reply via email to