From 0a1b33eeb5d154b81a6d060670d49df6f6d8b81e Mon Sep 17 00:00:00 2001 From: acolyer Date: Tue, 9 Aug 2005 13:04:57 +0000 Subject: tests for args - this completes the implementation of generic and parameterized type matching for ALL pointcuts in AspectJ 5. yay. --- .../aspectj/systemtest/ajc150/GenericsTests.java | 95 ++++++++++----- tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 129 ++++++++++++++++++++- 2 files changed, 191 insertions(+), 33 deletions(-) diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java index 593a66679..a16a6f300 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -64,11 +64,23 @@ public class GenericsTests extends XMLBasedAjcTestCase { * - instanceof * target PASS * - as this - * args TODO - * - as this/target, plus... - * - known static match - * - known static match fail - * - maybe match with unchecked warning + * args + * - args(List) matches List, List, List PASS + * - args(List) -> invalid absolute type T + * - args(List) matches List but not List PASS + * - args(List) matches List with unchecked warning PASS + * - args(List) matches List with unchecked warning PASS + * - args(List) matches List, List, List with unchecked warning PASS + * matches List PASS, List PASS(with warning) + * - args(List) matches List, List, List, ... PASS + * - args(List, List, not List PASS + * matches List, List with unchecked warning PASS + * - args(List) matches List, List + * does not match List + * matches List, List with unchecked warning + * matches List + * matches List with unchecked warning + * matches List with unchecked warning * get & set PASS * - parameterized declaring type PASS * - generic declaring type PASS @@ -95,14 +107,16 @@ public class GenericsTests extends XMLBasedAjcTestCase { * - parameter as type variable PASS * - parameter as parameterized type PASS * - no join points for bridge methods PASS - * call - * - no generic or parameterized declaring type patterns - * - no parameterized throws patterns - * - return type as type variable - * - return type as parameterized type - * - parameter as type variable - * - parameter as parameterized type - * - a call to a bridge method is really a call to the method being bridged... (1.4/1.5 differences here?) + * call PASS + * - no generic or parameterized declaring type patterns PASS + * - no parameterized throws patterns PASS + * - return type as type variable PASS + * - return type as parameterized type PASS + * - parameter as type variable PASS + * - parameter as parameterized type PASS + * - calls to a bridge methods PASS + * after throwing - can't use parameterized type pattern + * after returning - same as for args */ /* ========================================== @@ -206,6 +220,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { // parsing of generic ITD members + public void testParseItdNonStaticMethod() {runTest("Parsing generic ITDs - 1");} public void testParseItdStaticMethod() {runTest("Parsing generic ITDs - 2");} public void testParseItdCtor() {runTest("Parsing generic ITDs - 3");} @@ -213,14 +228,15 @@ public class GenericsTests extends XMLBasedAjcTestCase { // public void testParseItdSharingVars1() {runTest("Parsing generic ITDs - 5");} // public void testParseItdSharingVars2() {runTest("Parsing generic ITDs - 6");} - + // non static - public void testGenericMethodITD1() {runTest("generic method itd - 1");} // ... (List) - public void testGenericMethodITD2() {runTest("generic method itd - 2");} // ... (List) called incorrectly - public void testGenericMethodITD3() {runTest("generic method itd - 3");} // ... (List,List) - public void testGenericMethodITD4() {runTest("generic method itd - 4");} // ... (List,List) - public void testGenericMethodITD5() {runTest("generic method itd - 5");} // ... (List,List) called incorrectly - public void testGenericMethodITD6() {runTest("generic method itd - 6");} // ... (List) + + public void testGenericMethodITD1() {runTest("generic method itd - 1");} // ... (List) + public void testGenericMethodITD2() {runTest("generic method itd - 2");} // ... (List) called incorrectly + public void testGenericMethodITD3() {runTest("generic method itd - 3");} // ... (List,List) + public void testGenericMethodITD4() {runTest("generic method itd - 4");} // ... (List,List) + public void testGenericMethodITD5() {runTest("generic method itd - 5");} // ... (List,List) called incorrectly + public void testGenericMethodITD6() {runTest("generic method itd - 6");} // ... (List) public void testGenericMethodITD7() {runTest("generic method itd - 7"); } // ... (List,List) public void testGenericMethodITD8() {runTest("generic method itd - 8"); } // ... (List,List) called incorrectly public void testGenericMethodITD9() {runTest("generic method itd - 9"); } // > ... (List) @@ -232,7 +248,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { public void testGenericMethodITD15() {runTest("generic method itd - 15");} // > ... (List) called correctly in a clever way - + // generic ctors public void testGenericCtorITD1() {runTest("generic ctor itd - 1");} // new(List) public void testGenericCtorITD2() {runTest("generic ctor itd - 2");} // new(List,List) @@ -495,14 +511,37 @@ public class GenericsTests extends XMLBasedAjcTestCase { runTest("get and set with various parameterizations and generic field types"); } -// public void testExecutionWithGenericDeclaringTypeAndErasedParameterTypes() { -// runTest("execution pcd with generic declaring type and erased parameter types"); -// } + public void testArgsWithRawType() { + runTest("args with raw type and generic / parameterized sigs"); + } -// not passing yet... -// public void testExecutionWithGenericSignature() { -// runTest("execution pcd with generic signature matching"); -// } + public void testArgsParameterizedType() { + runTest("args with parameterized type and generic / parameterized sigs"); + } + + public void testArgsParameterizedAndWildcards() { + runTest("args with parameterized type and wildcards"); + } + + public void testArgsWithWildcardVar() { + runTest("args with generic wildcard"); + } + + public void testArgsWithWildcardExtendsVar() { + runTest("args with generic wildcard extends"); + } + + public void testArgsWithWildcardSuperVar() { + runTest("args with generic wildcard super"); + } + + public void testGenericMethodMatching() { + runTest("generic method matching"); + } + + public void testGenericWildcardsInSignatureMatching() { + runTest("generic wildcards in signature matching"); + } // --- helpers diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 958df1395..1605cccf4 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -2610,7 +2610,7 @@ - + @@ -2883,6 +2883,7 @@ + @@ -3083,6 +3084,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3316,7 +3435,7 @@ - + @@ -3325,7 +3444,7 @@ - + @@ -3334,7 +3453,7 @@ - + @@ -3343,7 +3462,7 @@ - + -- cgit v1.2.3