Did someone find a good solution to ignore trivial methods?
Using some automated testing like Unitils
is not really an option, since the code-coverage should not go up if only getters/setters are tested!
Using cobertrua-maven-plugin version 2.5.1:
-) ignore for methods does not work <ignore>com.company.*.set*</ignore>
-) did anyone try to include a patch like http://sourceforge.net/tracker/index.php?func=detail&aid=3010530&group_id=130558&atid=720017 into the maven-plugin?
-) anyone uses a different (better?) test-plugin?
A general ignore for every get/set/is* method is also not really a good way, since these patterns can be used in other methods but simle getter/setters. Also it should be easy to guess trivial getters/setters/constructors.
I know about the question: Ignore methods in class. cobertura maven plugin but since it did not get any relevant answers, I thought I give it another shot.
Since Cobertura 2.0 there is a switch to exclude trivial methods:
The cobertura-maven-plugin uses Cobertura 2.x since version 2.6 (see release notes). But i have not yet found a way to pass the switch to the maven plugin configuration.
Although there seems to be some confusion about the state of this feature (see this Jira issue), the flag does seem to work with the following configuration:
The exclusion problem was fixed here:
and it's part of the latest release (2.5.2). It's available since 10 Sept. 2012: