diff options
author | aclement <aclement> | 2005-08-04 16:11:03 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-08-04 16:11:03 +0000 |
commit | 900a3e81d5b09c55e4044451f311f0566c025ec6 (patch) | |
tree | 6c1f9e5e84d9edb9fb8f8728a8a701555b10db75 /tests | |
parent | a26f850c10f1790682ff9d1f13a4f8d5253f5e71 (diff) | |
download | aspectj-900a3e81d5b09c55e4044451f311f0566c025ec6.tar.gz aspectj-900a3e81d5b09c55e4044451f311f0566c025ec6.zip |
genericitds: lots of new support for recursive type variables and ITD ctors.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java | 51 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 65 |
2 files changed, 105 insertions, 11 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java index ab4e34add..f38a45198 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -99,6 +99,29 @@ public class GenericsTests extends XMLBasedAjcTestCase { * - wait till we get there! */ + /* ========================================== + * Generics test plan for ITDs. + * + * think about: + * - source/binary weaving + * - visibility default/private/public + * - static/nonstatic + * - parameterized ITDs (methods/ctors/fields) + * - ITD target: interface/class/aspect + * - multiple type variables + * - generic ITDs (like generic methods) + * - constructor ITDs, method ITDs + * - ITDs sharing type variables with generic types + * - relating to above point, this makes generic ITD fields possible + * - signature attributes for generic ITDs (required? required only for public ITDs?) + * - binary weaving when target type changes over time (might start out 'simple' then sometime later be 'generic') + * - bridge methods - when to create them + * - multiple 'separate' ITDs in a file that share a type variable by 'name' + * - wildcards '?' 'extends' 'super' '&' + * - do type variables assigned to members need to persist across serialization + * - recursive type variable definitions eg. <R extends Comparable<? super R>> + */ + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(GenericsTests.class); } @@ -182,12 +205,21 @@ public class GenericsTests extends XMLBasedAjcTestCase { // non static - public void testGenericMethodITD1() {runTest("generic method itd - 1");} // <E> ... (List<? extends E>) - public void testGenericMethodITD2() {runTest("generic method itd - 2");} // <E extends Number> ... (List<? extends E>) called incorrectly - public void testGenericMethodITD3() {runTest("generic method itd - 3");} // <E> ... (List<E>,List<E>) - public void testGenericMethodITD4() {runTest("generic method itd - 4");} // <A,B> ... (List<A>,List<B>) - public void testGenericMethodITD5() {runTest("generic method itd - 5");} // <E> ... (List<E>,List<E>) called incorrectly - public void testGenericMethodITD6() {runTest("generic method itd - 6");} // <E extends Number> ... (List<? extends E>) + public void testGenericMethodITD1() {runTest("generic method itd - 1"); } // <E> ... (List<? extends E>) + public void testGenericMethodITD2() {runTest("generic method itd - 2"); } // <E extends Number> ... (List<? extends E>) called incorrectly + public void testGenericMethodITD3() {runTest("generic method itd - 3"); } // <E> ... (List<E>,List<E>) + public void testGenericMethodITD4() {runTest("generic method itd - 4"); } // <A,B> ... (List<A>,List<B>) + public void testGenericMethodITD5() {runTest("generic method itd - 5"); } // <E> ... (List<E>,List<E>) called incorrectly + public void testGenericMethodITD6() {runTest("generic method itd - 6"); } // <E extends Number> ... (List<? extends E>) + public void testGenericMethodITD7() {runTest("generic method itd - 7"); } // <E> ... (List<E>,List<? extends E>) + public void testGenericMethodITD8() {runTest("generic method itd - 8"); } // <E> ... (List<E>,List<? extends E>) called incorrectly + public void testGenericMethodITD9() {runTest("generic method itd - 9"); } // <R extends Comparable<? super R>> ... (List<R>) + public void testGenericMethodITD10() {runTest("generic method itd - 10");} // <R extends Comparable<? super R>> ... (List<R>) called incorrectly + public void testGenericMethodITD11() {runTest("generic method itd - 11");} // <R extends Comparable<? extends R>> ... (List<R>) + public void testGenericMethodITD12() {runTest("generic method itd - 12");} // <R extends Comparable<? extends R>> ... (List<R>) called incorrectly + public void testGenericMethodITD13() {runTest("generic method itd - 13");} // <R extends Comparable<? extends R>> ... (List<R>) called correctly in a clever way ;) + public void testGenericMethodITD14() {runTest("generic method itd - 14");} // <R extends Comparable<? super R>> ... (List<R>) called incorrectly in a clever way + public void testGenericMethodITD15() {runTest("generic method itd - 15");} // <R extends Comparable<? super R>> ... (List<R>) called correctly in a clever way public void testParameterizedMethodITD1() {runTest("parameterized method itd - 1");} // (List<? extends Super>) @@ -196,8 +228,11 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testParameterizedMethodITD4() {runTest("parameterized method itd - 4");} // (List<? super B>) -// public void testNonStaticGenericCtorITD1() {runTest("generic ctor itd - 1");} -// public void testGenericITFSharingTypeVariable() { + public void testGenericCtorITD1() {runTest("generic ctor itd - 1");} // <T> new(List<T>) + public void testGenericCtorITD2() {runTest("generic ctor itd - 2");} // <T> new(List<T>,List<? extends T>) + public void testGenericCtorITD3() {runTest("generic ctor itd - 3");} // <T> new(List<T>,Comparator<? super T>) + + // public void testGenericITFSharingTypeVariable() { // runTest("generic intertype field declaration, sharing type variable"); // } diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 0d7143caa..d3e7cfd85 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -2386,9 +2386,19 @@ </run> </ajc-test> - <ajc-test dir="java5/generics/itds" title="non static generic ctor itd - 1"> - <compile files="NonstaticGenericCtorITD1.aj" options="-1.5"/> - <run class="NonstaticGenericCtorITD1"/> + <ajc-test dir="java5/generics/itds" title="generic ctor itd - 1"> + <compile files="GenericCtorITD1.aj" options="-1.5"/> + <run class="GenericCtorITD1"/> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic ctor itd - 2"> + <compile files="GenericCtorITD2.aj" options="-1.5"/> + <run class="GenericCtorITD2"/> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic ctor itd - 3"> + <compile files="GenericCtorITD3.aj" options="-1.5"/> + <run class="GenericCtorITD3"/> </ajc-test> <ajc-test dir="java5/generics/itds" title="parameterized method itd - 1"> @@ -2447,6 +2457,55 @@ <run class="GenericMethodITD6"/> </ajc-test> + <ajc-test dir="java5/generics/itds" title="generic method itd - 7"> + <compile files="GenericMethodITD7.aj" options="-1.5"/> + <run class="GenericMethodITD7"/> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 8"> + <compile files="GenericMethodITD8.aj" options="-1.5"> + <message kind="error" line="10" text="The method simple(List<E>, List<? extends E>) in the type X is not applicable for the arguments (List<Number>, List<String>)"/> + </compile> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 9"> + <compile files="GenericMethodITD9.aj" options="-1.5"/> + <run class="GenericMethodITD9"/> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 10"> + <compile files="GenericMethodITD10.aj" options="-1.5"> + <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type X is not applicable for the arguments (List<A>) since the type A is not a valid substitute for the bounded parameter <R extends Object & Comparable<? super R>>"/> + </compile> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 11"> + <compile files="GenericMethodITD11.aj" options="-1.5"/> + <run class="GenericMethodITD11"/> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 12"> + <compile files="GenericMethodITD12.aj" options="-1.5"> + <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type X is not applicable for the arguments (List<A>) since the type A is not a valid substitute for the bounded parameter <R extends Object & Foo<? extends R>>"/> + </compile> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 13"> + <compile files="GenericMethodITD13.aj" options="-1.5"/> + <run class="GenericMethodITD13"/> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 14"> + <compile files="GenericMethodITD14.aj" options="-1.5"> + <message kind="error" line="10" text="Bound mismatch: The generic method crazy(List<R>) of type X is not applicable for the arguments (List<A>) since the type A is not a valid substitute for the bounded parameter <R extends Object & Foo<? super R>>"/> + </compile> + </ajc-test> + + <ajc-test dir="java5/generics/itds" title="generic method itd - 15"> + <compile files="GenericMethodITD15.aj" options="-1.5"/> + <run class="GenericMethodITD15"/> + </ajc-test> + <ajc-test dir="java5/generics/itds" title="non static generic method itd - 2"> <compile files="NonstaticGenericCtorITD2.aj" options="-1.5"/> <run class="NonstaticGenericCtorITD2"/> |