Exclude methods from code coverage with Cobertura

You can exclude classes from instrumentation. Then they should not appear on reports. See exclude statements below. You can also ignore calls to some methods. See ignore statement below. If you are using maven, see maven plugin manual. <configuration> <instrumentation> <ignores> <ignore>com.example.boringcode.*</ignore> </ignores> <excludes> <exclude>com/example/dullcode/**/*.class</exclude> <exclude>com/example/**/*Test.class</exclude> </excludes> </instrumentation> </configuration> And for ant see this. <cobertura-instrument … Read more

Testng, Emma, Cobertura, coverage and JDK 7 result in ClassFormatError and VerifyError

I had same problem using maven cobertura plugin. All tests failed when run from cobertura:report. But all tests succeeded when run directly from surefire plugin. As some of you already said the problem is that coberture byte code instrumentation of is not compatible with JDK7. You can see here http://vikashazrati.wordpress.com/2011/10/09/quicktip-verifyerror-with-jdk-7/ that the exception is related … Read more