From: aclement Date: Mon, 3 Jul 2006 09:52:39 +0000 (+0000) Subject: testcode for new handle provider (pr141730) X-Git-Tag: PRE_PIPELINE~85 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8930b0ddd121c0235689469fec3ebe8b86a65c40;p=aspectj.git testcode for new handle provider (pr141730) --- diff --git a/tests/features153/jdtlikehandleprovider/A1.aj b/tests/features153/jdtlikehandleprovider/A1.aj new file mode 100644 index 000000000..e65699d58 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A1.aj @@ -0,0 +1,5 @@ +package pkg; + +aspect A1 { + +} diff --git a/tests/features153/jdtlikehandleprovider/A10.aj b/tests/features153/jdtlikehandleprovider/A10.aj new file mode 100644 index 000000000..6b9259c55 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A10.aj @@ -0,0 +1,22 @@ +package pkg; + +public aspect A10 { + + pointcut p() : call(public void C.m2()); + + before() : p() { + + } + +} + +class C { + + public void m1() { + new C().m2(); + } + + public void m2() { + + } +} diff --git a/tests/features153/jdtlikehandleprovider/A11.aj b/tests/features153/jdtlikehandleprovider/A11.aj new file mode 100644 index 000000000..6a15c9ea3 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A11.aj @@ -0,0 +1,18 @@ +package pkg; + +public aspect A11 { + + declare warning: call(* C.setX(..)): "Illegal call."; + declare warning : execution(* C.setX(..)) : "blah"; +} + +class C { + + public void setX() { + } + + public void method() { + new C().setX(); + } + +} diff --git a/tests/features153/jdtlikehandleprovider/A12.aj b/tests/features153/jdtlikehandleprovider/A12.aj new file mode 100644 index 000000000..57518fd8d --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A12.aj @@ -0,0 +1,24 @@ +package pkg; + +aspect A { + + declare @type : C : @MyAnnotation; + declare @field : int C.someField : @MyAnnotation; + declare @method : public void C.method1() : @MyAnnotation; + declare @constructor : C.new() : @MyAnnotation; + +} + +class C { + + public C() { + } + + int someField = 3; + + public void method1() { + } + +} + +@interface MyAnnotation{} diff --git a/tests/features153/jdtlikehandleprovider/A13.aj b/tests/features153/jdtlikehandleprovider/A13.aj new file mode 100644 index 000000000..2bd9f2e91 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A13.aj @@ -0,0 +1,12 @@ +package pkg; + +aspect A13 { + + public C.new(int i,String s) { + } + +} + +class C { + +} diff --git a/tests/features153/jdtlikehandleprovider/A2.aj b/tests/features153/jdtlikehandleprovider/A2.aj new file mode 100644 index 000000000..b1d577e2d --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A2.aj @@ -0,0 +1,8 @@ +package pkg; + +aspect A2 { + + before() : execution(* *.*(..)) { + } + +} diff --git a/tests/features153/jdtlikehandleprovider/A3.aj b/tests/features153/jdtlikehandleprovider/A3.aj new file mode 100644 index 000000000..f8db0d825 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A3.aj @@ -0,0 +1,15 @@ +package pkg; + +aspect A3 { + + before() : execution(* *.*(..)) { + } + +} + +class C { + + public void method1() { + } + +} diff --git a/tests/features153/jdtlikehandleprovider/A4.aj b/tests/features153/jdtlikehandleprovider/A4.aj new file mode 100644 index 000000000..f3084ff97 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A4.aj @@ -0,0 +1,7 @@ +package pkg; + +aspect A4 { + + pointcut p() : execution(* *.*(..)); + +} diff --git a/tests/features153/jdtlikehandleprovider/A5.aj b/tests/features153/jdtlikehandleprovider/A5.aj new file mode 100644 index 000000000..9574079c0 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A5.aj @@ -0,0 +1,12 @@ +package pkg; + +aspect A5 { + + pointcut p() : execution(* *.*(..)); + + before() : p() { + } + + before() : p() { + } +} diff --git a/tests/features153/jdtlikehandleprovider/A6.aj b/tests/features153/jdtlikehandleprovider/A6.aj new file mode 100644 index 000000000..ff7bb2f58 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A6.aj @@ -0,0 +1,5 @@ +aspect A6 { + + pointcut p(Integer value) : set(Integer memory) && args(value); + +} diff --git a/tests/features153/jdtlikehandleprovider/A7.aj b/tests/features153/jdtlikehandleprovider/A7.aj new file mode 100644 index 000000000..7247aa6ca --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A7.aj @@ -0,0 +1,21 @@ +package pkg; + +public aspect A7 { + + declare parents : C1 implements C2; + + declare parents : C4 extends C5; + +} + +class C1 { +} + +interface C2 { +} + +class C4 { +} + +class C5 { +} diff --git a/tests/features153/jdtlikehandleprovider/A8.aj b/tests/features153/jdtlikehandleprovider/A8.aj new file mode 100644 index 000000000..7fd747f9e --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A8.aj @@ -0,0 +1,10 @@ +package pkg; + +public aspect A8 { + + pointcut p(Integer value) : set(Integer memory) && args(value); + + after(Integer value) returning : p(value) { + } + +} diff --git a/tests/features153/jdtlikehandleprovider/A9.aj b/tests/features153/jdtlikehandleprovider/A9.aj new file mode 100644 index 000000000..09f8eadae --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/A9.aj @@ -0,0 +1,16 @@ +package pkg; + +public aspect A9 { + + public int C.x = 5; + + private void C.method() { + } + + public String C.methodWithArgs(int i) { + return ""; + } +} + +class C { +} diff --git a/tests/features153/jdtlikehandleprovider/C.java b/tests/features153/jdtlikehandleprovider/C.java new file mode 100644 index 000000000..62aef5de5 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/C.java @@ -0,0 +1,15 @@ +package pkg; + +public class C { + + public C() { + } + + public C(String s) { + + } +} + +interface MyInterface { + +} diff --git a/tests/features153/jdtlikehandleprovider/DeclareWarnings.aj b/tests/features153/jdtlikehandleprovider/DeclareWarnings.aj new file mode 100644 index 000000000..96a191728 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/DeclareWarnings.aj @@ -0,0 +1,21 @@ +aspect DeclareWarnings { + + pointcut p() : execution(* C.amethod()); + + declare warning : p() : "warning 1"; + declare warning : p() : "warning 2"; + declare warning : p() : "warning 3"; + declare warning : p() : "warning 4"; + declare warning : p() : "warning 5"; + declare warning : p() : "warning 6"; + declare warning : p() : "warning 7"; + declare warning : p() : "warning 8"; + declare warning : p() : "warning 9"; + declare warning : p() : "warning 10"; + +} + +class C { + + public void amethod() {} +} diff --git a/tests/features153/jdtlikehandleprovider/Demo.java b/tests/features153/jdtlikehandleprovider/Demo.java new file mode 100644 index 000000000..1812d06f8 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/Demo.java @@ -0,0 +1,33 @@ +package tjp; + +import java.io.*; + +public class Demo { + static Demo d; + + static { + } + + { + } + + public static void main(String[] args){ + } + + public void m(int[] args) { + } + + void go(){ + int i = 4; + } + + void foo(int i, Object o){ + } + + String bar (Integer j){ + return ""; + } + + public void m2(String s1, String s2) { + } +} diff --git a/tests/features153/jdtlikehandleprovider/E.java b/tests/features153/jdtlikehandleprovider/E.java new file mode 100644 index 000000000..4218f5ffb --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/E.java @@ -0,0 +1,5 @@ +package pkg; + +public enum E { + A,B; +} diff --git a/tests/features153/jdtlikehandleprovider/HandleProvider.aj b/tests/features153/jdtlikehandleprovider/HandleProvider.aj new file mode 100644 index 000000000..ec492202a --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/HandleProvider.aj @@ -0,0 +1,21 @@ +aspect TwoNamedPointcuts { + + pointcut p1() : execution(* C.method1()); + + pointcut p2() : execution(* C.method2()); + + before() : p1() || p2() { + System.out.println("before..."); + } + +} + +class C { + + public void method1() { + } + + public void method2() { + } + +} diff --git a/tests/features153/jdtlikehandleprovider/Java5Class.java b/tests/features153/jdtlikehandleprovider/Java5Class.java new file mode 100644 index 000000000..f0dc49e12 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/Java5Class.java @@ -0,0 +1,24 @@ +package pkg; + +import java.util.List; + +public class Java5Class { + + public void method2(List l) { + } + + public void genericMethod1(List s) { + } + + public void genericMethod2(List s, MyGenericClass m) { + } + + public void genericMethod3(int i, List s) { + } + + public void genericMethod4(MyGenericClass2 m) {} +} + +class MyGenericClass {} + +class MyGenericClass2 {} diff --git a/tests/features153/jdtlikehandleprovider/MyAnnotation.java b/tests/features153/jdtlikehandleprovider/MyAnnotation.java new file mode 100644 index 000000000..3b759d8ef --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/MyAnnotation.java @@ -0,0 +1,4 @@ +package pkg; + +public @interface MyAnnotation { +}