org.aspectj/tests/new/AspectOfInterface.java
2002-12-16 18:51:06 +00:00

26 lines
550 B
Java

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");
}
}