diff options
Diffstat (limited to 'tests/java5/annotations/binding/complexExample')
5 files changed, 54 insertions, 0 deletions
diff --git a/tests/java5/annotations/binding/complexExample/A.java b/tests/java5/annotations/binding/complexExample/A.java new file mode 100644 index 000000000..92ffd35af --- /dev/null +++ b/tests/java5/annotations/binding/complexExample/A.java @@ -0,0 +1,16 @@ +package a.b.c; +import g.h.i.B; + +import d.e.f.*; + +public class A { + public static void main(String []argv) { + new A().a(); + new B().b(); + } + + @Color("blue") + public void a() { + System.err.println("a.b.c.A.a() running"); + } +} diff --git a/tests/java5/annotations/binding/complexExample/B.java b/tests/java5/annotations/binding/complexExample/B.java new file mode 100644 index 000000000..6bb11cbf2 --- /dev/null +++ b/tests/java5/annotations/binding/complexExample/B.java @@ -0,0 +1,8 @@ +package g.h.i; + +import d.e.f.*; + +public class B { + + @Color("red") public void b() { System.err.println("g.h.i.B.b running");} +} diff --git a/tests/java5/annotations/binding/complexExample/Color.java b/tests/java5/annotations/binding/complexExample/Color.java new file mode 100644 index 000000000..e0fca4e35 --- /dev/null +++ b/tests/java5/annotations/binding/complexExample/Color.java @@ -0,0 +1,3 @@ +package d.e.f; +import java.lang.annotation.*; +@Retention(RetentionPolicy.RUNTIME) public @interface Color {String value();} diff --git a/tests/java5/annotations/binding/complexExample/X.java b/tests/java5/annotations/binding/complexExample/X.java new file mode 100644 index 000000000..b442e3a99 --- /dev/null +++ b/tests/java5/annotations/binding/complexExample/X.java @@ -0,0 +1,13 @@ +// Color should be resolved via the import statement... +import d.e.f.Color; + +public aspect X { + + before(): call(* *(..)) && @annotation(@Color) { + System.err.println("Before call to "+thisJoinPoint); + } + + before(): execution(* *(..)) && @annotation(@Color) { + System.err.println("Before execution of "+thisJoinPoint); + } +} diff --git a/tests/java5/annotations/binding/complexExample/X2.java b/tests/java5/annotations/binding/complexExample/X2.java new file mode 100644 index 000000000..717f80108 --- /dev/null +++ b/tests/java5/annotations/binding/complexExample/X2.java @@ -0,0 +1,14 @@ +// Same as X but includes annotation binding +import d.e.f.Color; + +public aspect X2 { + + before(Color c): call(* *(..)) && @annotation(c) { + System.err.println("Before call to "+thisJoinPoint+" color is "+c); + } + + before(Color c): execution(* *(..)) && @annotation(c) { + System.err.println("Before execution of "+thisJoinPoint+" color is "+c); + } + +} |