diff options
author | avasseur <avasseur> | 2005-10-17 14:14:28 +0000 |
---|---|---|
committer | avasseur <avasseur> | 2005-10-17 14:14:28 +0000 |
commit | 891821ce61818e6aebd82ab3cc59f6ee094e3b2a (patch) | |
tree | 2af0f077fb38ef55413bb93119b3bdca7334f162 /tests/java5 | |
parent | 65c2eca9149bcdccfa09cf078b364d750b109933 (diff) | |
download | aspectj-891821ce61818e6aebd82ab3cc59f6ee094e3b2a.tar.gz aspectj-891821ce61818e6aebd82ab3cc59f6ee094e3b2a.zip |
due fix for @AJ ITD annotation copy from ITD intf methods
Diffstat (limited to 'tests/java5')
-rw-r--r-- | tests/java5/ataspectj/ataspectj/DeclareParentsImplementsTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/java5/ataspectj/ataspectj/DeclareParentsImplementsTest.java b/tests/java5/ataspectj/ataspectj/DeclareParentsImplementsTest.java index aee12280e..8b701a28e 100644 --- a/tests/java5/ataspectj/ataspectj/DeclareParentsImplementsTest.java +++ b/tests/java5/ataspectj/ataspectj/DeclareParentsImplementsTest.java @@ -17,6 +17,11 @@ import org.aspectj.lang.annotation.DeclareParents; import org.aspectj.lang.annotation.Before; import java.util.Arrays; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.annotation.ElementType; +import java.lang.reflect.Method; /** * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> @@ -31,6 +36,7 @@ public class DeclareParentsImplementsTest extends TestCase { static interface Introduced { final static int field1 = 1; + @Some void intro(); } @@ -72,6 +78,11 @@ public class DeclareParentsImplementsTest extends TestCase { assertEquals("aop intro-1 ", s_log.toString()); } + public void testAddedMethodKeepAnnotation() throws Throwable { + Method m = Target.class.getDeclaredMethod("intro"); + assertTrue("annotation not retained", m.isAnnotationPresent(Some.class)); + } + public static void main(String[] args) { TestHelper.runAndThrowOnFailure(suite()); } @@ -79,4 +90,8 @@ public class DeclareParentsImplementsTest extends TestCase { public static junit.framework.Test suite() { return new junit.framework.TestSuite(DeclareParentsImplementsTest.class); } + + @Retention(RetentionPolicy.RUNTIME) + static @interface Some { + } } |