Hi Marc,
Thanks for your answer. I'll give you a bit more details because I still don't understand how I can get readable results:
The application for which I want to measure the coverage is a server. The classpath of the server contains obfuscated jars. I can clearly see the obfuscated classes by using the -verbose:class JVM option for the server. For example, I can see:
[Loaded lib.system.datactrl.k from file:/data/home/testauto/nxat/data/bamboo/datahub-build-10/datahub-build-10-agent/xml-data/build-dir/DAT-DHBB10454-UN/dist/nxdh-6.3-02-SNAPSHOT/NXDH/Soft/jar/smartsys.jar]
k is the result of obfuscation of a class called DataWriteController. The server is started using -javaagent:org.jacoco.agent-${jacoco.version}-runtime.jar in order to allow instrumentation.
In order to test the server, we run an Ant Junit task embedded into the jacoco coverage task:
<jacoco:coverage destfile="${jacoco.dest.file}" append="true" enabled="${nxdh.coverage.junit}">
<junit printsummary="true" fork="true" forkmode="perTest" dir="${basedir}" showoutput="${show.output}" jvm="${JAVA_HOME}/bin/java">
<classpath refid="test.classpath" />
<jvmarg line="${test.jvmargs}" />
<jvmarg line="${debug.jvmargs}" />
<jvmarg line="${test.args}" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="${test.report.dir}">
<zipfileset src="${test.jar}" includes="testsuites/*TestSuite*.class" excludes="${serial.test.suites}" />
</batchtest>
</junit>
</jacoco:coverage>
The junit task has its own classpath which may contain non-obfuscated jars but I guess it is used for the junit test process only, not for the server under test.
After generating coverage report, I can clearly see coverage on DataWriteController class. This makes me confused because I would expect to see coverage on lib.system.datactrl.k, and not on lib.system.datactrl.DataWriteController.
Does this make sense or do I miss something?
Thanks a lot.
Regards,
Nicolas