From: aclement Date: Wed, 16 Jan 2008 23:48:46 +0000 (+0000) Subject: AspectJ6: some simple testcode X-Git-Tag: V1_6_0M1~54 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0fdb4e141a75dd925b2263047c9f9e409ccd023c;p=aspectj.git AspectJ6: some simple testcode --- diff --git a/tests/bugs160/simplejava/CtorA.java b/tests/bugs160/simplejava/CtorA.java new file mode 100644 index 000000000..9c0d6cd8d --- /dev/null +++ b/tests/bugs160/simplejava/CtorA.java @@ -0,0 +1,18 @@ +import java.util.*; + +public class CtorA { + public static void main(String []argv) { + List intList = new ArrayList(); + Base base = new Base(intList); + } +} + +class Base { + public Base() {} + Base(Set sn, List ys) {} +} + +aspect X { + public Base.new(List 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 index 000000000..08bf44cee --- /dev/null +++ b/tests/bugs160/simplejava/SimpleA.java @@ -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 index 000000000..9eec10710 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleB.java @@ -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 index 000000000..1622968f2 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleC.java @@ -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 index 000000000..a57f436c9 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleD.java @@ -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 index 000000000..c2fb6618f --- /dev/null +++ b/tests/bugs160/simplejava/SimpleE.java @@ -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 index 000000000..5bc6e2b59 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleF.java @@ -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 index 000000000..ea5b95ca6 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleG.java @@ -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 index 000000000..c8037d5a8 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleH.java @@ -0,0 +1,16 @@ +import java.util.*; + +class Base { + +} + +public class SimpleH { + public static void main(String[] argv) { + List l1 = new ArrayList(); + Base b2 = new Base(l1); + } +} + +aspect X { + public

Base.new(List

lr) { this(); } +} diff --git a/tests/bugs160/simplejava/SimpleI.java b/tests/bugs160/simplejava/SimpleI.java new file mode 100644 index 000000000..d1fa1316a --- /dev/null +++ b/tests/bugs160/simplejava/SimpleI.java @@ -0,0 +1,17 @@ +import java.util.*; + +interface I {} + +class Sub implements I {} + +class Sub2 implements I { + public int publicMethod(List ns) { return 0; } +} + +public aspect SimpleI { + public static void main(String []argv) { } + + public int I.publicMethod(List ns) { return ns.size(); } +} + + diff --git a/tests/bugs160/simplejava/SimpleJ.java b/tests/bugs160/simplejava/SimpleJ.java new file mode 100644 index 000000000..5635aa0c3 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleJ.java @@ -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 index 000000000..e3ba010f6 --- /dev/null +++ b/tests/bugs160/simplejava/SimpleN.java @@ -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); + } +}