]> source.dussan.org Git - aspectj.git/commitdiff
263310: testcode, not failing so far
authoraclement <aclement>
Tue, 10 Feb 2009 00:43:41 +0000 (00:43 +0000)
committeraclement <aclement>
Tue, 10 Feb 2009 00:43:41 +0000 (00:43 +0000)
tests/bugs164/pr263310/HandleTestingAspect.java [new file with mode: 0644]

diff --git a/tests/bugs164/pr263310/HandleTestingAspect.java b/tests/bugs164/pr263310/HandleTestingAspect.java
new file mode 100644 (file)
index 0000000..86b37f1
--- /dev/null
@@ -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