diff options
author | aclement <aclement> | 2008-01-25 18:56:37 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-01-25 18:56:37 +0000 |
commit | 44fb53df1b5450191473161b3c3854fa9c48ad69 (patch) | |
tree | 4f7cc7697a89f7b53269ebfa0a52a69d32a3f63e /tests | |
parent | bf5bf21b7c668f73401ec1515d60ff1f12dd1d63 (diff) | |
download | aspectj-44fb53df1b5450191473161b3c3854fa9c48ad69.tar.gz aspectj-44fb53df1b5450191473161b3c3854fa9c48ad69.zip |
paramannos: testcode
Diffstat (limited to 'tests')
4 files changed, 92 insertions, 0 deletions
diff --git a/tests/features160/parameterAnnotationMatching/SimpleAspect.java b/tests/features160/parameterAnnotationMatching/SimpleAspect.java new file mode 100644 index 000000000..614e3aca5 --- /dev/null +++ b/tests/features160/parameterAnnotationMatching/SimpleAspect.java @@ -0,0 +1,8 @@ +aspect SimpleAspect { + before(): execution(* *(@Anno1 *)) {} + before(): execution(* *(@Anno2 *)) {} + before(): execution(* *(@Anno1 (*))) {} + before(): execution(* *(@Anno2 (*))) {} + before(): execution(* *(@Anno1 (@Anno2 *))) {} + before(): execution(* *(@Anno2 (@Anno1 *))) {} +} diff --git a/tests/features160/parameterAnnotationMatching/SimpleType.java b/tests/features160/parameterAnnotationMatching/SimpleType.java new file mode 100644 index 000000000..31687b67a --- /dev/null +++ b/tests/features160/parameterAnnotationMatching/SimpleType.java @@ -0,0 +1,7 @@ +class SimpleType { + public void a(AnnotatedWithAnno1 p) {} + public void b(@Anno1 String p) {} + public void c(@Anno1 AnnotatedWithAnno2 p) {} + public void d(@Anno1 @Anno2 String p) {} + public void e(@Anno1 @Anno2 AnnotatedWithBoth p) {} +} diff --git a/tests/features160/parameterAnnotationMatching/TestMatchingCtors.aj b/tests/features160/parameterAnnotationMatching/TestMatchingCtors.aj new file mode 100644 index 000000000..05ad0ba67 --- /dev/null +++ b/tests/features160/parameterAnnotationMatching/TestMatchingCtors.aj @@ -0,0 +1,64 @@ +// Each pointcut should match as specified the methods that immediately follow it +aspect TestMatching { + before(): execution(C001*.new(@Anno1 *)) {} + static class C001a { C001a(AnnotatedWithAnno1 p) {} } // yes + + before(): execution(C002*.new(@Anno1 (*))) {} + static class C002a { C002a(@Anno1 String p) {} } // yes + static class C002b { C002b(Integer p) {} } // no + + before(): execution(C003*.new(@Anno2 (*))) {} + static class C003a { C003a(@Anno2 String p) {} } // yes + static class C003b { C003b(@Anno1 String p) {} } // no + static class C003c { C003c(Integer p) {} } // no + + before(): execution(C004*.new(@Anno1 (@Anno2 *))) {} + static class C004a { C004a(@Anno1 AnnotatedWithAnno2 p) {} } // yes + static class C004b { C004b(@Anno2 String p) {} } // no + static class C004c { C004c(@Anno1 String p) {} } // no + static class C004d { C004d(Integer p) {} } // no + + before(): execution(C005*.new(@Anno1 *,@Anno2 *)) {} + static class C005a { C005a(AnnotatedWithAnno1 p,AnnotatedWithAnno2 q) {} } // yes + static class C005b { C005b(AnnotatedWithAnno1 p,@Anno2 String q) {} } // no + static class C005c { C005c(String p,AnnotatedWithAnno2 q) {} } // no + + before(): execution(C006*.new(@Anno1 (*),@Anno2 (*))) {} + static class C006a { C006a(@Anno1 String p,@Anno2 String q) {} } // yes + static class C006b { C006b(AnnotatedWithAnno1 p,@Anno2 String q) {} } // no + static class C006c { C006c(String p,AnnotatedWithAnno2 q) {} } // no + static class C006d { C006d(AnnotatedWithAnno1 p,AnnotatedWithAnno2 q) {} } // no + static class C006e { C006e(@Anno1 @Anno2 String p,@Anno1 @Anno2 String q) {} } // yes + + before(): execution(C007*.new(@Anno1 (@Anno2 *))) {} + static class C007a { C007a(@Anno1 AnnotatedWithAnno2 p) {} } // yes + static class C007b { C007b(@Anno1 String p) {} } // no + static class C007c { C007c(AnnotatedWithAnno2 p) {} } // no + static class C007d { C007d(@Anno1 AnnotatedWithAnno1 p) {} } // no + + before(): execution(C008*.new(@Anno1 (*),..,@Anno2 (*))) {} + static class C008a { C008a(@Anno1 String p,Integer q,@Anno2 String r) {} } // yes + static class C008b { C008b(@Anno1 String p,@Anno2 String r) {} } // yes + static class C008c { C008c(@Anno1 String p,Integer q,String r,@Anno2 String s) {} } // yes + static class C008d { C008d(@Anno1 String p,Integer q,String r,@Anno2 String s,String t) {} } // no + static class C008e { C008e(String p,Integer q,String r,@Anno2 String s) {} } // no + + before(): execution(C009*.new(@Anno1 (*),..,@Anno2 *)) {} + static class C009a { C009a(@Anno1 String p, Integer q,AnnotatedWithAnno2 r) {} } // yes + static class C009b { C009b(@Anno1 String p, Integer q,@Anno2 AnnotatedWithAnno2 r) {} } // yes + static class C009c { C009c(@Anno1 String p, Integer q,@Anno2 Integer r) {} } // no + static class C009d { C009d(String p, Integer q,@Anno2 Integer r) {} } // no + + before(): execution(C010*.new(..,@Anno1 (*))) {} + static class C010a { C010a(@Anno1 String p,@Anno1 String q) {} } // yes + static class C010b { C010b(String p,@Anno1 String q) {} } // yes + static class C010c { C010c(@Anno1 String p,String q) {} } // no + + before(): execution(C011*.new(@Anno1 *...)) {} + static class C011a { C011a(AnnotatedWithAnno1... p) {} } // no (the array is not annotated) + static class C011b { C011b(@Anno1 String... p) {} } // no + + before(): execution(C012*.new(@Anno1 (*...))) {} + static class C012a { C012a(@Anno1 String... p) {} } // yes + static class C012b { C012b(AnnotatedWithAnno1... p) {} } // no +} diff --git a/tests/features160/parameterAnnotationMatching/WildcardedMatching.aj b/tests/features160/parameterAnnotationMatching/WildcardedMatching.aj new file mode 100644 index 000000000..24f477128 --- /dev/null +++ b/tests/features160/parameterAnnotationMatching/WildcardedMatching.aj @@ -0,0 +1,13 @@ +aspect WildcardedMatching { + before(): execution(* m001*(@Ann*1 *)) {} + public void m001a(AnnotatedWithAnno1 p) {} // yes + public void m001b(@Anno1 String p) {} // no + + before(): execution(* m002*(@*1 (*))) {} + public void m002a(@Anno1 String p) {} // yes + public void m002b(AnnotatedWithAnno1 p) {} // no + + before(): execution(* m003*(@Anno* (*))) {} + public void m003a(@Anno1 String p) {} // yes + public void m003b(@Anno2 String p) {} // yes +} |