From 1abe388fddf09811e19dbb1405ed8d81c0cec694 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 22 Aug 2005 17:00:01 +0000 Subject: genericitds: tests moved around and activated in GenericsTests --- tests/java5/generics/binaryweaving/A1.aj | 5 + tests/java5/generics/binaryweaving/C1.aj | 1 + .../generics/genericaspects/GenericAspectT.aj | 4 +- .../generics/genericaspects/GenericAspectU.aj | 29 +- .../genericaspects/ParentChildRelationship.aj | 121 +++++---- tests/java5/generics/itds/Parse5.java | 12 +- tests/java5/generics/itds/binaryweaving/A1.aj | 2 +- tests/java5/generics/itds/binaryweaving/A2.aj | 3 +- tests/java5/generics/itds/binaryweaving/A3.aj | 4 +- .../generics/itds/binaryweaving/BaseClass.java | 3 + .../generics/itds/binaryweaving/TestA_aspect.aj | 6 + .../generics/itds/binaryweaving/TestA_class.java | 10 + .../itds/binaryweaving/TestA_generictype.java | 4 + .../java5/generics/itds/sharing/GenericAspectA.aj | 19 -- .../java5/generics/itds/sharing/GenericAspectB.aj | 19 -- .../java5/generics/itds/sharing/GenericAspectC.aj | 24 -- .../java5/generics/itds/sharing/GenericAspectD.aj | 24 -- .../java5/generics/itds/sharing/GenericAspectE.aj | 18 -- tests/java5/generics/itds/sharing/MethodA4.aj | 2 + tests/java5/generics/itds/sharing/MethodQ.aj | 2 +- .../aspectj/systemtest/ajc150/GenericsTests.java | 107 ++++++-- tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 292 ++++++++++++++++++++- 22 files changed, 504 insertions(+), 207 deletions(-) create mode 100644 tests/java5/generics/binaryweaving/A1.aj create mode 100644 tests/java5/generics/binaryweaving/C1.aj create mode 100644 tests/java5/generics/itds/binaryweaving/TestA_aspect.aj create mode 100644 tests/java5/generics/itds/binaryweaving/TestA_class.java create mode 100644 tests/java5/generics/itds/binaryweaving/TestA_generictype.java delete mode 100644 tests/java5/generics/itds/sharing/GenericAspectA.aj delete mode 100644 tests/java5/generics/itds/sharing/GenericAspectB.aj delete mode 100644 tests/java5/generics/itds/sharing/GenericAspectC.aj delete mode 100644 tests/java5/generics/itds/sharing/GenericAspectD.aj delete mode 100644 tests/java5/generics/itds/sharing/GenericAspectE.aj diff --git a/tests/java5/generics/binaryweaving/A1.aj b/tests/java5/generics/binaryweaving/A1.aj new file mode 100644 index 000000000..45f7fe779 --- /dev/null +++ b/tests/java5/generics/binaryweaving/A1.aj @@ -0,0 +1,5 @@ +aspect A1 { + declare parents: C* implements I; +} + +interface I {} diff --git a/tests/java5/generics/binaryweaving/C1.aj b/tests/java5/generics/binaryweaving/C1.aj new file mode 100644 index 000000000..b76d06a3c --- /dev/null +++ b/tests/java5/generics/binaryweaving/C1.aj @@ -0,0 +1 @@ +class C1 {} diff --git a/tests/java5/generics/genericaspects/GenericAspectT.aj b/tests/java5/generics/genericaspects/GenericAspectT.aj index a34e4c0b4..8efc804b7 100644 --- a/tests/java5/generics/genericaspects/GenericAspectT.aj +++ b/tests/java5/generics/genericaspects/GenericAspectT.aj @@ -4,11 +4,11 @@ import org.aspectj.lang.annotation.*; aspect ParentChildRelationship { - interface I

{} + interface I

{} public String I.parent; - public void I.do(T a) { + public void I.abc(T a) { a.parent=null; } diff --git a/tests/java5/generics/genericaspects/GenericAspectU.aj b/tests/java5/generics/genericaspects/GenericAspectU.aj index 8ed1f100e..7197a51f0 100644 --- a/tests/java5/generics/genericaspects/GenericAspectU.aj +++ b/tests/java5/generics/genericaspects/GenericAspectU.aj @@ -2,6 +2,7 @@ import java.util.*; import java.lang.reflect.*; import org.aspectj.lang.annotation.*; + abstract aspect ParentChildRelationship { interface ParentHasChildren{} @@ -22,27 +23,25 @@ abstract aspect ParentChildRelationship { } public void ChildHasParent.setParent(R parent) { -// parent.addChild(this); + ((ParentHasChildren)parent).addChild(this); } public void ParentHasChildren.addChild(X child) { - //if (child.parent != null) { - //child.parent.removeChild(child); - // } + if (((ChildHasParent)child).parent != null) { + ((ParentHasChildren)((ChildHasParent)child).parent).removeChild(child); + } children.add(child); } -/* public void ParentHasChildren.removeChild(Y child) { if (children.remove(child)) { - child.parent = null; + ((ChildHasParent)child).parent = null; } } -*/ } -aspect GenericAspectT extends ParentChildRelationship { +aspect GenericAspectU extends ParentChildRelationship { public static void main(String []argv) { @@ -92,7 +91,7 @@ aspect GenericAspectT extends ParentChildRelationship { "parent check 1 failed "+ "retrieved="+retrievedParent+" expected="+t); -/* + Top top2 = new Top(); b.setParent(top2); Top retrievedParent2 = b.getParent(); @@ -102,12 +101,12 @@ aspect GenericAspectT extends ParentChildRelationship { Bottom bot2 = new Bottom(); top2.addChild(bot2); - //Bottom aBottom = top2.getChildren().get(0); - //check(aBottom==bot2,"Incorrect child? expected="+bot2+" found="+aBottom); - //top2.removeChild(bot2); - //int size=top2.getChildren().size(); - //check(size==0,"Should be no children but there were "+size); -*/ + Bottom aBottom = top2.getChildren().get(0); + check(aBottom==bot2,"Incorrect child? expected="+bot2+" found="+aBottom); + top2.removeChild(bot2); + int size=top2.getChildren().size(); + check(size==0,"Should be no children but there were "+size); + } diff --git a/tests/java5/generics/genericaspects/ParentChildRelationship.aj b/tests/java5/generics/genericaspects/ParentChildRelationship.aj index 3e34e3afd..6d9624d6d 100644 --- a/tests/java5/generics/genericaspects/ParentChildRelationship.aj +++ b/tests/java5/generics/genericaspects/ParentChildRelationship.aj @@ -1,61 +1,86 @@ import java.util.*; +import org.aspectj.lang.annotation.*; +abstract aspect ParentChildRelationship { -public abstract aspect ParentChildRelationship { - - /** - * Parents contain a list of children - */ - private List P.children; - - /** - * Each child has a parent - */ - private P C.parent; + /** interface implemented by parents */ + interface ParentHasChildren{ +// List getChildren(); +// void addChild(C child); +// void removeChild(C child); + } + + /** interface implemented by children */ + interface ChildHasParent

{ +// P getParent(); +// void setParent(P parent); + } + + /** ensure the parent type implements ParentHasChildren */ + declare parents: Parent implements ParentHasChildren; + + /** ensure the child type implements ChildHasParent */ + declare parents: Child implements ChildHasParent; + + // Inter-type declarations made on the *generic* interface types to provide + // default implementations. + + /** list of children maintained by parent */ + public List ParentHasChildren.children = new ArrayList(); + + /** reference to parent maintained by child */ + public P ChildHasParent

.parent; + + /** Default implementation of getChildren for the generic type ParentHasChildren */ + public List ParentHasChildren.getChildren() { + return Collections.unmodifiableList(children); + } + + /** Default implementation of getParent for the generic type ChildHasParent */ + public P ChildHasParent

.getParent() { + return parent; + } /** - * Parents provide access to their children + * Default implementation of setParent for the generic type ChildHasParent. + * Ensures that this child is added to the children of the parent too. */ - public List P.getChildren() { - return Collections.unmodifiableList(children); - } - - /** - * A child provides access to its parent - */ - public P C.getParent() { - return parent; - } - - /** - * ensure bi-directional navigation on adding a child - */ - public void P.addChild(C child) { - if (child.parent != null) { - child.parent.removeChild(child); - } - children.add(child); - child.parent = this; - } + public void ChildHasParent.setParent(R parent) { + ((ParentHasChildren)parent).addChild(this); + } - /** - * ensure bi-directional navigation on removing a child - */ - public void P.removeChild(C child) { - if (children.remove(child)) { - child.parent = null; - } + /** + * Default implementation of addChild, ensures that parent of child is + * also updated. + */ + public void ParentHasChildren.addChild(X child) { + if (((ChildHasParent)child).parent != null) { + ((ParentHasChildren)((ChildHasParent)child).parent).removeChild(child); } + children.add(child); + ((ChildHasParent)child).parent = (ParentHasChildren)this; + } /** - * ensure bi-directional navigation on setting parent + * Default implementation of removeChild, ensures that parent of + * child is also updated. */ - public void C.setParent(P parent) { - parent.addChild(this); + public void ParentHasChildren.removeChild(Y child) { + if (children.remove(child)) { + ((ChildHasParent)child).parent = null; } - - public pointcut addingChild(P p, C c) : - execution(* P.addChild(C)) && this(p) && args(c); + } + /** + * Matches at an addChild join point for the parent type P and child type C + */ + @SuppressAjWarnings + public pointcut addingChild(Parent p, Child c) : + execution(* Parent.addChild(Child)) && this(p) && args(c); - public pointcut removingChild(P p, C c) : - execution(* P.removeChild(C)) && this(p) && args(c); + /** + * Matches at a removeChild join point for the parent type P and child type C + */ + @SuppressAjWarnings + public pointcut removingChild(Parent p, Child c) : + execution(* Parent.removeChild(Child)) && this(p) && args(c); + } diff --git a/tests/java5/generics/itds/Parse5.java b/tests/java5/generics/itds/Parse5.java index c322f006d..30514a5d9 100644 --- a/tests/java5/generics/itds/Parse5.java +++ b/tests/java5/generics/itds/Parse5.java @@ -2,15 +2,15 @@ public class Parse5 {} aspect X { - String Parse5.m1() {} + void Parse5.m1() {} - String Parse5.m2() {} + void Parse5.m2() {} - String Parse5.m3() {} // error + void Parse5.m3() {} - String Parse5.m4() {} // error + void Parse5.m4() {} // error - String Parse5.m5() {} // error + void Parse5.m5() {} // error - String Parse5.m6() {} // error + void Parse5.m6() {} // error } diff --git a/tests/java5/generics/itds/binaryweaving/A1.aj b/tests/java5/generics/itds/binaryweaving/A1.aj index 005d9dc2d..c1a25632a 100644 --- a/tests/java5/generics/itds/binaryweaving/A1.aj +++ b/tests/java5/generics/itds/binaryweaving/A1.aj @@ -7,7 +7,7 @@ aspect A1 { after(BaseClass c): execution(* run1(..)) && this(c) { List myLs = new ArrayList(); c.list1 = myLs; - System.err.println("Advice from A1 ran successfully"); + c.count++; } } diff --git a/tests/java5/generics/itds/binaryweaving/A2.aj b/tests/java5/generics/itds/binaryweaving/A2.aj index 20fb8baf5..1837d3e0a 100644 --- a/tests/java5/generics/itds/binaryweaving/A2.aj +++ b/tests/java5/generics/itds/binaryweaving/A2.aj @@ -1,13 +1,14 @@ import java.util.*; aspect A2 { +// declare precedence: A2,A1; public List BaseClass.list2; after(): execution(* run2(..)) { BaseClass bInt = new BaseClass(); bInt.list2 = new ArrayList(); - System.err.println("Advice from A2 ran successfully"); + bInt.count++; } } diff --git a/tests/java5/generics/itds/binaryweaving/A3.aj b/tests/java5/generics/itds/binaryweaving/A3.aj index cacd30e0d..66f80ba0a 100644 --- a/tests/java5/generics/itds/binaryweaving/A3.aj +++ b/tests/java5/generics/itds/binaryweaving/A3.aj @@ -2,6 +2,8 @@ import java.util.*; aspect A3 { +// declare precedence: A3,A2; + public List BaseClass.m(List lz) { return lz; } @@ -10,7 +12,7 @@ aspect A3 { List myLs = new ArrayList(); BaseClass bStr = new BaseClass(); List ls2 = bStr.m(myLs); - System.err.println("Advice from A3 ran successfully"); + bStr.count++; } } diff --git a/tests/java5/generics/itds/binaryweaving/BaseClass.java b/tests/java5/generics/itds/binaryweaving/BaseClass.java index edd3e4c93..225dddd46 100644 --- a/tests/java5/generics/itds/binaryweaving/BaseClass.java +++ b/tests/java5/generics/itds/binaryweaving/BaseClass.java @@ -1,9 +1,12 @@ public class BaseClass { + static int count = 0; + public static void main(String[]argv) { BaseClass b = new BaseClass(); b.run1(); b.run2(); b.run3(); + System.err.println("Advice count="+count); } public void run1() {} diff --git a/tests/java5/generics/itds/binaryweaving/TestA_aspect.aj b/tests/java5/generics/itds/binaryweaving/TestA_aspect.aj new file mode 100644 index 000000000..d2c423942 --- /dev/null +++ b/tests/java5/generics/itds/binaryweaving/TestA_aspect.aj @@ -0,0 +1,6 @@ +import java.util.*; + +aspect TestA_aspect { + // scary, multiple tvars, one from member, one from target + public void TestA_generictype.m(List ll1, List lz,List ll2) {} +} diff --git a/tests/java5/generics/itds/binaryweaving/TestA_class.java b/tests/java5/generics/itds/binaryweaving/TestA_class.java new file mode 100644 index 000000000..b5c6c01cd --- /dev/null +++ b/tests/java5/generics/itds/binaryweaving/TestA_class.java @@ -0,0 +1,10 @@ +import java.util.*; + +public class TestA_class { + public static void main(String []argv) { + TestA_generictype sc = new TestA_generictype(); + List li = new ArrayList(); + List lf = new ArrayList(); + sc.m(li,lf,li); + } +} diff --git a/tests/java5/generics/itds/binaryweaving/TestA_generictype.java b/tests/java5/generics/itds/binaryweaving/TestA_generictype.java new file mode 100644 index 000000000..005d936a0 --- /dev/null +++ b/tests/java5/generics/itds/binaryweaving/TestA_generictype.java @@ -0,0 +1,4 @@ +import java.util.*; + +class TestA_generictype {// extends Number> { +} diff --git a/tests/java5/generics/itds/sharing/GenericAspectA.aj b/tests/java5/generics/itds/sharing/GenericAspectA.aj deleted file mode 100644 index fcb3090ea..000000000 --- a/tests/java5/generics/itds/sharing/GenericAspectA.aj +++ /dev/null @@ -1,19 +0,0 @@ -// Simple - adding an interface to a type via a generic aspect and decp -abstract aspect GenericAspect { - - declare parents: A implements SimpleI; - - interface SimpleI {} - -} - -aspect GenericAspectA extends GenericAspect { - public static void main(String []argv) { - Base b = new Base(); - if (!(b instanceof SimpleI)) - throw new RuntimeException("Base should implement SimpleI!"); - } -} - -class Base {} - diff --git a/tests/java5/generics/itds/sharing/GenericAspectB.aj b/tests/java5/generics/itds/sharing/GenericAspectB.aj deleted file mode 100644 index 39d262223..000000000 --- a/tests/java5/generics/itds/sharing/GenericAspectB.aj +++ /dev/null @@ -1,19 +0,0 @@ -// Decp a generic interface -abstract aspect GenericAspect { - - declare parents: A implements SimpleI; - - interface SimpleI {} - -} - -aspect GenericAspectB extends GenericAspect { - public static void main(String []argv) { - Base b = new Base(); - if (!(b instanceof SimpleI)) - throw new RuntimeException("Base should implement SimpleI!"); - } -} - -class Base {} - diff --git a/tests/java5/generics/itds/sharing/GenericAspectC.aj b/tests/java5/generics/itds/sharing/GenericAspectC.aj deleted file mode 100644 index 3e1d6c6ee..000000000 --- a/tests/java5/generics/itds/sharing/GenericAspectC.aj +++ /dev/null @@ -1,24 +0,0 @@ -// Decp an interface with an ITD method on it -abstract aspect GenericAspect { - - interface SimpleI {} - - declare parents: A implements SimpleI; - - public int SimpleI.m() { return 4;} - -} - -aspect GenericAspectC extends GenericAspect { - public static void main(String []argv) { - Base b = new Base(); - - if (!(b instanceof SimpleI)) - throw new RuntimeException("Base should implement SimpleI!"); - - int i = b.m(); - } -} - -class Base {} - diff --git a/tests/java5/generics/itds/sharing/GenericAspectD.aj b/tests/java5/generics/itds/sharing/GenericAspectD.aj deleted file mode 100644 index 30775a593..000000000 --- a/tests/java5/generics/itds/sharing/GenericAspectD.aj +++ /dev/null @@ -1,24 +0,0 @@ -// Decp an interface with an ITD field -abstract aspect GenericAspect { - - interface SimpleI {} - - declare parents: A implements SimpleI; - - public int SimpleI.n; - -} - -aspect GenericAspectD extends GenericAspect { - public static void main(String []argv) { - Base b = new Base(); - - if (!(b instanceof SimpleI)) - throw new RuntimeException("Base should implement SimpleI!"); - - b.n=42; - } -} - -class Base {} - diff --git a/tests/java5/generics/itds/sharing/GenericAspectE.aj b/tests/java5/generics/itds/sharing/GenericAspectE.aj deleted file mode 100644 index 60bf8cd53..000000000 --- a/tests/java5/generics/itds/sharing/GenericAspectE.aj +++ /dev/null @@ -1,18 +0,0 @@ -abstract aspect GenericAspect { - - declare parents: A implements IUtil; - - //public void IUtil.print(Z n) { System.err.println(n); } -} - -interface IUtil { } - -aspect GenericAspectE extends GenericAspect { - public static void main(String []argv) { - Base b = new Base(); - // b.print("hello"); - } -} - -class Base {} - diff --git a/tests/java5/generics/itds/sharing/MethodA4.aj b/tests/java5/generics/itds/sharing/MethodA4.aj index 64c2aced0..192a7dc98 100644 --- a/tests/java5/generics/itds/sharing/MethodA4.aj +++ b/tests/java5/generics/itds/sharing/MethodA4.aj @@ -12,6 +12,8 @@ class Base { } aspect X { public List Base.m() { // OK, Z becomes N in return type List lz = new ArrayList(); + List ls; + return lz; }; } diff --git a/tests/java5/generics/itds/sharing/MethodQ.aj b/tests/java5/generics/itds/sharing/MethodQ.aj index bfe415a28..979c3b39a 100644 --- a/tests/java5/generics/itds/sharing/MethodQ.aj +++ b/tests/java5/generics/itds/sharing/MethodQ.aj @@ -9,7 +9,7 @@ public class MethodQ { } } -class SimpleClass { +class SimpleClass {// extends Number> { // This is what we are trying to mimic with our ITD //public void m(List ll1, List lz,List ll2) {} } diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java index 43200dfb2..5adfad3f6 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -152,22 +152,26 @@ public class GenericsTests extends XMLBasedAjcTestCase { * PASS multiple type variables in an ITD * PASS parsing ITDs that share type variables with target type * PASS using type variables from the target type in your field ITD - * TODO using type variables from the target type in your method ITD (but no type vars of your own) - * TODO using type variables from the target type in your ctor ITD (but no type vars of your own) - * TODO using type variables from the target type in your *STATIC* ITD (field/method/ctor) - * TODO binary weaving with changing types (moving between generic and simple) - * TODO bridge method creation - * TODO reusing type variable letter but differing spec across multiple ITDs in one aspect + * PASS using type variables from the target type in your method ITD (but no type vars of your own) + * PASS using type variables from the target type in your ctor ITD (but no type vars of your own) + * PASS using type variables from the target type and having your own too (methods) + * PASS using type variables from the target type and having your own too (ctors) + * PASS reusing type variable letter but differing spec across multiple ITDs in one aspect * PASS wildcards - * TODO exotic class/interface bounds ('? extends List') * PASS recursive type variable definitions - * TODO generic aspects - * TODO parameterizing ITDs with type variables - * - * defer? - * TODO using type variables from the target type and having your own too (methods) - * TODO using type variables from the target type and having your own too (ctors) + * PASS generic aspects + * PASS parameterizing ITDs with type variables + * TODO using type variables from the target type in your *STATIC* ITD (field/method/ctor) (error scenario) + * TODO binary weaving with changing types (moving between generic and simple) + * TODO bridge method creation (also relates to covariance overrides..) + * TODO exotic class/interface bounds ('? extends List','? super anything') * TODO signature attributes for generic ITDs (public only?) + * TODO generic aspect binary weaving (or at least multi source file weaving) + * + * + * strangeness: + * + * adding declare precedence into the itds/binaryweaving A2.aj, A3.aj causes a bizarre classfile inconsistent message */ public static Test suite() { @@ -236,8 +240,8 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testParseItdStaticMethod() {runTest("Parsing generic ITDs - 2");} public void testParseItdCtor() {runTest("Parsing generic ITDs - 3");} public void testParseItdComplexMethod() {runTest("Parsing generic ITDs - 4");} -// public void testParseItdSharingVars1() {runTest("Parsing generic ITDs - 5");} -// public void testParseItdSharingVars2() {runTest("Parsing generic ITDs - 6");} + public void testParseItdSharingVars1() {runTest("Parsing generic ITDs - 5");} + public void testParseItdSharingVars2() {runTest("Parsing generic ITDs - 6");} // non static @@ -304,6 +308,74 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testFieldITDsUsingTargetTypeVars15(){runTest("field itd using type variable from target type -15");} public void testFieldITDsUsingTargetTypeVars16(){runTest("field itd using type variable from target type -16");} + + public void testMethodITDsUsingTargetTypeVarsA1() {runTest("method itd using type variable from target type - A1");} + public void testMethodITDsUsingTargetTypeVarsA2() {runTest("method itd using type variable from target type - A2");} + public void testMethodITDsUsingTargetTypeVarsA3() {runTest("method itd using type variable from target type - A3");} + public void testMethodITDsUsingTargetTypeVarsA4() {runTest("method itd using type variable from target type - A4");} + public void testMethodITDsUsingTargetTypeVarsB1() {runTest("method itd using type variable from target type - B1");} + public void testMethodITDsUsingTargetTypeVarsC1() {runTest("method itd using type variable from target type - C1");} + public void testMethodITDsUsingTargetTypeVarsD1() {runTest("method itd using type variable from target type - D1");} + public void testMethodITDsUsingTargetTypeVarsE1() {runTest("method itd using type variable from target type - E1");} + public void testMethodITDsUsingTargetTypeVarsF1() {runTest("method itd using type variable from target type - F1");} + public void testMethodITDsUsingTargetTypeVarsG1() {runTest("method itd using type variable from target type - G1");} + public void testMethodITDsUsingTargetTypeVarsH1() {runTest("method itd using type variable from target type - H1");} + public void testMethodITDsUsingTargetTypeVarsI1() {runTest("method itd using type variable from target type - I1");} + public void testMethodITDsUsingTargetTypeVarsI2() {runTest("method itd using type variable from target type - I2");} + public void testMethodITDsUsingTargetTypeVarsJ1() {runTest("method itd using type variable from target type - J1");} + public void testMethodITDsUsingTargetTypeVarsK1() {runTest("method itd using type variable from target type - K1");} + public void testMethodITDsUsingTargetTypeVarsL1() {runTest("method itd using type variable from target type - L1");} + public void testMethodITDsUsingTargetTypeVarsM1() {runTest("method itd using type variable from target type - M1");} + public void testMethodITDsUsingTargetTypeVarsM2() {runTest("method itd using type variable from target type - M2");} + public void testMethodITDsUsingTargetTypeVarsN1() {runTest("method itd using type variable from target type - N1");} + public void testMethodITDsUsingTargetTypeVarsO1() {runTest("method itd using type variable from target type - O1");} + public void testMethodITDsUsingTargetTypeVarsO2() {runTest("method itd using type variable from target type - O2");} + public void testMethodITDsUsingTargetTypeVarsP1() {runTest("method itd using type variable from target type - P1");} + public void testMethodITDsUsingTargetTypeVarsQ1() {runTest("method itd using type variable from target type - Q1");} + + public void testCtorITDsUsingTargetTypeVarsA1() {runTest("ctor itd using type variable from target type - A1");} + public void testCtorITDsUsingTargetTypeVarsB1() {runTest("ctor itd using type variable from target type - B1");} + public void testCtorITDsUsingTargetTypeVarsC1() {runTest("ctor itd using type variable from target type - C1");} + public void testCtorITDsUsingTargetTypeVarsD1() {runTest("ctor itd using type variable from target type - D1");} + public void testCtorITDsUsingTargetTypeVarsE1() {runTest("ctor itd using type variable from target type - E1");} + public void testCtorITDsUsingTargetTypeVarsF1() {runTest("ctor itd using type variable from target type - F1");} + public void testCtorITDsUsingTargetTypeVarsG1() {runTest("ctor itd using type variable from target type - G1");} + public void testCtorITDsUsingTargetTypeVarsH1() {runTest("ctor itd using type variable from target type - H1");} + public void testCtorITDsUsingTargetTypeVarsI1() {runTest("ctor itd using type variable from target type - I1");} + + public void testSophisticatedAspectsA() {runTest("uberaspects - A");} + public void testSophisticatedAspectsB() {runTest("uberaspects - B");} + public void testSophisticatedAspectsC() {runTest("uberaspects - C");} + public void testSophisticatedAspectsD() {runTest("uberaspects - D");} + public void testSophisticatedAspectsE() {runTest("uberaspects - E");} + public void testSophisticatedAspectsF() {runTest("uberaspects - F");} + public void testSophisticatedAspectsG() {runTest("uberaspects - G");} + public void testSophisticatedAspectsH() {runTest("uberaspects - H");} + public void testSophisticatedAspectsI() {runTest("uberaspects - I");} + public void testSophisticatedAspectsJ() {runTest("uberaspects - J");} +// public void testSophisticatedAspectsK() {runTest("uberaspects - K");} // FIXME asc needs some error messages writing + public void testSophisticatedAspectsL() {runTest("uberaspects - L");} +// public void testSophisticatedAspectsM() {runTest("uberaspects - M");} // FIXME asc needs some error messages writing + public void testSophisticatedAspectsN() {runTest("uberaspects - N");} +// public void testSophisticatedAspectsO() {runTest("uberaspects - O");} // FIXME asc needs some error messages writing + public void testSophisticatedAspectsP() {runTest("uberaspects - P");} + public void testSophisticatedAspectsQ() {runTest("uberaspects - Q");} + public void testSophisticatedAspectsR() {runTest("uberaspects - R");} + public void testSophisticatedAspectsS() {runTest("uberaspects - S");} + public void testSophisticatedAspectsT() {runTest("uberaspects - T");} + + //public void testSophisticatedAspectsU() {runTest("uberaspects - U");} + + public void testBinaryWeavingITDsA() {runTest("binary weaving ITDs - A");} + + // ?? Looks like reweavable files dont process their type mungers correctly. + // See AjLookupEnvironment.weaveInterTypeDeclarations(SourceTypeBinding,typeMungers,declareparents,...) + // it seems to process any it discovers from the weaver state info then not apply new ones (the ones + // passed in!) +// public void testBinaryWeavingITDs1() {runTest("binary weaving ITDs - 1");} +// public void testBinaryWeavingITDs2() {runTest("binary weaving ITDs - 2");} +// public void testBinaryWeavingITDs3() {runTest("binary weaving ITDs - 3");} + // general tests ... usually just more complex scenarios public void testReusingTypeVariableLetters() {runTest("reusing type variable letters");} @@ -405,10 +477,6 @@ public class GenericsTests extends XMLBasedAjcTestCase { // runTest("Problems resolving type name inside generic class"); // } - // missing tests in here: - - // 1. public ITDs and separate compilation - are the signatures correct for the new public members? - // 2. ITDF // -- Pointcut tests... @@ -631,6 +699,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { runTest("ajdk notebook: pointcut in generic class example"); } + // --- helpers // Check the signature attribute on a class is correct diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 1abf02a21..4f069aa52 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -2876,6 +2876,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2928,7 +3187,11 @@ - + + + + + @@ -3016,23 +3279,36 @@ + + + + + + - + - - + + + + + + + + + + - - + @@ -3042,9 +3318,7 @@ - - - + -- cgit v1.2.3