From: aclement Date: Mon, 19 Dec 2005 10:18:16 +0000 (+0000) Subject: Comparable test programs. X-Git-Tag: POST_MEMORY_CHANGES~231 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d9f192dcf9f3638046f587953f867fa64a5bef1b;p=aspectj.git Comparable test programs. --- diff --git a/tests/java5/decps/Basic1.java b/tests/java5/decps/Basic1.java new file mode 100644 index 000000000..d1fe8ea9d --- /dev/null +++ b/tests/java5/decps/Basic1.java @@ -0,0 +1,18 @@ +public class Basic1 { + public static void main(String []argv) { + Basic1 b = new Basic1(); + if (!(b instanceof X.I)) throw new RuntimeException("Basic1 should implement I"); + } +} + + + +aspect X { + + interface I { + } + + declare parents: Basic1 implements I; + +} + diff --git a/tests/java5/decps/Basic1b.java b/tests/java5/decps/Basic1b.java new file mode 100644 index 000000000..bdbadd9b7 --- /dev/null +++ b/tests/java5/decps/Basic1b.java @@ -0,0 +1,22 @@ +import org.aspectj.lang.annotation.*; + +public class Basic1b { + public static void main(String []argv) { + Basic1b b = new Basic1b(); + if (!(b instanceof X.I)) throw new RuntimeException("Basic1b should implement I"); + } +} + + + +@Aspect +class X { + + interface I { + } + + @DeclareParents("Basic1bb") + private I someField; + +} + diff --git a/tests/java5/decps/Basic2.java b/tests/java5/decps/Basic2.java new file mode 100644 index 000000000..5e14eb50a --- /dev/null +++ b/tests/java5/decps/Basic2.java @@ -0,0 +1,27 @@ +public class Basic2 { + public static void main(String []argv) { + Basic2 b = new Basic2(); + if (!(b instanceof X.I)) throw new RuntimeException("Basic2 should implement I"); + } +} + + + +aspect X { + + interface I { + } + + public void I.m2() { + + } + + + declare parents: Basic2 implements I; + + + before(): execution(* *(..)) { + } + +} + diff --git a/tests/java5/decps/Basic2b.java b/tests/java5/decps/Basic2b.java new file mode 100644 index 000000000..babd57f52 --- /dev/null +++ b/tests/java5/decps/Basic2b.java @@ -0,0 +1,30 @@ +import org.aspectj.lang.annotation.*; + +public class Basic2b { + public static void main(String []argv) { + Basic2b b = new Basic2b(); + if (!(b instanceof X.I)) throw new RuntimeException("Basic2b should implement I"); + } +} + + + +@Aspect class X { + + interface I { + } + + class IIimpl implements I { + public void m2() { } + } + + + @DeclareParents("Basic2b",defaultimpl="IImpl") + private I simplefield;; + + + @Before("execution(* *(..))") + public void advice1() {} + +} + diff --git a/tests/java5/decps/Basic3.java b/tests/java5/decps/Basic3.java new file mode 100644 index 000000000..868bbcdff --- /dev/null +++ b/tests/java5/decps/Basic3.java @@ -0,0 +1,33 @@ + + +public class Basic3 { + public static void main(String []argv) { + Basic3 b = new Basic3(); + if (!(b instanceof X.I)) throw new RuntimeException("Basic3 should implement I"); + ((X.I)b).m2(); + ((X.I)b).m3(); + ((X.I)b).m2(); + ((X.I)b).m4(); + } +} + + + +aspect X { + + interface I { + } + + public void I.m2() { } + public void I.m3() { } + public void I.m4() { } + + + declare parents: Basic3 implements I; + + + before(): call(* m*(..)) { + } + +} + diff --git a/tests/java5/decps/Basic3b.java b/tests/java5/decps/Basic3b.java new file mode 100644 index 000000000..ab8768ac9 --- /dev/null +++ b/tests/java5/decps/Basic3b.java @@ -0,0 +1,36 @@ +import org.aspectj.lang.annotation.*; + +public class Basic3b { + public static void main(String []argv) { + Basic3b b = new Basic3b(); + if (!(b instanceof X.I)) throw new RuntimeException("Basic3b should implement I"); + ((X.I)b).m2(); + ((X.I)b).m3(); + ((X.I)b).m2(); + ((X.I)b).m4(); + } +} + + + +@Aspect class X { + + interface I { + } + + class IIimpl implements I { + public void m2() { } + public void m3() { } + public void m4() { } + } + + + @DeclareParents("Basic3b",defaultimpl="IImpl") + private I simplefield;; + + + @Before("call(* *(..))") + public void advice1() {} + +} +