diff options
author | aclement <aclement> | 2009-03-05 22:52:05 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-03-05 22:52:05 +0000 |
commit | 9a65e1e9ff34300c1388eb81ed4246605e1c8b05 (patch) | |
tree | 16a2954ef19d77db5fc1dd5bb3f68ac7ab89afc1 /tests | |
parent | c4439a7a47124e646b0ef4b355eebb716b18c00e (diff) | |
download | aspectj-9a65e1e9ff34300c1388eb81ed4246605e1c8b05.tar.gz aspectj-9a65e1e9ff34300c1388eb81ed4246605e1c8b05.zip |
declareMixin
Diffstat (limited to 'tests')
-rw-r--r-- | tests/multiIncremental/mixin/base/src/CaseA.java | 27 | ||||
-rw-r--r-- | tests/multiIncremental/mixin/inc1/src/CaseA.java | 27 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/multiIncremental/mixin/base/src/CaseA.java b/tests/multiIncremental/mixin/base/src/CaseA.java new file mode 100644 index 000000000..b82c67618 --- /dev/null +++ b/tests/multiIncremental/mixin/base/src/CaseA.java @@ -0,0 +1,27 @@ +// TESTING: Very basics with a simple static factory method +import org.aspectj.lang.annotation.*; + +public class CaseA { + public static void main(String[]argv) { + CaseA ca = new CaseA(); + ((I)ca).methodOne(); // will only succeed if mixin applied + } +} + +aspect X { + @DeclareMixin("CaseA") + public static I createImplementation() { + System.out.println("Delegate factory invoked"); + return new Implementation(); + } +} + +interface I { + void methodOne(); +} + +class Implementation implements I { + public void methodOne() { + System.out.println("methodOne running"); + } +} diff --git a/tests/multiIncremental/mixin/inc1/src/CaseA.java b/tests/multiIncremental/mixin/inc1/src/CaseA.java new file mode 100644 index 000000000..163ad2c80 --- /dev/null +++ b/tests/multiIncremental/mixin/inc1/src/CaseA.java @@ -0,0 +1,27 @@ +// TESTING: Very basics with a simple static factory method +import org.aspectj.lang.annotation.*; + +public class CaseA { + public static void main(String[]argv) { + CaseA ca = new CaseA(); + ((I)ca).methodOne(); // will only succeed if mixin applied + } +} + +aspect X { + @DeclareMixin("CaseA") + public static I createImplementation() { + System.out.println("Delegate factory invoked"); + return new Implementation(); + } +} + +interface I { + void methodOne(); +} + +class Implementation implements I { + public void methodOne() { + System.out.println("methodOne running"); + } +} |