]> source.dussan.org Git - aspectj.git/commitdiff
AspectJ6: some simple testcode
authoraclement <aclement>
Wed, 16 Jan 2008 23:48:46 +0000 (23:48 +0000)
committeraclement <aclement>
Wed, 16 Jan 2008 23:48:46 +0000 (23:48 +0000)
12 files changed:
tests/bugs160/simplejava/CtorA.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleA.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleB.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleC.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleD.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleE.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleF.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleG.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleH.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleI.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleJ.java [new file with mode: 0644]
tests/bugs160/simplejava/SimpleN.java [new file with mode: 0644]

diff --git a/tests/bugs160/simplejava/CtorA.java b/tests/bugs160/simplejava/CtorA.java
new file mode 100644 (file)
index 0000000..9c0d6cd
--- /dev/null
@@ -0,0 +1,18 @@
+import java.util.*;
+
+public class CtorA {
+  public static void main(String []argv) {
+    List<Integer> intList = new ArrayList<Integer>();
+    Base<Integer> base    = new Base<Integer>(intList);
+  }
+}
+
+class Base<N extends Number> { 
+  public Base() {}
+  <Y extends Number> Base(Set<N> sn, List<Y> ys) {}
+}
+
+aspect X {
+  public Base<Z>.new(List<Z> lz) { this(); } // OK, Z becomes N in parameter
+}
+
diff --git a/tests/bugs160/simplejava/SimpleA.java b/tests/bugs160/simplejava/SimpleA.java
new file mode 100644 (file)
index 0000000..08bf44c
--- /dev/null
@@ -0,0 +1,2 @@
+public class SimpleA {
+}
diff --git a/tests/bugs160/simplejava/SimpleB.java b/tests/bugs160/simplejava/SimpleB.java
new file mode 100644 (file)
index 0000000..9eec107
--- /dev/null
@@ -0,0 +1,4 @@
+public class SimpleB {
+  public static void main(String []argv) { 
+  }
+}
diff --git a/tests/bugs160/simplejava/SimpleC.java b/tests/bugs160/simplejava/SimpleC.java
new file mode 100644 (file)
index 0000000..1622968
--- /dev/null
@@ -0,0 +1,2 @@
+public aspect SimpleC {
+}
diff --git a/tests/bugs160/simplejava/SimpleD.java b/tests/bugs160/simplejava/SimpleD.java
new file mode 100644 (file)
index 0000000..a57f436
--- /dev/null
@@ -0,0 +1,5 @@
+public aspect SimpleD {
+  before(): execution(* foo(..)) {}
+
+  public void foo() {}
+}
diff --git a/tests/bugs160/simplejava/SimpleE.java b/tests/bugs160/simplejava/SimpleE.java
new file mode 100644 (file)
index 0000000..c2fb661
--- /dev/null
@@ -0,0 +1,6 @@
+public aspect SimpleE {
+  public int Test.i;
+}
+
+class Test {
+}
diff --git a/tests/bugs160/simplejava/SimpleF.java b/tests/bugs160/simplejava/SimpleF.java
new file mode 100644 (file)
index 0000000..5bc6e2b
--- /dev/null
@@ -0,0 +1,16 @@
+
+public aspect SimpleF {
+    public static void main(String[] args) { test(); }
+
+    pointcut sendHeader():
+        call(void *.*(String));
+
+/*
+    before(): call(* foo(..)) {
+                aspectField += s;
+    }
+*/
+
+    public static void test() {
+    }
+}
diff --git a/tests/bugs160/simplejava/SimpleG.java b/tests/bugs160/simplejava/SimpleG.java
new file mode 100644 (file)
index 0000000..ea5b95c
--- /dev/null
@@ -0,0 +1,4 @@
+aspect SimpleG pertarget(target(String)) {
+  public int num;
+  public static void main(String[]argv){}
+}
diff --git a/tests/bugs160/simplejava/SimpleH.java b/tests/bugs160/simplejava/SimpleH.java
new file mode 100644 (file)
index 0000000..c8037d5
--- /dev/null
@@ -0,0 +1,16 @@
+import java.util.*;
+
+class Base { 
+
+}
+
+public class SimpleH {
+  public static void main(String[] argv) {
+    List<Double> l1 = new ArrayList<Double>();
+    Base b2 = new Base(l1);
+  }
+}
+
+aspect X {
+  public <P extends Number> Base.new(List<P> lr) { this(); }
+}
diff --git a/tests/bugs160/simplejava/SimpleI.java b/tests/bugs160/simplejava/SimpleI.java
new file mode 100644 (file)
index 0000000..d1fa131
--- /dev/null
@@ -0,0 +1,17 @@
+import java.util.*;
+
+interface I {}
+
+class Sub implements I {}
+
+class Sub2 implements I {
+  public <N extends Number> int publicMethod(List<N> ns) { return 0; }
+}
+
+public aspect SimpleI {
+  public static void main(String []argv) { }
+
+  public <N extends Number> int I.publicMethod(List<N> ns) { return ns.size(); }
+}
+
+
diff --git a/tests/bugs160/simplejava/SimpleJ.java b/tests/bugs160/simplejava/SimpleJ.java
new file mode 100644 (file)
index 0000000..5635aa0
--- /dev/null
@@ -0,0 +1,7 @@
+public class SimpleJ {
+}
+
+class A {
+  public void m() {}
+  public int m2() { return 42;}
+}
diff --git a/tests/bugs160/simplejava/SimpleN.java b/tests/bugs160/simplejava/SimpleN.java
new file mode 100644 (file)
index 0000000..e3ba010
--- /dev/null
@@ -0,0 +1,46 @@
+import org.aspectj.lang.annotation.*;
+
+public class SimpleN {
+  public static void main(String[]argv) {
+   new A().m(1,2,3);
+  }
+}
+
+class A {
+  public void m(int p,int q,int r) {
+    String s= "Hello";
+    if (s.equals("five")) {
+      int i = 5;
+      System.out.println("Je suis ici "+i);
+      i = i + 6;
+      if (i==3) {
+        String p2 = "foo";
+      }
+    } else {
+      int j = 6;
+      System.out.println("Ich bin hier "+j);
+    }
+    System.out.println("Finished "+s);
+  }
+}
+
+aspect X {
+  pointcut complicatedPointcut(): execution(* nonExistent(..)) && if(true==true);
+
+  @SuppressAjWarnings("adviceDidNotMatch")
+  before(): complicatedPointcut() {
+    String s= "Hello";
+    if (s.equals("five")) {
+      int i = 5;
+      System.out.println("Je suis ici "+i);
+      i = i + 6;
+      if (i==3) {
+        String p2 = "foo";
+      }
+    } else {
+      int j = 6;
+      System.out.println("Ich bin hier "+j);
+    }
+    System.out.println("Finished "+s);
+  }
+}