aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-10-18 08:23:16 +0000
committeraclement <aclement>2005-10-18 08:23:16 +0000
commit447a7a1842c1be0e31245cb3cfa1e3e82e939711 (patch)
tree62539b50e0f220d1a01fb207143d0d8d66c7495c /tests
parent96e89dadd94df6a1af23537e205944ed7d20e209 (diff)
downloadaspectj-447a7a1842c1be0e31245cb3cfa1e3e82e939711.tar.gz
aspectj-447a7a1842c1be0e31245cb3cfa1e3e82e939711.zip
pr110307: testcode
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/pr110307/Case1.java6
-rw-r--r--tests/bugs150/pr110307/Case7.java59
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java16
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml13
4 files changed, 84 insertions, 10 deletions
diff --git a/tests/bugs150/pr110307/Case1.java b/tests/bugs150/pr110307/Case1.java
index b0b3f8d66..880f8d188 100644
--- a/tests/bugs150/pr110307/Case1.java
+++ b/tests/bugs150/pr110307/Case1.java
@@ -12,13 +12,13 @@ interface AssociationSource<T> {
}
aspect ExtendProduct {
- Link<T> AssociationSource._target = null;
+ Link<Q> AssociationSource<Q>._target = null;
- public Link<T> AssociationSource.getTarget() {
+ public Link<Q> AssociationSource<Q>.getTarget() {
return _target;
}
- public void AssociationSource.setTarget(Link<T> _target) {
+ public void AssociationSource<Q>.setTarget(Link<Q> _target) {
this._target = _target;
}
diff --git a/tests/bugs150/pr110307/Case7.java b/tests/bugs150/pr110307/Case7.java
new file mode 100644
index 000000000..ba8bf5af5
--- /dev/null
+++ b/tests/bugs150/pr110307/Case7.java
@@ -0,0 +1,59 @@
+import java.lang.annotation.*;
+import java.lang.ref.*;
+import java.util.*;
+
+public class Case7 {
+
+ public static void main(String []argv) {
+ String s = "hello";
+ Integer i = 35;
+ List l = new ArrayList();
+ List<String> ls = new ArrayList<String>();
+ List<Number> ln = new ArrayList<Number>();
+ List<List> ll = new ArrayList<List>();
+
+ A a = new A();
+ a.setN(ls,s);
+ String s2 = a.getN(ls);
+ System.err.println("in="+s+" out="+s2);
+
+ B b = new B();
+ b.setN(ln,i);
+ System.err.println("in="+i+" out="+b.getN(ln));
+
+ C c = new C();
+ c.setN(ll,l);
+ List l2 = c.getN(ll);
+ System.err.println("in="+l+" out="+l2);
+
+ }
+
+}
+
+
+interface I<N> {
+ N getN(List<N> ns);
+
+ void setN(List<N> ns,N n);
+}
+
+aspect X {
+ Q I<Q>.value;
+
+ public P I<P>.getN(List<P> ps) {
+ return value;
+ }
+
+ public void I<Q>.setN(List<Q> ns,N n) {
+ this.value = n;
+ }
+
+ declare parents : A implements I<String>;
+ declare parents : B implements I<Number>;
+ declare parents : C implements I<List>;
+}
+
+
+class A { }
+class B { }
+class C { }
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 90375c3ca..3462d7f64 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -49,6 +49,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testCunningDeclareParents_pr92311() { runTest("cunning declare parents");}
public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
*/
+
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");}
@@ -482,12 +483,17 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("parameterized generic methods");
}
-// public void testCantProvideDefaultImplViaITD_pr110307_1() {runTest("Cant provide default implementation via ITD - 1");}
-// public void testCantProvideDefaultImplViaITD_pr110307_2() {runTest("Cant provide default implementation via ITD - 2");}
-// public void testCantProvideDefaultImplViaITD_pr110307_3() {runTest("Cant provide default implementation via ITD - 3");}
+ public void testCantProvideDefaultImplViaITD_pr110307_1() {runTest("Cant provide default implementation via ITD - 1");}
+ public void testCantProvideDefaultImplViaITD_pr110307_2() {runTest("Cant provide default implementation via ITD - 2");}
+ public void testCantProvideDefaultImplViaITD_pr110307_3() {runTest("Cant provide default implementation via ITD - 3");}
public void testCantProvideDefaultImplViaITD_pr110307_4() {runTest("Cant provide default implementation via ITD - 4");}
-// public void testCantProvideDefaultImplViaITD_pr110307_5() {runTest("Cant provide default implementation via ITD - 5");}
-// public void testCantProvideDefaultImplViaITD_pr110307_6() {runTest("Cant provide default implementation via ITD - 6");}
+ public void testCantProvideDefaultImplViaITD_pr110307_5() {runTest("Cant provide default implementation via ITD - 5");}
+
+ // Needs a change in the compiler so that getType() can be overridden in the intertype scope - thats
+ // where we can police whether a type variable has been used without being specified appropriately.
+ //public void testCantProvideDefaultImplViaITD_pr110307_6() {runTest("Cant provide default implementation via ITD - 6");}
+
+ public void testCantProvideDefaultImplViaITD_pr110307_7() {runTest("Cant provide default implementation via ITD - 7");}
public void testCallJoinPointsInAnonymousInnerClasses() {
runTest("call join points in anonymous inner classes");
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 10330c136..169a814b4 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -5062,12 +5062,21 @@
<ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 6">
<compile files="Case6.java" options="-1.5">
- <!--message kind="error" line="8" text="N cannot be resolved to a type"/-->
+ <message kind="error" line="8" text="N cannot be resolved to a type"/>
<!--message kind="error" line="7" text="T cannot be resolved to a type"/-->
</compile>
</ajc-test>
-
+ <ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 7">
+ <compile files="Case7.java" options="-1.5"/>
+ <run class="Case7">
+ <stderr>
+ <line text="in=hello out=hello"/>
+ <line text="in=35 out=35"/>
+ <line text="in=[] out=[]"/>
+ </stderr>
+ </run>
+ </ajc-test>
<!-- generic ITDs -->