The jacoco extension only instrument the classes in your @Deployment, not classes found in the runtime environment where it is deployed, e.g. UserTransaction.
I'm assuming you want to see in your report that UserTransaction.begin was called ?
yeah, it's exactly what we want to see in the coverage report for UserTansaction.begin
I looked into the jacoco-extension codes and found it uses ApplicationArchiveInstrumenter to instrument the classes.
so is it possible to write my own similar ArchiveInstrumenter and register it in arquillian to instrument the jbossxts.jar which we want to collect coverage data ?
Is the jbossxts.jar in your @Deployment ?
If it is, it should work currently if you only add the jar as a ShrinkWrap Archive instead of just a file reference.
No, it is not in @Deployment.
jbossxts.jar is a module of jbossas and it is in <JBOSS_HOME>/modules/org/jboss/xts/main
any idea about this ?
Right, that's what i thought.
To do that we would have to instrument the app servers classloaders, which is something we don't crrently do. Only your defined @Deployment.
In theory you might be able to deploy the jbosstx subsystem as part of your test, but...
OK, I get it.
to instrument the app servers classloaders, I think we could use "-javaagent:jacocoagent.jar=..." and controll the arquillian start with this jvm arguments.
the problem is that the jacoco.exec is output to the server side and the client can not receive this file.
is it too difficult to do these in jacoco-extension ? I'm interest to try it out.