diff options
author | aclement <aclement> | 2007-12-03 14:52:58 +0000 |
---|---|---|
committer | aclement <aclement> | 2007-12-03 14:52:58 +0000 |
commit | 42b962499e9a151825fdcd94e09d487203132e91 (patch) | |
tree | 67bdfaedb7d7328864a5791fa145b3ef9f78c83a | |
parent | 13bf61e0f480da3b0effdbaa84768d353611c147 (diff) | |
download | aspectj-42b962499e9a151825fdcd94e09d487203132e91.tar.gz aspectj-42b962499e9a151825fdcd94e09d487203132e91.zip |
211052 - testcode
-rw-r--r-- | tests/bugs154/pr211052/DistantResource.java | 12 | ||||
-rw-r--r-- | tests/bugs154/pr211052/MyPojo.java | 35 | ||||
-rw-r--r-- | tests/bugs154/pr211052/SimpleAnnotation.java | 8 | ||||
-rw-r--r-- | tests/bugs154/pr211052/SimpleAnnotation2.java | 8 | ||||
-rw-r--r-- | tests/bugs154/pr211052/SimpleAspect1.java | 6 | ||||
-rw-r--r-- | tests/bugs154/pr211052/SimpleAspect2.java | 8 | ||||
-rw-r--r-- | tests/bugs154/pr211052/SimpleAspect3.java | 6 | ||||
-rw-r--r-- | tests/bugs154/pr211052/SimpleAspect4.java | 9 |
8 files changed, 92 insertions, 0 deletions
diff --git a/tests/bugs154/pr211052/DistantResource.java b/tests/bugs154/pr211052/DistantResource.java new file mode 100644 index 000000000..09b39a3a7 --- /dev/null +++ b/tests/bugs154/pr211052/DistantResource.java @@ -0,0 +1,12 @@ +package c.d; + +import java.lang.annotation.*; + +public class DistantResource { + public static void main(String []argv) { + Annotation [] annos = DistantResource.class.getAnnotations(); + for (int i=0;annos!=null && i<annos.length;i++) { + System.out.println("Annotation is "+annos[i]); + } + } +} diff --git a/tests/bugs154/pr211052/MyPojo.java b/tests/bugs154/pr211052/MyPojo.java new file mode 100644 index 000000000..b916d2ebc --- /dev/null +++ b/tests/bugs154/pr211052/MyPojo.java @@ -0,0 +1,35 @@ + + +aspect ConfigureTracing { + declare @type : MyPojo : @Tracing(level = LoggingLevel.WARN); +// declare @method : * MyPojo.calculate() : @TestAnnotation; +} + +@interface Tracing { LoggingLevel level(); } + +@interface TestAnnotation {} + +class Level { + Level(int i) {} + public final static Level INFO = new Level(1); + public final static Level WARN = new Level(2); + public final static Level ERROR = new Level(3); +} +//@Tracing(level = LoggingLevel.WARN) +enum LoggingLevel { + INFO(Level.INFO), + WARN(Level.WARN), + ERROR(Level.ERROR); + + private final Level level; + private LoggingLevel(Level level) {this.level = level;} + public Level getLevel() {return level;} +} + +public class MyPojo { + public static void calculate() { + } + public static void main(String []argv) { + + } +} diff --git a/tests/bugs154/pr211052/SimpleAnnotation.java b/tests/bugs154/pr211052/SimpleAnnotation.java new file mode 100644 index 000000000..5877ab342 --- /dev/null +++ b/tests/bugs154/pr211052/SimpleAnnotation.java @@ -0,0 +1,8 @@ +package a.b; +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface SimpleAnnotation { + String classname(); +} + diff --git a/tests/bugs154/pr211052/SimpleAnnotation2.java b/tests/bugs154/pr211052/SimpleAnnotation2.java new file mode 100644 index 000000000..98781e7c6 --- /dev/null +++ b/tests/bugs154/pr211052/SimpleAnnotation2.java @@ -0,0 +1,8 @@ +package e.f; +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface SimpleAnnotation2 { + String classname(); +} + diff --git a/tests/bugs154/pr211052/SimpleAspect1.java b/tests/bugs154/pr211052/SimpleAspect1.java new file mode 100644 index 000000000..eae2e4002 --- /dev/null +++ b/tests/bugs154/pr211052/SimpleAspect1.java @@ -0,0 +1,6 @@ +package a.b; + +// explicitly reference target type in another package +aspect SimpleAspect1 { + declare @type: c.d.DistantResource: @SimpleAnnotation(classname="oranges"); +} diff --git a/tests/bugs154/pr211052/SimpleAspect2.java b/tests/bugs154/pr211052/SimpleAspect2.java new file mode 100644 index 000000000..f3438d589 --- /dev/null +++ b/tests/bugs154/pr211052/SimpleAspect2.java @@ -0,0 +1,8 @@ +package a.b; + +import c.d.DistantResource; + +// import target type +aspect SimpleAspect1 { + declare @type: DistantResource: @SimpleAnnotation(classname="oranges"); +} diff --git a/tests/bugs154/pr211052/SimpleAspect3.java b/tests/bugs154/pr211052/SimpleAspect3.java new file mode 100644 index 000000000..e0859086f --- /dev/null +++ b/tests/bugs154/pr211052/SimpleAspect3.java @@ -0,0 +1,6 @@ +package a.b; + +// fully qualified reference to annotation type +aspect SimpleAspect3 { + declare @type: c.d.DistantResource: @e.f.SimpleAnnotation2(classname="oranges"); +} diff --git a/tests/bugs154/pr211052/SimpleAspect4.java b/tests/bugs154/pr211052/SimpleAspect4.java new file mode 100644 index 000000000..a8812e011 --- /dev/null +++ b/tests/bugs154/pr211052/SimpleAspect4.java @@ -0,0 +1,9 @@ +package a.b; + +import c.d.DistantResource; +import e.f.SimpleAnnotation2; + +// import the annotation type +aspect SimpleAspect4 { + declare @type: DistantResource: @SimpleAnnotation2(classname="oranges"); +} |