aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-17 08:38:10 +0000
committeracolyer <acolyer>2005-08-17 08:38:10 +0000
commitb212b5d6b3f245ac36ed7610ef32c0ca4e6eca48 (patch)
treec9757efc6f7bbb714458155c0371bc8a117bdcc9 /tests
parentd7bb145d6e9ea76fa2e9cc1648ab0869ca5e6c2c (diff)
downloadaspectj-b212b5d6b3f245ac36ed7610ef32c0ca4e6eca48.tar.gz
aspectj-b212b5d6b3f245ac36ed7610ef32c0ca4e6eca48.zip
added ajdk generics tests and test for annotation matching on intermediate type in hierarchy
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java24
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml88
3 files changed, 116 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 702bf68ad..3c15df3a6 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -210,6 +210,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("parser crashes on call(void (@a *)(..)");
}
+ public void testIntermediateAnnotationMatching() {
+ runTest("intermediate annotation matching");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
index 052ca334f..e7c9d88c0 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
@@ -595,6 +595,30 @@ public class GenericsTests extends XMLBasedAjcTestCase {
runTest("after returning with generic wildcard super");
}
+ public void testAJDKErasureMatchingExamples() {
+ runTest("ajdk notebook: erasure matching examples");
+ }
+
+ public void testAJDKParameterizedMatchingSimpleExamples() {
+ runTest("ajdk notebook: simple parameterized type matching examples");
+ }
+
+ public void testAJDKMixedTypeVarsAndParametersExample() {
+ runTest("ajdk notebook: mixed parameterized types and generic methods");
+ }
+
+ public void testAJDKSignatureAndWildcardExamples() {
+ runTest("ajdk notebook: signature matching with generic wildcards");
+ }
+
+ public void testAJDKBridgeMethodExamples() {
+ runTest("ajdk notebook: bridge method examples");
+ }
+
+ public void testAJDKArgsExamples() {
+ runTest("ajdk notebook: args examples");
+ }
+
// --- 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 f0e5bff73..9d112b4a2 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -17,6 +17,17 @@
</compile>
</ajc-test>
+ <ajc-test title="intermediate annotation matching" dir="bugs150">
+ <compile files="AnnotationPlusPatternMatchingError.aj" options="-1.5">
+ <message kind="warning" line="28" text="matched"/>
+ </compile>
+ <run class="AnnotationPlusPatternMatchingError">
+ <stdout>
+ <line text="In advice"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="migration" title="load aspectj 1.2.1 aspects in aspectj 5">
<compile files="Program.java" aspectpath="aspects121.jar">
</compile>
@@ -3471,6 +3482,83 @@
</stdout>
</run>
</ajc-test>
+
+ <ajc-test title="ajdk notebook: erasure matching examples" dir="java5/generics/ajdk">
+ <compile files="ErasureMatching.aj" options="-1.5">
+ <message kind="warning" line="18" text="static generic method match"/>
+ <message kind="warning" line="21" text="instance generic method match"/>
+ <message kind="warning" line="31" text="method in generic type match"/>
+ <message kind="warning" line="28" text="field in generic type match"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test title="ajdk notebook: simple parameterized type matching examples" dir="java5/generics/ajdk">
+ <compile files="SimpleParameterizedTypeExamples.aj" options="-1.5">
+ <message kind="warning" line="34" text="get myStrings 1"/>
+ <message kind="warning" line="34" text="get myStrings 2"/>
+ <message kind="warning" line="38" text="get myStrings 1"/>
+ <message kind="warning" line="38" text="get myStrings 2"/>
+ <message kind="warning" line="35" text="get myFloats 1"/>
+ <message kind="warning" line="35" text="get myFloats 2"/>
+ <message kind="warning" line="35" text="get myFloats 3"/>
+ <message kind="warning" line="34" text="getter 1"/>
+ <message kind="warning" line="35" text="getter 1"/>
+ <message kind="warning" line="34" text="getter 2"/>
+ <message kind="warning" line="35" text="getter 2"/>
+ <message kind="warning" line="34" text="getter 3"/>
+ <message kind="warning" line="35" text="getter 4"/>
+ <message kind="warning" line="25" text="call 1"/>
+ <message kind="warning" line="25" text="call 2"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test title="ajdk notebook: mixed parameterized types and generic methods" dir="java5/generics/ajdk">
+ <compile files="MixedParameterizedAndTypeVariables.aj" options="-1.5">
+ <message kind="warning" line="13" text="erasure match"/>
+ <message kind="warning" line="13" text="mixed match"/>
+ <message kind="warning" line="13" text="params only match"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test title="ajdk notebook: signature matching with generic wildcards" dir="java5/generics/ajdk">
+ <compile files="SignatureWildcards.aj" options="-1.5">
+ <message kind="warning" line="13" text="any list"/>
+ <message kind="warning" line="15" text="any list"/>
+ <message kind="warning" line="17" text="any list"/>
+ <message kind="warning" line="13" text="only foo"/>
+ <message kind="warning" line="15" text="some list"/>
+ <message kind="warning" line="13" text="any list with upper bound"/>
+ <message kind="warning" line="15" text="any list with upper bound"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test title="ajdk notebook: bridge method examples" dir="java5/generics/ajdk">
+ <compile files="BridgeMethodExamples.aj" options="-1.5">
+ <message kind="warning" line="17" text="double match"/>
+ <message kind="warning" line="25" text="double match"/>
+ <message kind="warning" line="9" text="match"/>
+ <message kind="warning" line="11" text="match"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test title="ajdk notebook: args examples" dir="java5/generics/ajdk">
+ <compile files="ArgsExamples.aj" options="-1.5">
+ <message kind="warning" line="15" text="unchecked match of List&lt;Double&gt; with List&lt;? extends Number&gt; when argument is an instance of List at join point method-execution(void C.goo(List&lt;? extends Number&gt;)) [Xlint:uncheckedArgument]"/>
+ <message kind="warning" line="53" text="unchecked match"/>
+ </compile>
+ <run class="ArgsExamples">
+ <stdout>
+ <line text="args(List)"/>
+ <line text="args List of String"/>
+ <line text="args(List)"/>
+ <line text="args List of Double"/>
+ <line text="args(List)"/>
+ <line text="args List of Double"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+
<!-- ============================================================== -->
<!-- End of generics tests -->
<!-- ============================================================== -->