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.

Privileged.java 487B

1234567891011121314151617181920212223242526
  1. import org.aspectj.testing.*;
  2. privileged aspect PrivilegedAspect {
  3. public void OtherClass.foo() {
  4. Tester.event("foo.intro");
  5. }
  6. }
  7. class OtherClass {
  8. }
  9. public class Privileged {
  10. public static void main(String[] args) {
  11. new Privileged().go();
  12. }
  13. static {
  14. Tester.expectEventsInString("foo.intro,foo.done,foo.called");
  15. }
  16. void go() {
  17. Tester.event("foo.called");
  18. new OtherClass().foo();
  19. Tester.event("foo.done");
  20. }
  21. }