]> source.dussan.org Git - aspectj.git/commitdiff
testcode for 169432 and 209019
authoraclement <aclement>
Wed, 7 Nov 2007 14:55:17 +0000 (14:55 +0000)
committeraclement <aclement>
Wed, 7 Nov 2007 14:55:17 +0000 (14:55 +0000)
15 files changed:
tests/bugs154/pr169432/ClassThatAlreadyIncludesRequiredMethods.java [new file with mode: 0644]
tests/bugs154/pr169432/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java [new file with mode: 0644]
tests/bugs154/pr169432/NonMarkerInterface.java [new file with mode: 0644]
tests/bugs154/pr209019/case1/A.java [new file with mode: 0644]
tests/bugs154/pr209019/case1/AbstractDurationMethod.java [new file with mode: 0644]
tests/bugs154/pr209019/case1/DurationMethod.java [new file with mode: 0644]
tests/bugs154/pr209019/case1/Runner.java [new file with mode: 0644]
tests/bugs154/pr209019/case2/A.java [new file with mode: 0644]
tests/bugs154/pr209019/case2/AbstractDurationMethod.java [new file with mode: 0644]
tests/bugs154/pr209019/case2/AtDurationMethod.java [new file with mode: 0644]
tests/bugs154/pr209019/case2/Runner.java [new file with mode: 0644]
tests/bugs154/pr209019/case3/A.java [new file with mode: 0644]
tests/bugs154/pr209019/case3/AbstractDurationMethod.java [new file with mode: 0644]
tests/bugs154/pr209019/case3/Runner.java [new file with mode: 0644]
tests/bugs154/pr209019/case3/aop.xml [new file with mode: 0644]

