aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/AspectOfInterface.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/new/AspectOfInterface.java')
-rw-r--r--tests/new/AspectOfInterface.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/new/AspectOfInterface.java b/tests/new/AspectOfInterface.java
new file mode 100644
index 000000000..82c7ae38e
--- /dev/null
+++ b/tests/new/AspectOfInterface.java
@@ -0,0 +1,25 @@
+import org.aspectj.testing.Tester;
+
+public class AspectOfInterface {
+ public static void main(String[] args) { test(); }
+
+ public static boolean ranAdvice = false;
+ public static void test() {
+ new C().foo();
+ Tester.check(ranAdvice, "advice on interface");
+ }
+}
+
+interface I {
+ public void foo();
+}
+
+class C implements I {
+ public void foo() { } //System.out.println("foo"); }
+}
+
+aspect A /*of eachobject(instanceof(I))*/ {
+ before(): call(* *(..)) {
+ AspectOfInterface.ranAdvice = true; //System.out.println("before");
+ }
+}