aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/decps
diff options
context:
space:
mode:
authoraclement <aclement>2005-12-19 10:18:16 +0000
committeraclement <aclement>2005-12-19 10:18:16 +0000
commitd9f192dcf9f3638046f587953f867fa64a5bef1b (patch)
tree9c60e24fd0f8c303076c761931c787b66a9c7af3 /tests/java5/decps
parentfb949ea6a7563e38b66b1a0bb07c8843983ab7d2 (diff)
downloadaspectj-d9f192dcf9f3638046f587953f867fa64a5bef1b.tar.gz
aspectj-d9f192dcf9f3638046f587953f867fa64a5bef1b.zip
Comparable test programs.
Diffstat (limited to 'tests/java5/decps')
-rw-r--r--tests/java5/decps/Basic1.java18
-rw-r--r--tests/java5/decps/Basic1b.java22
-rw-r--r--tests/java5/decps/Basic2.java27
-rw-r--r--tests/java5/decps/Basic2b.java30
-rw-r--r--tests/java5/decps/Basic3.java33
-rw-r--r--tests/java5/decps/Basic3b.java36
6 files changed, 166 insertions, 0 deletions
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() {}
+
+}
+