aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-09-28 09:49:10 +0000
committeraclement <aclement>2005-09-28 09:49:10 +0000
commitfc51daa12dd7952e3b6a2f486e7d0162323c91b4 (patch)
treea4d4aa5bc9680b9db22625aa52463bf14977c2cd /tests
parentc7e275bbe8e0ee178ce28c5cc2d12bc5338d76a3 (diff)
downloadaspectj-fc51daa12dd7952e3b6a2f486e7d0162323c91b4.tar.gz
aspectj-fc51daa12dd7952e3b6a2f486e7d0162323c91b4.zip
pr110788: testcases
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/pr110788/Case1.java11
-rw-r--r--tests/bugs150/pr110788/Case2.java9
-rw-r--r--tests/bugs150/pr110788/Case3.java11
-rw-r--r--tests/bugs150/pr110788/Case4.java11
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java15
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml19
6 files changed, 69 insertions, 7 deletions
diff --git a/tests/bugs150/pr110788/Case1.java b/tests/bugs150/pr110788/Case1.java
new file mode 100644
index 000000000..f5a55d2df
--- /dev/null
+++ b/tests/bugs150/pr110788/Case1.java
@@ -0,0 +1,11 @@
+interface A<T> {}
+
+interface B<T> extends A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements B<Number>; // Can't do it, C implement A<String>
+}
diff --git a/tests/bugs150/pr110788/Case2.java b/tests/bugs150/pr110788/Case2.java
new file mode 100644
index 000000000..d995509bb
--- /dev/null
+++ b/tests/bugs150/pr110788/Case2.java
@@ -0,0 +1,9 @@
+interface A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements A<Number>; // Can't do it, C implements A<String>
+}
diff --git a/tests/bugs150/pr110788/Case3.java b/tests/bugs150/pr110788/Case3.java
new file mode 100644
index 000000000..726ca11cf
--- /dev/null
+++ b/tests/bugs150/pr110788/Case3.java
@@ -0,0 +1,11 @@
+interface A<T> {}
+
+interface B<T> extends A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements B<String>; // Can do it, parameterizations are compatible
+}
diff --git a/tests/bugs150/pr110788/Case4.java b/tests/bugs150/pr110788/Case4.java
new file mode 100644
index 000000000..726ca11cf
--- /dev/null
+++ b/tests/bugs150/pr110788/Case4.java
@@ -0,0 +1,11 @@
+interface A<T> {}
+
+interface B<T> extends A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements B<String>; // Can do it, parameterizations are compatible
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index af953f953..be876b1d7 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -25,9 +25,6 @@ import org.aspectj.asm.AsmManager;
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.util.LangUtil;
-/**
- * These are tests that will run on Java 1.4 and use the old harness format for test specification.
- */
public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public static Test suite() {
@@ -37,6 +34,11 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
}
+
+ public void testBadDecp_pr110788_1() { runTest("bad generic decp - 1");}
+ public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
+ public void testBadDecp_pr110788_3() { runTest("bad generic decp - 3");}
+ public void testBadDecp_pr110788_4() { runTest("bad generic decp - 4");}
public void test_typeProcessingOrderWhenDeclareParents() {
runTest("Order of types passed to compiler determines weaving behavior");
@@ -172,10 +174,9 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("overriding/polymorphism error on interface method introduction");
}
- /**
- * IfPointcut.findResidueInternal() was modified to make this test complete in a short amount
- * of time - if you see it hanging, someone has messed with the optimization.
- */
+
+ // IfPointcut.findResidueInternal() was modified to make this test complete in a short amount
+ // of time - if you see it hanging, someone has messed with the optimization.
public void testIfEvaluationExplosion_pr94086() {
runTest("Exploding compile time with if() statements in pointcut");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 38f74bea4..cfd5acd18 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -4827,4 +4827,23 @@
<compile files="pr109728.java" options="-1.5"/>
</ajc-test>
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 1">
+ <compile files="Case1.java" options="-1.5">
+ <message kind="error" line="10" text="Cannot declare parent B&lt;java.lang.Number&gt; onto type C since it already has A&lt;java.lang.String&gt; in its hierarchy"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 2">
+ <compile files="Case2.java" options="-1.5">
+ <message kind="error" line="8" text="Cannot declare parent A&lt;java.lang.Number&gt; onto type C since it already has A&lt;java.lang.String&gt; in its hierarchy"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 3">
+ <compile files="Case3.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 4">
+ <compile files="Case4.java" options="-1.5"/>
+ </ajc-test>
</suite> \ No newline at end of file