Hi Martin, WebTest doesn't call groovyc but directly calls parseClass on a GroovyClassLoader (see in webtest.xml). Maybe is it the reason?
Cheers, Marc. -- Web: http://www.efficient-webtesting.com Blog: http://mguillem.wordpress.com Flower, Martin wrote: > We use a custom marker annotation @TestId ("1234") to mark methods in > our test classes - the id refers to the test condition id as produced by > the test team. > > My task to is report on the test coverage using the TestId. > > I can access the TestId in Java test classes using apt (.java files) or > asm (.class files). > > I cannot access the TestId in the .groovy files that are part of our > Canoo webtests. Apt ignores .groovy files, and asm cannot find the > annotation because it is not in the .class file. I originally accused > groovyc of not preserving the annotation (on the groovy email list), but > I was wrong, as I copied one of our .java tests to .groovy, and the > .class file generated from the .groovy does contain the annotation. I > therefore conclude that the problem is webtest-specific. > > Is there some setting somewhere to have the annotation preserved in the > .class file ? > > Thanks > > Martin > > > > Code snippets : > > > TestId.java > > @Retention(RetentionPolicy.RUNTIME) > @Target(ElementType.METHOD) > public @interface TestId { > String[] value(); > } > > > > ExampleTest.groovy > > public class ExampleTest extends TC002WebtestBase { // extends > WebtestCase > @TestId (["TC/0002/99/001"]) > void test() { > webtest("TC/0002/99/001 Example test") { > [...] > > Please help Logica to respect the environment by not printing this email / > Merci d'aider Logica à préserver l'environnement en évitant d'imprimer ce > mail / Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica > dabei die Umwelt zu schuetzen / Por favor ajude a Logica a respeitar o > ambiente não imprimindo este correio electrónico. > > > > This e-mail and any attachment is for authorised use by the intended > recipient(s) only. It may contain proprietary material, confidential > information and/or be subject to legal privilege. It should not be copied, > disclosed to, retained or used by, any other party. If you are not an > intended recipient then please promptly delete this e-mail and any attachment > and all copies and inform the sender. Thank you. > > > _______________________________________________ > WebTest mailing list > WebTest@lists.canoo.com > http://lists.canoo.com/mailman/listinfo/webtest > _______________________________________________ WebTest mailing list WebTest@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest