summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-20 07:18:02 +0000
committeraclement <aclement>2006-06-20 07:18:02 +0000
commit8cab27018dc4dc96ad5eba90df86dfe232ecb967 (patch)
treebc72919542706aa580a08bf1693139bc97cf03da /tests
parent32167a810d4b31bfd5056b9db4c15cd4b6f682ee (diff)
downloadaspectj-8cab27018dc4dc96ad5eba90df86dfe232ecb967.tar.gz
aspectj-8cab27018dc4dc96ad5eba90df86dfe232ecb967.zip
testcode for 147701: @DeclareParents
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs152/pr147701/TestBean.java26
-rw-r--r--tests/bugs152/pr147701/TestBean2.java24
-rw-r--r--tests/bugs152/pr147701/TestBean3.java26
3 files changed, 76 insertions, 0 deletions
diff --git a/tests/bugs152/pr147701/TestBean.java b/tests/bugs152/pr147701/TestBean.java
new file mode 100644
index 000000000..e22f092e4
--- /dev/null
+++ b/tests/bugs152/pr147701/TestBean.java
@@ -0,0 +1,26 @@
+// simple version - we go bang if Impl doesnt implement I...
+
+package a.b.c;
+
+import org.aspectj.lang.annotation.*;
+
+interface I { public void m(); }
+
+class Impl implements I {
+ public Impl() {}
+ public void m() {}
+}
+
+@Aspect
+class TestBeanAdvice {
+ @DeclareParents(value="a.b.c.TestBean", defaultImpl=a.b.c.Impl.class)
+ private I implementationInterface;
+}
+
+public class TestBean {
+ public static void main(String []argv) throws Exception {
+ ((I)new TestBean()).m();
+ }
+}
+
+class BeansException extends Exception {}
diff --git a/tests/bugs152/pr147701/TestBean2.java b/tests/bugs152/pr147701/TestBean2.java
new file mode 100644
index 000000000..229de4abf
--- /dev/null
+++ b/tests/bugs152/pr147701/TestBean2.java
@@ -0,0 +1,24 @@
+package a.b.c;
+
+import org.aspectj.lang.annotation.*;
+
+interface I { public void m() throws BeansException; }
+
+class Impl implements I {
+ public Impl() {}
+ public void m() throws BeansException { }
+}
+
+@Aspect
+class TestBeanAdvice {
+ @DeclareParents(value="a.b.c.TestBean2", defaultImpl=a.b.c.Impl.class)
+ private I implementationInterface;
+}
+
+public class TestBean2 {
+ public static void main(String []argv) throws Exception {
+ ((I)new TestBean2()).m();
+ }
+}
+
+class BeansException extends Exception {}
diff --git a/tests/bugs152/pr147701/TestBean3.java b/tests/bugs152/pr147701/TestBean3.java
new file mode 100644
index 000000000..ad5fe1d2b
--- /dev/null
+++ b/tests/bugs152/pr147701/TestBean3.java
@@ -0,0 +1,26 @@
+// simple version - we go bang if Impl doesnt implement I...
+
+package a.b.c;
+
+import org.aspectj.lang.annotation.*;
+
+interface I { public void m(); }
+
+class Impl { // error!!! implements I {
+ public Impl() {}
+ public void m() {}
+}
+
+@Aspect
+class TestBeanAdvice {
+ @DeclareParents(value="a.b.c.TestBean3", defaultImpl=a.b.c.Impl.class)
+ private I implementationInterface;
+}
+
+public class TestBean3 {
+ public static void main(String []argv) throws Exception {
+ ((I)new TestBean3()).m();
+ }
+}
+
+class BeansException extends Exception {}