]> source.dussan.org Git - aspectj.git/commitdiff
testcode for new handle provider (pr141730)
authoraclement <aclement>
Mon, 3 Jul 2006 09:52:39 +0000 (09:52 +0000)
committeraclement <aclement>
Mon, 3 Jul 2006 09:52:39 +0000 (09:52 +0000)
20 files changed:
tests/features153/jdtlikehandleprovider/A1.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A10.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A11.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A12.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A13.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A2.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A3.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A4.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A5.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A6.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A7.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A8.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/A9.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/C.java [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/DeclareWarnings.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/Demo.java [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/E.java [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/HandleProvider.aj [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/Java5Class.java [new file with mode: 0644]
tests/features153/jdtlikehandleprovider/MyAnnotation.java [new file with mode: 0644]

diff --git a/tests/features153/jdtlikehandleprovider/A1.aj b/tests/features153/jdtlikehandleprovider/A1.aj
new file mode 100644 (file)
index 0000000..e65699d
--- /dev/null
@@ -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 (file)
index 0000000..6b9259c
--- /dev/null
@@ -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 (file)
index 0000000..6a15c9e
--- /dev/null
@@ -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 (file)
index 0000000..57518fd
--- /dev/null
@@ -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 (file)
index 0000000..2bd9f2e
--- /dev/null
@@ -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 (file)
index 0000000..b1d577e
--- /dev/null
@@ -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 (file)
index 0000000..f8db0d8
--- /dev/null
@@ -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 (file)
index 0000000..f3084ff
--- /dev/null
@@ -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 (file)
index 0000000..9574079
--- /dev/null
@@ -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 (file)
index 0000000..ff7bb2f
--- /dev/null
@@ -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 (file)
index 0000000..7247aa6
--- /dev/null
@@ -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 (file)
index 0000000..7fd747f
--- /dev/null
@@ -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 (file)
index 0000000..09f8ead
--- /dev/null
@@ -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 (file)
index 0000000..62aef5d
--- /dev/null
@@ -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 (file)
index 0000000..96a1917
--- /dev/null
@@ -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 (file)
index 0000000..1812d06
--- /dev/null
@@ -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 (file)
index 0000000..4218f5f
--- /dev/null
@@ -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 (file)
index 0000000..ec49220
--- /dev/null
@@ -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 (file)
index 0000000..f0dc49e
--- /dev/null
@@ -0,0 +1,24 @@
+package pkg;
+
+import java.util.List;
+
+public class Java5Class {
+
+       public void method2(List l) {
+       }
+       
+       public void genericMethod1(List<String> s) {
+       }
+       
+       public void genericMethod2(List<String> s, MyGenericClass<Integer> m) {
+       }
+       
+       public void genericMethod3(int i, List<String> s) {
+       }
+       
+       public void genericMethod4(MyGenericClass2<String,Integer> m) {}
+}
+
+class MyGenericClass<T> {}
+
+class MyGenericClass2<X,Y> {}
diff --git a/tests/features153/jdtlikehandleprovider/MyAnnotation.java b/tests/features153/jdtlikehandleprovider/MyAnnotation.java
new file mode 100644 (file)
index 0000000..3b759d8
--- /dev/null
@@ -0,0 +1,4 @@
+package pkg;
+
+public @interface MyAnnotation {
+}