diff options
Diffstat (limited to 'tests/new/PR535.java')
-rw-r--r-- | tests/new/PR535.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/new/PR535.java b/tests/new/PR535.java new file mode 100644 index 000000000..9bea781b6 --- /dev/null +++ b/tests/new/PR535.java @@ -0,0 +1,38 @@ + +import org.aspectj.testing.Tester; + +/** @testcase PR#535 */ +public class PR535 { + public static void main(String[] args) { + Tester.expectEvent("In bar()"); + Tester.expectEvent("advice"); + Tester.expectEvent("In foo()"); + new C().foo(); + Tester.checkAllEvents(); + } +} + +class C { + + public void foo() { + Tester.event("In foo()"); + bar(); + } + + public void bar() { + Tester.event("In bar()"); + } +} + +aspect A { + pointcut outside(): !cflow(within(A)); + + void around(C c): + cflow(execution(public void C.foo())) && + target(c) && + execution(public void C.bar()) && + outside() { + Tester.event("advice"); + proceed(c); + } +} |