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/new/ExpandedMethodSigs.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/ExpandedMethodSigs.java')
-rw-r--r-- | tests/new/ExpandedMethodSigs.java | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/new/ExpandedMethodSigs.java b/tests/new/ExpandedMethodSigs.java new file mode 100644 index 000000000..8fc1c57d0 --- /dev/null +++ b/tests/new/ExpandedMethodSigs.java @@ -0,0 +1,59 @@ +import org.aspectj.testing.Tester; + +public class ExpandedMethodSigs { + public static void main(String[] args) { + C0 c0 = new C0(); + c0.mI(); + c0.mI1(); + c0.mI2(); + c0.mC(); + + I1 i1 = new C0(); + i1.mI(); + i1.mI1(); + + C1 c1 = new C1(); + c1.mI(); + c1.mC1(); + } +} + +class C0 implements I1, I2 { + public void mI() { System.out.println("mI"); } + public void mI1() { System.out.println("mI1"); } + public void mI2() { System.out.println("mI2"); } + + public void mC() { System.out.println("mC"); } +} + +class C1 extends C0 { + public void mC() { System.out.println("mC from C1"); } + public void mC1() { System.out.println("mC1"); } +} + +interface I1 { + public void mI(); + public void mI1(); +} + +interface I2 { + public void mI(); + public void mI2(); +} + +aspect A { + static before(I1 i1): calls(void i1.*()) { System.out.println(">I1.* " + i1); } + static before(): calls(void I2.*()) { System.out.println(">I2.*"); } + static before(): calls(void C0.*()) { System.out.println(">C0.*"); } + static before(): calls(void C1.*()) { System.out.println(">C1.*"); } + + static before(): receptions(void I1.*()) { System.out.println("-I1.*"); } + static before(): receptions(void I2.*()) { System.out.println("-I2.*"); } + static before(): receptions(void C0.*()) { System.out.println("-C0.*"); } + + static after() returning(): receptions(I1.new()) { System.out.println("-I1.new"); } + static after() returning(): receptions(C0.new()) { System.out.println("-C0.new"); } + + static after() returning(): calls(C0, I1.new()) { System.out.println(">I1.new"); } + static after() returning(): calls(C0, C0.new()) { System.out.println(">C0.new"); } +} |