diff options
author | aclement <aclement> | 2010-11-27 18:10:01 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-11-27 18:10:01 +0000 |
commit | 06ce7bea9ee83d72d1d55cc81f0a2f0cd87a4618 (patch) | |
tree | cdf8592d761a76485f2e28832449fb2473e9c044 /tests/features1611 | |
parent | edfe7deb9e56272d31c8dadfa15c1907cad5e4da (diff) | |
download | aspectj-06ce7bea9ee83d72d1d55cc81f0a2f0cd87a4618.tar.gz aspectj-06ce7bea9ee83d72d1d55cc81f0a2f0cd87a4618.zip |
bit more testing
Diffstat (limited to 'tests/features1611')
-rw-r--r-- | tests/features1611/declareMinus/Unsupported.java | 14 | ||||
-rw-r--r-- | tests/features1611/declareMinus/WithValues.java | 26 |
2 files changed, 36 insertions, 4 deletions
diff --git a/tests/features1611/declareMinus/Unsupported.java b/tests/features1611/declareMinus/Unsupported.java index 4275b5aec..54d2af101 100644 --- a/tests/features1611/declareMinus/Unsupported.java +++ b/tests/features1611/declareMinus/Unsupported.java @@ -6,6 +6,12 @@ import java.lang.annotation.RetentionPolicy; String foo(); } +@Retention(RetentionPolicy.RUNTIME) +@interface Banno { + String hoo() default "abcde"; +} + + @Anno(foo="anc") aspect X { @@ -13,6 +19,7 @@ aspect X { declare @method: int i(..): -@Anno; declare @type: X: -@Anno; declare @field: int i: -@Anno(foo="abc"); + public static void main(String[] args) throws Exception { if (X.class.getDeclaredField("i").getAnnotation(Anno.class)==null) { @@ -20,5 +27,12 @@ aspect X { } else { System.out.println("failed"); } + if (X.class.getDeclaredField("j").getAnnotation(Banno.class)==null) { + System.out.println("not on j"); + } else { + System.out.println("is on j"); + } } + + int j; }
\ No newline at end of file diff --git a/tests/features1611/declareMinus/WithValues.java b/tests/features1611/declareMinus/WithValues.java index a756c2e23..3084eb890 100644 --- a/tests/features1611/declareMinus/WithValues.java +++ b/tests/features1611/declareMinus/WithValues.java @@ -1,4 +1,4 @@ -import java.lang.annotation.Retention; +import java.lang.annotation.*; import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) @@ -11,12 +11,30 @@ public aspect WithValues { int i; declare @field: int i: -@Anno; + declare @field: int j: @Banno(hoo="abc"); + int j; public static void main(String[] args) throws Exception { if (WithValues.class.getDeclaredField("i").getAnnotation(Anno.class)==null) { - System.out.println("not there"); + System.out.println("i does not have Anno"); } else { - System.out.println("failed"); + System.out.println("i has Anno"); + } + Annotation a = WithValues.class.getDeclaredField("j").getAnnotation(Banno.class); + if (a==null) { + System.out.println("j does not have Banno"); + } else { + System.out.println("j has Banno:"+a); + } + a = WithValues.class.getDeclaredField("j").getAnnotation(Anno.class); + if (a==null) { + System.out.println("j does not have Anno"); + } else { + System.out.println("j has Anno:"+a); } } -}
\ No newline at end of file +} +@Retention(RetentionPolicy.RUNTIME) +@interface Banno { + String hoo(); +} |