summaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-07-29 11:10:49 +0000
committeracolyer <acolyer>2005-07-29 11:10:49 +0000
commit1156a21f2a2e1b15930f4691ef8946e3ab22f205 (patch)
tree994060c43caebde0f3dcbeb93ee6470188bcb3a0 /tests/src
parentee5d75f4b0d2827606ce63dbae0f019a8430d4c3 (diff)
downloadaspectj-1156a21f2a2e1b15930f4691ef8946e3ab22f205.tar.gz
aspectj-1156a21f2a2e1b15930f4691ef8946e3ab22f205.zip
test cases for get, set, staticinitialization, this, target, and within pointcuts matching with various generic and parameterized combos. The implementation of these pointcuts is now complete.
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java58
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml94
2 files changed, 137 insertions, 15 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
index f022a11ea..99ed2fee6 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
@@ -35,10 +35,10 @@ public class GenericsTests extends XMLBasedAjcTestCase {
* @args PASS
* - does not permit type vars PASS
* - does not permit parameterized type PASS
- * @annotation PASS
+ * @annotation PASS
* - does not permit type vars PASS
* - does not permit parameterized type PASS
- * @within, @within code - as above PASS
+ * @within, @within code - as above PASS
* annotation type pattern with generic and parameterized types PASS
* - just make sure that annotation interfaces can never be generic first! VERIFIED
* - @Foo<T> should fail PASS
@@ -54,29 +54,31 @@ public class GenericsTests extends XMLBasedAjcTestCase {
* - generic type with bounds [extends, extends + i/f's] N/A
* - generic type with wrong number of type params N/A
* - wildcards in bounds N/A
- * within
- * - as above, but allows parameterized type (disallowed is simplified plan)
+ * within PASS
+ * - as above, but allows parameterized type (disallowed in simplified plan)
* - wildcards in type parameters N/A
- * this
+ * this PASS
* - no type vars
* - parameterized types - disallowed in simplification plan
* - implements
* - instanceof
- * target
+ * target PASS
* - as this
- * args
+ * args TODO
* - as this/target, plus...
* - known static match
* - known static match fail
* - maybe match with unchecked warning
- * get & set
- * - parameterized type
- * - generic type
- * - return type is type variable
- * - return type is parameterized
+ * get & set PASS
+ * - parameterized declaring type PASS
+ * - generic declaring type PASS
+ * - field type is type variable PASS
+ * - field type is parameterized PASS
* initialization, preinitialization
- * - type variables as type params
- * - no join points for parameterized types
+ * - generic declaring type
+ * - type variables as params
+ * - parameterized types as params
+ * - no join points for init, preinit of parameterized types (as per staticinit)
* execution, withincode
* - wait till we get there!
* call
@@ -297,6 +299,22 @@ public class GenericsTests extends XMLBasedAjcTestCase {
// runTest("staticinitialization with generic types - advanced");
// }
+ public void testWithinPointcutErrors() {
+ runTest("within pcd with various parameterizations and generic types - errors");
+ }
+
+ public void testWithinPointcutWarnings() {
+ runTest("within pcd with various parameterizations and generic types - warnings");
+ }
+
+ public void testThisTargetPointcutErrors() {
+ runTest("this and target with various parameterizations and generic types - errors");
+ }
+
+ public void testThisTargetPointcutRuntime() {
+ runTest("this and target with various parameterizations and generic types - runtime");
+ }
+
public void testExecutionWithRawType() {
runTest("execution pcd with raw type matching");
}
@@ -305,6 +323,18 @@ public class GenericsTests extends XMLBasedAjcTestCase {
runTest("execution pcd with raw signature matching");
}
+ public void testGetAndSetPointcutErrors() {
+ runTest("get and set with various parameterizations and generic types - errors");
+ }
+
+ public void testGetAndSetPointcutMatchingWithGenericAndParameterizedTypes() {
+ runTest("get and set with various parameterizations and generic declaring types");
+ }
+
+ public void testGetAndSetPointcutMatchingWithGenericAndParameterizedFieldTypes() {
+ 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");
// }
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 115a04e99..0057270fc 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -2542,6 +2542,7 @@
<message kind="error" line="6" text="no static initialization join points for parameterized types, use raw type instead"/>
<message kind="error" line="9" text="no static initialization join points for parameterized types, use raw type instead"/>
<message kind="error" line="11" text="no static initialization join points for parameterized types, use raw type instead"/>
+ <message kind="error" line="14" text="no static initialization join points for parameterized types, use raw type instead"/>
</compile>
</ajc-test>
@@ -2585,7 +2586,98 @@
</compile>
</ajc-test>
-
+ <ajc-test dir="java5/generics/pointcuts" title="within pcd with various parameterizations and generic types - errors">
+ <compile files="WithinPointcutMatching.aj" options="-1.5">
+ <message kind="warning" line="4" text="no match for this type name: T"/>
+ <message kind="error" line="4" text="parameterized type pattern not supported by 'within', use a raw type pattern instead"/>
+ <message kind="error" line="5" text="parameterized type pattern not supported by 'within', use a raw type pattern instead"/>
+ <message kind="error" line="6" text="parameterized type pattern not supported by 'within', use a raw type pattern instead"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/pointcuts" title="within pcd with various parameterizations and generic types - warnings">
+ <compile files="WithinPointcutMatchingWarnings.aj" options="-1.5">
+ <message kind="warning" line="16" text="matched set correctly"/>
+ <message kind="warning" line="18" text="matched execution correctly"/>
+ <message kind="warning" line="24" text="init matched correctly"/>
+ <message kind="warning" line="32" text="matched parameterization ok"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/pointcuts" title="this and target with various parameterizations and generic types - errors">
+ <compile files="ThisAndTargetPointcutMatching.aj" options="-1.5">
+ <message kind="warning" line="4" text="no match for this type name: T"/>
+ <message kind="warning" line="5" text="no match for this type name: T"/>
+ <message kind="error" line="4" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
+ <message kind="error" line="5" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
+ <message kind="error" line="6" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
+ <message kind="error" line="7" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/pointcuts" title="this and target with various parameterizations and generic types - runtime">
+ <compile files="ThisAndTargetPointcutMatchingRuntime.aj" options="-1.5">
+ </compile>
+ <run class="ThisAndTargetPointcutMatchingRuntime">
+ <stdout>
+ <line text="set and this matched ok"/>
+ <line text="set and target matched ok"/>
+ <line text="call and target matched ok"/>
+ <line text="execution and this matched ok"/>
+ <line text="execution and target matched ok"/>
+ <line text="parameterized call and target matched ok"/>
+ <line text="parameterized call and this matched ok"/>
+ <line text="parameterized call and target matched ok"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/pointcuts" title="get and set with various parameterizations and generic types - errors">
+ <compile files="GetAndSetPointcutMatching.aj" options="-1.5">
+ <message kind="warning" line="4" text="no match for this type name: T"/>
+ <message kind="warning" line="5" text="no match for this type name: T"/>
+ <message kind="error" line="4" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
+ <message kind="error" line="5" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
+ <message kind="error" line="6" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
+ <message kind="error" line="7" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
+ <message kind="error" line="8" text="can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead)"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/pointcuts" title="get and set with various parameterizations and generic declaring types">
+ <compile files="GetAndSetPointcutMatchingDeclaringType.aj" options="-1.5">
+ <message kind="warning" line="15" text="generic/param get matching ok"/>
+ <message kind="warning" line="33" text="generic/param get matching ok"/>
+ <message kind="warning" line="12" text="generic/param set matching ok"/>
+ <message kind="warning" line="32" text="generic/param set matching ok"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/pointcuts" title="get and set with various parameterizations and generic field types">
+ <compile files="GetAndSetPointcutMatchingFieldType.aj" options="-1.5">
+ <message kind="warning" line="13" text="raw field type matching in get ok"/>
+ <message kind="warning" line="14" text="raw field type matching in set ok"/>
+ <message kind="warning" line="49" text="erasure matching in get ok"/>
+ <message kind="warning" line="45" text="erasure matching in set ok"/>
+ <message kind="warning" line="53" text="erasure matching in get with params ok"/>
+ <message kind="warning" line="46" text="erasure matching in set with params ok"/>
+ <message kind="warning" line="72" text="parameterized type matching in set ok"/>
+ <message kind="warning" line="73" text="parameterized type matching in get ok"/>
+ <message kind="warning" line="74" text="parameterized type matching in set ok x2"/>
+ <message kind="warning" line="75" text="parameterized type matching in get ok x2"/>
+ <message kind="warning" line="83" text="wildcard set matching ok"/>
+ <message kind="warning" line="84" text="wildcard get matching ok"/>
+ <message kind="warning" line="85" text="wildcard extends set matching ok"/>
+ <message kind="warning" line="86" text="wildcard extends get matching ok"/>
+ <message kind="warning" line="87" text="wildcard super set matching ok"/>
+ <message kind="warning" line="88" text="wildcard super get matching ok"/>
+ <message kind="warning" line="73" text="the really wild show"/>
+ <message kind="warning" line="84" text="the really wild show"/>
+ <message kind="warning" line="86" text="the really wild show"/>
+ <message kind="warning" line="88" text="the really wild show"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="java5/generics/pointcuts" title="execution pcd with raw type matching">
<compile files="GenericInterface.java,ConcreteImplementingClass.java,GenericImplementingClass.java,RawTypeMatching.aj" options="-1.5">
<message kind="warning" line="4" text="execution(* GenericInterface.*(..))"/>