]> source.dussan.org Git - aspectj.git/commitdiff
more testcode for 169432
authoraclement <aclement>
Thu, 8 Nov 2007 08:58:21 +0000 (08:58 +0000)
committeraclement <aclement>
Thu, 8 Nov 2007 08:58:21 +0000 (08:58 +0000)
tests/bugs154/pr169432/ClassThatAlreadyIncludesRequiredMethods.java [deleted file]
tests/bugs154/pr169432/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java [deleted file]
tests/bugs154/pr169432/NonMarkerInterface.java [deleted file]
tests/bugs154/pr169432/case1/ClassThatAlreadyIncludesRequiredMethods.java [new file with mode: 0644]
tests/bugs154/pr169432/case1/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java [new file with mode: 0644]
tests/bugs154/pr169432/case1/NonMarkerInterface.java [new file with mode: 0644]
tests/bugs154/pr169432/case2/A.java [new file with mode: 0644]
tests/bugs154/pr169432/case3/A.java [new file with mode: 0644]

diff --git a/tests/bugs154/pr169432/ClassThatAlreadyIncludesRequiredMethods.java b/tests/bugs154/pr169432/ClassThatAlreadyIncludesRequiredMethods.java
deleted file mode 100644 (file)
index 1667496..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-package test;
-
-public class ClassThatAlreadyIncludesRequiredMethods {
-        public void something() {
-        }
-}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java b/tests/bugs154/pr169432/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java
deleted file mode 100644 (file)
index 4d63e48..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package test;
-
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.DeclareParents;
-
-@Aspect
-public class
-DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods {
-        @DeclareParents("test.ClassThatAlreadyIncludesRequiredMethods")
-        public NonMarkerInterface nmi;
-}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/NonMarkerInterface.java b/tests/bugs154/pr169432/NonMarkerInterface.java
deleted file mode 100644 (file)
index 753ad61..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package test;
-
-public interface NonMarkerInterface {
-        public void something();
-}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/case1/ClassThatAlreadyIncludesRequiredMethods.java b/tests/bugs154/pr169432/case1/ClassThatAlreadyIncludesRequiredMethods.java
new file mode 100644 (file)
index 0000000..1667496
--- /dev/null
@@ -0,0 +1,6 @@
+package test;
+
+public class ClassThatAlreadyIncludesRequiredMethods {
+        public void something() {
+        }
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/case1/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java b/tests/bugs154/pr169432/case1/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java
new file mode 100644 (file)
index 0000000..4d63e48
--- /dev/null
@@ -0,0 +1,11 @@
+package test;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.DeclareParents;
+
+@Aspect
+public class
+DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods {
+        @DeclareParents("test.ClassThatAlreadyIncludesRequiredMethods")
+        public NonMarkerInterface nmi;
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/case1/NonMarkerInterface.java b/tests/bugs154/pr169432/case1/NonMarkerInterface.java
new file mode 100644 (file)
index 0000000..753ad61
--- /dev/null
@@ -0,0 +1,5 @@
+package test;
+
+public interface NonMarkerInterface {
+        public void something();
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/case2/A.java b/tests/bugs154/pr169432/case2/A.java
new file mode 100644 (file)
index 0000000..b5f533c
--- /dev/null
@@ -0,0 +1,26 @@
+
+// Should error, the types C1 and C2 don't implement the interface and no defaultImpl was supplied
+
+import org.aspectj.lang.annotation.*;
+
+@Aspect class X {
+  @DeclareParents(value="C*")
+  public NonMarkerInterface nmi;
+}
+
+interface NonMarkerInterface {
+  public int m();
+}
+
+class Y implements NonMarkerInterface {
+  public Y() {}
+  public int m() { return 43;}
+}
+
+class C1 {
+
+}
+
+class C2 {
+
+}
diff --git a/tests/bugs154/pr169432/case3/A.java b/tests/bugs154/pr169432/case3/A.java
new file mode 100644 (file)
index 0000000..e5700a3
--- /dev/null
@@ -0,0 +1,36 @@
+
+// Now C1 and C2 implement the interface
+
+import org.aspectj.lang.annotation.*;
+
+public class A {
+  public static void main(String []argv) {
+    C1 c1 = new C1();
+    System.out.println("C1.m() returns "+((NonMarkerInterface)c1).m());   
+    C2 c2 = new C2();
+    System.out.println("C2.m() returns "+((NonMarkerInterface)c2).m());   
+  }
+}
+
+@Aspect class X {
+  @DeclareParents(value="C*")
+  public NonMarkerInterface nmi;
+}
+
+interface NonMarkerInterface {
+  public int m();
+}
+
+class Y implements NonMarkerInterface {
+  public Y() {}
+  public int m() { return 43;}
+}
+
+class C1 {
+  public int m() { return 1;}
+
+}
+
+class C2 {
+  public int m() { return 2;}
+}