From: SourceForge.net <no...@so...> - 2008-12-05 15:16:36
|
Feature Requests item #1172106, was opened at 2005-03-28 21:13 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720018&aid=1172106&group_id=130558 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Feature to disable coverage on specific methods/classes Initial Comment: I would like to be able to remove methods or whole classes from coverage consideration. This would be quite useful for declerative methods that are never to be called but present to enforce a contract. For example a private default constructor for a utility class (with static methods only) that makes sure that no objects can be created for the specific type or a no-op implementation of an illegal method that throws an UnsupportedOperationException. Presently, these declerative methods show up as untested in the statistics. I would like to be able to instruct Cobertura that these methods are to be removed (grayed out) from all reports and statistics. One way would be to allow this to be configured in XML or maybe even better by JDK1.5 tiger annotations (the specific annotation used would best be configured so that users can declare an annotation of their own instead of making their source dependable on Cobertura). ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-12-05 15:16 Message: I submitted a patch for this here: http://sourceforge.net/tracker2/?func=detail&aid=2353196&group_id=130558&atid=720017 There are other features included in that patch Bao. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-03-31 09:35 Message: Logged In: NO I'm searching for this feature too. An ant task option will be perfect with getter/setter disable and a regexp matcher. It's not a simple feature but enforce the concept of code coverage : simple beans most not be included in reports and generates wrong statistics and useless "red spots", decreasing usability : you must check class one by one to see if statistics are relevant ... ---------------------------------------------------------------------- Comment By: Stephen Colebourne (scolebourne) Date: 2005-11-28 19:14 Message: Logged In: YES user_id=408725 I agree with this feature request. Getters and setters should not be tested. Ideally I would like to see a regex method matcher, so I can also exclude other methods (eg. *Property methods in our application) Thanks for Cobertura ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-09-05 15:15 Message: Logged In: NO Lines that throw exceptions may also be removed from untested code.I I also agree that private constructors should not appear in the report, at least there shoul be a option to do that. Mickal ---------------------------------------------------------------------- Comment By: Julien Rentrop (julienrentrop) Date: 2005-05-11 11:04 Message: Logged In: YES user_id=1276478 Filtering out classes should already be possible by using a fileset element in the instrument task and exclude the classes which you don't want to analyze. An addition to your comment: A lot of Java methods are just getters and setters. We are not going to write these simple methods. But int he coverage reports the lines of codes of the getters and setters are counted which do decrease the coverage percentage. It would be nice to have the option to remove getters and setters from coverage considiration. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720018&aid=1172106&group_id=130558 |