aboutsummaryrefslogtreecommitdiffstats
path: root/tests/base/test124
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/base/test124
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/base/test124')
-rw-r--r--tests/base/test124/Driver.java29
-rw-r--r--tests/base/test124/Readme.txt6
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/base/test124/Driver.java b/tests/base/test124/Driver.java
new file mode 100644
index 000000000..3c9e058b3
--- /dev/null
+++ b/tests/base/test124/Driver.java
@@ -0,0 +1,29 @@
+import org.aspectj.testing.Tester;
+
+public class Driver {
+ public static void main(String[] args) { test(); }
+
+ public static void test() {
+ Driver.m(4);
+ Tester.checkEqual(Trace.enterCount, 2, "befores");
+ // The after for this method hasn't been run yet
+ Tester.checkEqual(Trace.exitCount, 1, "afters");
+ }
+
+ static int m(int x) {
+ return 0;
+ }
+}
+
+aspect Trace {
+ public static int enterCount, exitCount;
+ // notice the absence of any modifiers in the advise
+ before(): within(Driver) && (execution(void test()) ||
+ execution(* m(..))) {
+ enterCount++;
+ }
+ after(): within(Driver) && (execution(void test()) ||
+ execution(* m(..))) {
+ exitCount++;
+ }
+}
diff --git a/tests/base/test124/Readme.txt b/tests/base/test124/Readme.txt
new file mode 100644
index 000000000..bca6d2360
--- /dev/null
+++ b/tests/base/test124/Readme.txt
@@ -0,0 +1,6 @@
+Mode: VM run
+Title: empty modifier pattern
+
+An advise specifies an empty modifier pattern which functions like a
+wildcard on modifiers.
+