Hello

I'm using jacoco version 0.8.12.

I'm using a vendor library which calls the code that I want to test.

The vendor library instantiates the class from a package I have registered
in the application as a client package by performing a
Class.forName(myClientPackage + "path.to.Handler") and calling the method
handle(...) from my implementation of vendor interface Handler.

I'd like to know how to gain coverage from such methods called by
reflection.

It works well inside Eclipse. The code called by reflection is highlighted
in green.

I might be missing a special option from jacoco that is disabled by default.

I use gradle to generate the jacoco report:

```lang-groovy
apply plugin: 'jacoco'

jacoco {
  toolVersion = '0.8.12'
}

task javaCodeCoverageReport(type: JacocoReport, dependsOn: test) {
  sourceDirectories = files(['src/main/java'])
  classDirectories = files(['build/classes/main'])
  executionData = files('build/jacoco/test.exec')
  reports {
    xml.enabled = true
    html.enabled = true
  }
}
```

Question originally posted on stackoverflow:
https://stackoverflow.com/q/78463811/8315843

Regards,
Nicolas.

-- 
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/CAEpX__BHSgRySu02Y9esYTHtKenprzboeu6JPBFQPE8WeSr5bQ%40mail.gmail.com.

Reply via email to