Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] @Mixin with classes containing annotated methods

René Scheibe

2010-08-31

Replies: Find Java Web Hosting

Author LoginPost Reply
Does @Mixin work correctly on classes with annotated methods?

I tried to mixin some helpers to my JUnit tests that eg. do some
setup/teardown. But when running the tests the methods annotated eg.
with @Before haven't been run.

import org.junit.*

class SomeHelper {
  @Before
  void mixinSetup() { println "mixin setup" }
}

@Mixin(SomeHelper)
class SomeTest {
  @Before
  void testClassSetup() { println "test class setup" }

  @Test
  void hardTest() { println "hard test" }
}

Regards,
Rene

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.