]> source.dussan.org Git - aspectj.git/commitdiff
Comparable test programs.
authoraclement <aclement>
Mon, 19 Dec 2005 10:18:16 +0000 (10:18 +0000)
committeraclement <aclement>
Mon, 19 Dec 2005 10:18:16 +0000 (10:18 +0000)
tests/java5/decps/Basic1.java [new file with mode: 0644]
tests/java5/decps/Basic1b.java [new file with mode: 0644]
tests/java5/decps/Basic2.java [new file with mode: 0644]
tests/java5/decps/Basic2b.java [new file with mode: 0644]
tests/java5/decps/Basic3.java [new file with mode: 0644]
tests/java5/decps/Basic3b.java [new file with mode: 0644]

diff --git a/tests/java5/decps/Basic1.java b/tests/java5/decps/Basic1.java
new file mode 100644 (file)
index 0000000..d1fe8ea
--- /dev/null
@@ -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 (file)
index 0000000..bdbadd9
--- /dev/null
@@ -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 (file)
index 0000000..5e14eb5
--- /dev/null
@@ -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 (file)
index 0000000..babd57f
--- /dev/null
@@ -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 (file)
index 0000000..868bbcd
--- /dev/null
@@ -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 (file)
index 0000000..ab8768a
--- /dev/null
@@ -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() {}
+
+}
+