-
1. Re: collect code coverage by using jacoco-extension
aslak Jan 6, 2012 2:39 AM (in response to zhfeng)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 ?
-
2. Re: collect code coverage by using jacoco-extension
zhfeng Jan 6, 2012 4:31 AM (in response to aslak)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 ?
Thanks,
Amos
-
3. Re: collect code coverage by using jacoco-extension
aslak Jan 6, 2012 12:02 PM (in response to zhfeng)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.
-
4. Re: collect code coverage by using jacoco-extension
zhfeng Jan 11, 2012 2:34 AM (in response to aslak)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 ?
Thanks,
Amos
-
5. Re: collect code coverage by using jacoco-extension
aslak Jan 11, 2012 6:01 AM (in response to zhfeng)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...
-
6. Re: collect code coverage by using jacoco-extension
zhfeng Jan 11, 2012 9:15 AM (in response to aslak)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.