summaryrefslogtreecommitdiffstats
path: root/tests/java5/ataspectj/annotationGen/PerTargetAspect.aj
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5/ataspectj/annotationGen/PerTargetAspect.aj')
-rw-r--r--tests/java5/ataspectj/annotationGen/PerTargetAspect.aj21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/java5/ataspectj/annotationGen/PerTargetAspect.aj b/tests/java5/ataspectj/annotationGen/PerTargetAspect.aj
new file mode 100644
index 000000000..c436b8fca
--- /dev/null
+++ b/tests/java5/ataspectj/annotationGen/PerTargetAspect.aj
@@ -0,0 +1,21 @@
+import org.aspectj.lang.annotation.Aspect;
+import java.lang.annotation.*;
+
+public aspect PerTargetAspect pertarget(fooCall()) {
+
+ pointcut fooCall() : call(* Foo.foo(..));
+
+ public static void main(String[] args) {
+ Annotation[] annotations = PerTargetAspect.class.getAnnotations();
+ if (annotations.length != 1) throw new RuntimeException("Should have one annotation");
+ Aspect aspectAnnotation = (Aspect) annotations[0];
+ if (!aspectAnnotation.value().equals("pertarget(fooCall())")) throw new RuntimeException("value should be equal to perclause");
+ }
+
+}
+
+class Foo {
+
+ void foo() {}
+
+} \ No newline at end of file