diff options
Diffstat (limited to 'tests/base/test132/Driver.java')
-rw-r--r-- | tests/base/test132/Driver.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/base/test132/Driver.java b/tests/base/test132/Driver.java new file mode 100644 index 000000000..5ed0292ca --- /dev/null +++ b/tests/base/test132/Driver.java @@ -0,0 +1,26 @@ +// proper matching of overloaded constructors + +import org.aspectj.testing.Tester; + +public aspect Driver { + public static void main(String[] args) { test(); } + after(/*Foo f,*/ String aspectName) returning(Foo f): + /*target(f) &&*/ call(new(String)) && args(aspectName) { + f.name = aspectName+"-ADVISED"; + } + + public static void test() { + Foo foo = new Foo("NAME"); + Tester.checkEqual(foo.name, "NAME-ADVISED", "new Foo(name)"); + foo = new Foo(); + Tester.checkEqual(foo.name, "NONE", "new Foo()"); + } +} + +class Foo { + public String name = "NONE"; + public Foo() { } + public Foo(String name) { + this.name = name; + } +} |