You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rakesh Arora <ra...@nortel.com> on 2009/04/16 06:18:21 UTC

Problem with using cobertura to calculate unit testcoverage for projects using AspectJ

In our project we are using AspectJ only for unit testing. So we are
using test-compile goal of aspectj-maven-plugin: 
http://mojo.codehaus.org/aspectj-maven-plugin/ 
We also use cobertura maven plugin to calculate the unit test coverage 
http://mojo.codehaus.org/cobertura-maven-plugin/ 
Cobertura is not reporting the test coverage correctly. It doesn't
include the source code files that has been weaved by aspectj compiler
for unit test coverage.
Here is what happens during the build: 
*	Cobertura instruments the java classes in
target/generated-sources/cobertura 
*	aspectj:test-compile weaves the classes from src/main/java and
src/main/test into target/test-classes. 
So Cobertura instrumented files are not seen during the test run. 
Any idea how to fix this? Is there any other way to calculate the unit
test coverage in this scenario? 
Thanks, 
-Rakesh