I have a class which I need to test eg. MyClass.java
I am using Junit4 so in order to test the protected methods as well in MyClass.java I create a test class MyClassTest.java (which is in a completely different package hence the inability to test the protected method otherwise).
I have written tests for all methods in MyClass and MyClassTest succeeds when run.
When I run the Cobertura test coverage for all classes in the project, this works fine and I get varying coverage from 0-100% according to tests written.
Cobertura reports however that MyClass has 0% coverage as it was not tested - it was infact the subclass that was tested.
Is开发者_开发问答 there any way of making Cobertura pick up the fact that all methods being tested are within the parent class and picking that up as coverage??
Thanks
精彩评论