aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/AdviceOnAdvice.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/AdviceOnAdvice.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/new/AdviceOnAdvice.java')
-rw-r--r--tests/new/AdviceOnAdvice.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/new/AdviceOnAdvice.java b/tests/new/AdviceOnAdvice.java
new file mode 100644
index 000000000..174e489e3
--- /dev/null
+++ b/tests/new/AdviceOnAdvice.java
@@ -0,0 +1,42 @@
+
+/*
+ * To test some stuff
+ */
+
+import org.aspectj.testing.*;
+
+public class AdviceOnAdvice {
+ public static void main(String[] args) {
+ new Class1().a();
+ Tester.check(Class1.calledB, "Aspect2 did not get advice");
+ }
+}
+
+class Class1 {
+ public void a() { }
+ public void b() { }
+ public static boolean calledA = false;
+ public static boolean calledB = false;
+}
+
+
+aspect Aspect1 {
+ pointcut a(Class1 c1) :
+ target(c1) && call(public void a());
+
+ void around(Class1 c1) : a(c1) {
+ proceed(c1);
+ c1.b();
+ }
+}
+
+
+aspect Aspect2b {
+
+ pointcut b() :
+ call(public void Class1.b()) && within(Aspect1);
+
+ after () : b() {
+ Class1.calledB = true;
+ }
+}