]> source.dussan.org Git - aspectj.git/commitdiff
293510: testcode
authoraclement <aclement>
Mon, 2 Nov 2009 16:25:21 +0000 (16:25 +0000)
committeraclement <aclement>
Mon, 2 Nov 2009 16:25:21 +0000 (16:25 +0000)
tests/bugs167/pr293510/A.java [new file with mode: 0644]
tests/bugs167/pr293510/CaseOne.java [new file with mode: 0644]
tests/bugs167/pr293510/CaseTwo.java [new file with mode: 0644]
tests/bugs167/pr293510/MyService.java [new file with mode: 0644]
tests/bugs167/pr293510/RooLikeAspect.java [new file with mode: 0644]
tests/bugs167/pr293510/Service.java [new file with mode: 0644]
tests/bugs167/pr293510/SupplyMethodCollectedToService.java [new file with mode: 0644]

diff --git a/tests/bugs167/pr293510/A.java b/tests/bugs167/pr293510/A.java
new file mode 100644 (file)
index 0000000..a85d605
--- /dev/null
@@ -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 (file)
index 0000000..b351d3e
--- /dev/null
@@ -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 (file)
index 0000000..06d3601
--- /dev/null
@@ -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 (file)
index 0000000..efc5bf9
--- /dev/null
@@ -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 (file)
index 0000000..ed128e0
--- /dev/null
@@ -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 (file)
index 0000000..25e2d43
--- /dev/null
@@ -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 (file)
index 0000000..a038ef0
--- /dev/null
@@ -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 {}