From: Rajarshi G. <rg...@in...> - 2008-10-19 19:43:22
|
On Oct 19, 2008, at 3:36 PM, Egon Willighagen wrote: > On Sun, Oct 19, 2008 at 9:28 PM, Rajarshi Guha <rg...@in...> > wrote: >> Is this what you meant? > > No, don't think so :) > > I was wondering about: > > public class A { > > @TestMethod("testMethod") > public void method(); > > } > > public class B extends A { > > public void method(); > > } > > Would CoverageAnnotationTest recognize B.method() to be overwriting > A.method() and pick the TestMethod annotation from A instead? Aah. No - you have to explicitly specify a test method/class name. What you describe above, would be against the original idea of using test method / class annotations, since we want to force that each source method is explicitly annotated. Rather, the current approach saves a little time when implementing the tests - for example, in the descriptor and IO classes, there are some methods that are only defined in the superclass and not over- ridden in the child class - but the coverage test will see them in the child class and complain that they are not annotated/tested. This way, as long as these methods are tested in the super class, the coverage tester is OK ------------------------------------------------------------------- Rajarshi Guha <rg...@in...> GPG Fingerprint: D070 5427 CC5B 7938 929C DD13 66A1 922C 51E7 9E84 ------------------------------------------------------------------- A memorandum is written not to inform the reader, but to protect the writer. -- Dean Acheson |