You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738
  1. import org.aspectj.testing.Tester;
  2. /** @testcase PR#535 */
  3. public class PR535 {
  4. public static void main(String[] args) {
  5. Tester.expectEvent("In bar()");
  6. Tester.expectEvent("advice");
  7. Tester.expectEvent("In foo()");
  8. new C().foo();
  9. Tester.checkAllEvents();
  10. }
  11. }
  12. class C {
  13. public void foo() {
  14. Tester.event("In foo()");
  15. bar();
  16. }
  17. public void bar() {
  18. Tester.event("In bar()");
  19. }
  20. }
  21. aspect A {
  22. pointcut outside(): !cflow(within(A));
  23. void around(C c):
  24. cflow(execution(public void C.foo())) &&
  25. target(c) &&
  26. execution(public void C.bar()) &&
  27. outside() {
  28. Tester.event("advice");
  29. proceed(c);
  30. }
  31. }