From 363b3661a41ea8241a3d55aa7e2485e39fad1825 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 10 Feb 2009 00:43:41 +0000 Subject: [PATCH] 263310: testcode, not failing so far --- .../bugs164/pr263310/HandleTestingAspect.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 tests/bugs164/pr263310/HandleTestingAspect.java diff --git a/tests/bugs164/pr263310/HandleTestingAspect.java b/tests/bugs164/pr263310/HandleTestingAspect.java new file mode 100644 index 000000000..86b37f197 --- /dev/null +++ b/tests/bugs164/pr263310/HandleTestingAspect.java @@ -0,0 +1,75 @@ +package p; + +import java.util.ArrayList; + +public aspect HandleTestingAspect { + + static class InnerClass { + int x; + { } + + static aspect InnerInnerAspect { + int x; + static { } // 13 + } + + public void doNothing() {} + } + + before() : call(* *.doNothing()) { + + } + + before(int x, long y) : execution(* *.foo(int,long)) && args(x,y) { + InnerClass u = new InnerClass() { + public void doNothing() { + doNothing(); + } + }; + u.doNothing(); + } + + interface X { } + + + public void doNothing() {} + + // testing ITDs + int X.X = 6; +// int X.itd() { return 1;} +// X.new() { } +// int X.itd(int x) { return 1;} +// X.new(int x) { } + + + declare parents : HandleTestingClass extends InnerClass; + declare parents : HandleTestingClass implements X; + declare soft : Exception : execution(void HandleTestingClass.foo1(int,long)); + declare error : call(void HandleTestingClass.foo1(int,long)) : ""; + declare warning : call(void HandleTestingClass.foo2(int,long)) : ""; + + pointcut ypc(int y) : call(* *.yCall(int)) && args(y); + pointcut zpc(int z) : call(* *.zCall(int)) && args(z); + + // should not have a count + before(int y) : ypc(y) { } + after(int y) : ypc(y) { } + after(int y) throwing(Exception e) : ypc(y) { } + after(int y) returning(int z) : ypc(y) { } + int around(int y) : ypc(y) { return 1; } + + // should have a count + before(int y) : zpc(y) { } + after(int y) : zpc(y) { } + after(int y) throwing(Exception e) : zpc(y) { } + after(int y) returning(int z) : zpc(y) { } + int around(int y) : ypc(y) { return 1; } + + // should have a count of 3 + Object around(int y) : ypc(y) { return null; } + + + after() returning(java.util.List z) : call(* *.zCall(int)) { } +} + +class HandleTestingClass {} \ No newline at end of file -- 2.39.5