diff --git a/tests/bugs154/pr169432/ClassThatAlreadyIncludesRequiredMethods.java b/tests/bugs154/pr169432/ClassThatAlreadyIncludesRequiredMethods.java
new file mode 100644 (file)
index 0000000..1667496
--- /dev/null
@@ -0,0 +1,6 @@
+package test;
+
+public class ClassThatAlreadyIncludesRequiredMethods {
+        public void something() {
+        }
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java b/tests/bugs154/pr169432/DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java
new file mode 100644 (file)
index 0000000..4d63e48
--- /dev/null
@@ -0,0 +1,11 @@
+package test;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.DeclareParents;
+
+@Aspect
+public class
+DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods {
+        @DeclareParents("test.ClassThatAlreadyIncludesRequiredMethods")
+        public NonMarkerInterface nmi;
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr169432/NonMarkerInterface.java b/tests/bugs154/pr169432/NonMarkerInterface.java
new file mode 100644 (file)
index 0000000..753ad61
--- /dev/null
@@ -0,0 +1,5 @@
+package test;
+
+public interface NonMarkerInterface {
+        public void something();
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr209019/case1/A.java b/tests/bugs154/pr209019/case1/A.java
new file mode 100644 (file)
index 0000000..838d4b5
--- /dev/null
@@ -0,0 +1,13 @@
+package a.b;
+
+public class A {
+  public Object m1() {
+    return m2();
+  }
+
+  public Object m2() {
+    return m3();
+  }
+  public Object m3() {return "x";}
+}
diff --git a/tests/bugs154/pr209019/case1/AbstractDurationMethod.java b/tests/bugs154/pr209019/case1/AbstractDurationMethod.java
new file mode 100644 (file)
index 0000000..ff397ca
--- /dev/null
@@ -0,0 +1,11 @@
+package c.d;
+
+public abstract aspect AbstractDurationMethod {
+   public abstract pointcut methods();
+
+   Object around(): methods() {
+       Object o = proceed();
+       System.out.println("Proceeded at joinpoint "+thisJoinPoint);
+       return o;
+   }
+}
diff --git a/tests/bugs154/pr209019/case1/DurationMethod.java b/tests/bugs154/pr209019/case1/DurationMethod.java
new file mode 100644 (file)
index 0000000..6011c4c
--- /dev/null
@@ -0,0 +1,5 @@
+package c.d;;
+
+public aspect DurationMethod extends AbstractDurationMethod {
+  public pointcut methods(): within(a.b.*) &&  call (public * a..*(..));
+}
diff --git a/tests/bugs154/pr209019/case1/Runner.java b/tests/bugs154/pr209019/case1/Runner.java
new file mode 100644 (file)
index 0000000..b414116
--- /dev/null
@@ -0,0 +1,7 @@
+import a.b.*;
+
+public class Runner {
+  public static void main(String []argv) {
+    new A().m1();
+  }
+}
diff --git a/tests/bugs154/pr209019/case2/A.java b/tests/bugs154/pr209019/case2/A.java
new file mode 100644 (file)
index 0000000..838d4b5
--- /dev/null
@@ -0,0 +1,13 @@
+package a.b;
+
+public class A {
+  public Object m1() {
+    return m2();
+  }
+
+  public Object m2() {
+    return m3();
+  }
+  public Object m3() {return "x";}
+}
diff --git a/tests/bugs154/pr209019/case2/AbstractDurationMethod.java b/tests/bugs154/pr209019/case2/AbstractDurationMethod.java
new file mode 100644 (file)
index 0000000..ff397ca
--- /dev/null
@@ -0,0 +1,11 @@
+package c.d;
+
+public abstract aspect AbstractDurationMethod {
+   public abstract pointcut methods();
+
+   Object around(): methods() {
+       Object o = proceed();
+       System.out.println("Proceeded at joinpoint "+thisJoinPoint);
+       return o;
+   }
+}
diff --git a/tests/bugs154/pr209019/case2/AtDurationMethod.java b/tests/bugs154/pr209019/case2/AtDurationMethod.java
new file mode 100644 (file)
index 0000000..2fc5ea3
--- /dev/null
@@ -0,0 +1,9 @@
+package c.d;
+
+import org.aspectj.lang.annotation.*;
+
+@Aspect
+public class AtDurationMethod extends AbstractDurationMethod {
+  @Pointcut("within(a.b.*) && call(public * a..*(..))")
+  public void methods()  {}
+}
diff --git a/tests/bugs154/pr209019/case2/Runner.java b/tests/bugs154/pr209019/case2/Runner.java
new file mode 100644 (file)
index 0000000..b414116
--- /dev/null
@@ -0,0 +1,7 @@
+import a.b.*;
+
+public class Runner {
+  public static void main(String []argv) {
+    new A().m1();
+  }
+}
diff --git a/tests/bugs154/pr209019/case3/A.java b/tests/bugs154/pr209019/case3/A.java
new file mode 100644 (file)
index 0000000..838d4b5
--- /dev/null
@@ -0,0 +1,13 @@
+package a.b;
+
+public class A {
+  public Object m1() {
+    return m2();
+  }
+
+  public Object m2() {
+    return m3();
+  }
+  public Object m3() {return "x";}
+}
diff --git a/tests/bugs154/pr209019/case3/AbstractDurationMethod.java b/tests/bugs154/pr209019/case3/AbstractDurationMethod.java
new file mode 100644 (file)
index 0000000..ff397ca
--- /dev/null
@@ -0,0 +1,11 @@
+package c.d;
+
+public abstract aspect AbstractDurationMethod {
+   public abstract pointcut methods();
+
+   Object around(): methods() {
+       Object o = proceed();
+       System.out.println("Proceeded at joinpoint "+thisJoinPoint);
+       return o;
+   }
+}
diff --git a/tests/bugs154/pr209019/case3/Runner.java b/tests/bugs154/pr209019/case3/Runner.java
new file mode 100644 (file)
index 0000000..b414116
--- /dev/null
@@ -0,0 +1,7 @@
+import a.b.*;
+
+public class Runner {
+  public static void main(String []argv) {
+    new A().m1();
+  }
+}
diff --git a/tests/bugs154/pr209019/case3/aop.xml b/tests/bugs154/pr209019/case3/aop.xml
new file mode 100644 (file)
index 0000000..8b79710
--- /dev/null
@@ -0,0 +1,11 @@
+<aspectj>
+    <aspects>
+        <aspect name="c.d.AbstractDurationMethod"/>
+        <concrete-aspect name="c.d.AtDurationMethod"
+           extends="c.d.AbstractDurationMethod">
+           <pointcut name="methods"
+               expression="within(a.b.*) AND call (public * a..*(..))" />
+        </concrete-aspect> 
+    </aspects>
+    <weaver/>
+</aspectj>