Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cobertura-maven-plugin doesn't bring up the true coverage of classes. #23

Open
syashwanthk opened this issue Aug 25, 2016 · 3 comments
Open

Comments

@syashwanthk
Copy link

syashwanthk commented Aug 25, 2016

The plugin does not show the coverage of the java class for which test cases are written to cover all the flows in the code. Coverage for the same class in Eclipse EclEmma is shown as 90% where as it is shown as 1% in cobertura index.html generated using the plugin. Code coverage is not shown for integration tests also.

@mohanaraosv
Copy link

@syashwanthk Please add sample test case and environment details for the same.

@syashwanthk
Copy link
Author

I cannot provide the sample data but further analysis from my side is that when I used cobertura-maven-plugin 2.2 I found that the coverage is brought up only for test cases using PowerMock api and others remain at 0% and when I use version 2.7 the issue is vice versa i.e, test cases with PowerMock go to 0% and others go to the extent they are covered.

@syashwanthk
Copy link
Author

Example for above is :
TestSample1.java covers Sample1.java using PowerMock and EclEmma shows 90% coverage.
TestSample2.java covers Sample2.java without using PowerMock and EclEmma shows 80% coverage.

When I use the cobertura-maven-plugin 2.2 I see Sample1.java covered to 90% and Sample2.java covered to 0% when I build the project.
When I use the cobertura-maven-plugin 2.7 I see Sample1.java covered to 0% and Sample2.java covered to 80% when I build the project.
Please help on the above.
I am running the plugin in local machine only through automated maven build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants