diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/base/test131 | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/base/test131')
-rw-r--r-- | tests/base/test131/Driver.java | 44 | ||||
-rw-r--r-- | tests/base/test131/p1/C1.java | 5 | ||||
-rw-r--r-- | tests/base/test131/p1/p2/C2.java | 5 |
3 files changed, 54 insertions, 0 deletions
diff --git a/tests/base/test131/Driver.java b/tests/base/test131/Driver.java new file mode 100644 index 000000000..752224626 --- /dev/null +++ b/tests/base/test131/Driver.java @@ -0,0 +1,44 @@ +// various forms of package name pattern matching work + +import org.aspectj.testing.Tester; + +import p1.C1; +import p1.p2.C2; + +public class Driver { + public static void test() { + Top t = new Top(); + p1.C1 c1 = new p1.C1(); + p1.p2.C2 c2 = new p1.p2.C2(); + + Tester.checkEqual(t.bar(), 11, "top.bar()"); + + Tester.checkEqual(c1.bar(), 1111, "c1.bar()"); + + Tester.checkEqual(c2.bar(), 1011, "c2.bar()"); + } + public static void main(String[] args) { test(); } +} + +class Top { + public int bar() { + return 1; + } +} + +aspect TopAdvice { + int around(): target(*) && call(int *()) { + int result = proceed(); + return result+10; + } + + int around(): target(p1.*) && call(int *()) { + int result = proceed(); + return result+100; + } + + int around(): target(p1..*) && call(int *()) { + int result = proceed(); + return result+1000; + } +} diff --git a/tests/base/test131/p1/C1.java b/tests/base/test131/p1/C1.java new file mode 100644 index 000000000..b7557b5c0 --- /dev/null +++ b/tests/base/test131/p1/C1.java @@ -0,0 +1,5 @@ +package p1; + +public class C1 { + public int bar() { return 1; } +} diff --git a/tests/base/test131/p1/p2/C2.java b/tests/base/test131/p1/p2/C2.java new file mode 100644 index 000000000..e2d6b2fe5 --- /dev/null +++ b/tests/base/test131/p1/p2/C2.java @@ -0,0 +1,5 @@ +package p1.p2; + +public class C2 { + public int bar() { return 1; } +} |