From 02f0fe5cdb7f5cd6817217474b65da05fe103757 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 2 Nov 2009 16:25:21 +0000 Subject: [PATCH] 293510: testcode --- tests/bugs167/pr293510/A.java | 12 ++++++++++++ tests/bugs167/pr293510/CaseOne.java | 18 ++++++++++++++++++ tests/bugs167/pr293510/CaseTwo.java | 17 +++++++++++++++++ tests/bugs167/pr293510/MyService.java | 6 ++++++ tests/bugs167/pr293510/RooLikeAspect.java | 6 ++++++ tests/bugs167/pr293510/Service.java | 6 ++++++ .../SupplyMethodCollectedToService.java | 14 ++++++++++++++ 7 files changed, 79 insertions(+) create mode 100644 tests/bugs167/pr293510/A.java create mode 100644 tests/bugs167/pr293510/CaseOne.java create mode 100644 tests/bugs167/pr293510/CaseTwo.java create mode 100644 tests/bugs167/pr293510/MyService.java create mode 100644 tests/bugs167/pr293510/RooLikeAspect.java create mode 100644 tests/bugs167/pr293510/Service.java create mode 100644 tests/bugs167/pr293510/SupplyMethodCollectedToService.java diff --git a/tests/bugs167/pr293510/A.java b/tests/bugs167/pr293510/A.java new file mode 100644 index 000000000..a85d605b1 --- /dev/null +++ b/tests/bugs167/pr293510/A.java @@ -0,0 +1,12 @@ + +@Foo +class A { + public void m() {} +} + +aspect X { +//before(): execution(* (@Foo *..*).*(..)) {} +before(): execution(* (@Foo *).*(..)) {} +} + +@interface Foo {} diff --git a/tests/bugs167/pr293510/CaseOne.java b/tests/bugs167/pr293510/CaseOne.java new file mode 100644 index 000000000..b351d3ef3 --- /dev/null +++ b/tests/bugs167/pr293510/CaseOne.java @@ -0,0 +1,18 @@ +package pkg; + +import java.lang.annotation.*; + +class A {public void m() {}} + +class B extends A {public void m() {}} + +@Marker +class C extends B {public void m() {}} + +aspect X { + pointcut p(): execution(* (@Marker *).*(..)); + before(): p() {} +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Marker {} diff --git a/tests/bugs167/pr293510/CaseTwo.java b/tests/bugs167/pr293510/CaseTwo.java new file mode 100644 index 000000000..06d360127 --- /dev/null +++ b/tests/bugs167/pr293510/CaseTwo.java @@ -0,0 +1,17 @@ +package pkg; + +import java.lang.annotation.*; + +class A {public void m() {}} + +class B extends A {public void m() {}} + +class C extends B {public void m() {}} + +aspect X { + pointcut p(): execution(* C.*(..)); + before(): p() {} +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Marker {} diff --git a/tests/bugs167/pr293510/MyService.java b/tests/bugs167/pr293510/MyService.java new file mode 100644 index 000000000..efc5bf9f8 --- /dev/null +++ b/tests/bugs167/pr293510/MyService.java @@ -0,0 +1,6 @@ +package ex; + +@Service +class MyService { + public void serve() {} +} diff --git a/tests/bugs167/pr293510/RooLikeAspect.java b/tests/bugs167/pr293510/RooLikeAspect.java new file mode 100644 index 000000000..ed128e02d --- /dev/null +++ b/tests/bugs167/pr293510/RooLikeAspect.java @@ -0,0 +1,6 @@ +package ex; + +aspect RooLikeAspect { + public void MyService.serve_itd() { + } +} diff --git a/tests/bugs167/pr293510/Service.java b/tests/bugs167/pr293510/Service.java new file mode 100644 index 000000000..25e2d4338 --- /dev/null +++ b/tests/bugs167/pr293510/Service.java @@ -0,0 +1,6 @@ +package ex; +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Service { +} diff --git a/tests/bugs167/pr293510/SupplyMethodCollectedToService.java b/tests/bugs167/pr293510/SupplyMethodCollectedToService.java new file mode 100644 index 000000000..a038ef097 --- /dev/null +++ b/tests/bugs167/pr293510/SupplyMethodCollectedToService.java @@ -0,0 +1,14 @@ +package ex; + +aspect SupplyMethodCollectedToService { + declare @type: @Service * : @MethodCollected; + + pointcut collected() :@within(MethodCollected) && execution(* *(..)); + // pointcut collected2() : execution(* (@MethodCollected *).*(..)); + + before() : collected() { + // Should advice both serve() and serve_itd() + } +// before() : collected2() { } +} +@interface MethodCollected {} -- 2.39.5