]> source.dussan.org Git - aspectj.git/commitdiff
252722: test and fix: generated super dispatch methods
authoraclement <aclement>
Mon, 15 Dec 2008 21:28:34 +0000 (21:28 +0000)
committeraclement <aclement>
Mon, 15 Dec 2008 21:28:34 +0000 (21:28 +0000)
tests/bugs163/pr252722/A.java [new file with mode: 0644]
tests/bugs163/pr252722/ACode.java [new file with mode: 0644]
tests/bugs163/pr252722/B.java [new file with mode: 0644]
tests/bugs163/pr252722/BCode.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
tests/src/org/aspectj/systemtest/ajc163/ajc163.xml

diff --git a/tests/bugs163/pr252722/A.java b/tests/bugs163/pr252722/A.java
new file mode 100644 (file)
index 0000000..35ae945
--- /dev/null
@@ -0,0 +1,24 @@
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+
+abstract aspect Super {
+  void foo(String s) {}
+}
+
+@Aspect
+public class A extends Super {
+
+       @Around("execution(* m(..))")
+       public void invoke(ProceedingJoinPoint pjp) {
+               super.foo("hello");
+       }
+
+
+       public static void main(String []argv) {
+               new A().m();
+       }
+
+       public void m() {}
+}
+
diff --git a/tests/bugs163/pr252722/ACode.java b/tests/bugs163/pr252722/ACode.java
new file mode 100644 (file)
index 0000000..672a5b3
--- /dev/null
@@ -0,0 +1,21 @@
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+
+abstract aspect Super {
+  void foo(String s,int i) {}
+}
+
+public aspect ACode extends Super {
+
+       void around(): execution(* m(..)) {
+               super.foo("hello",7);
+       }
+
+       public static void main(String []argv) {
+               ACode.m();
+       }
+
+       public static void m() {}
+}
+
diff --git a/tests/bugs163/pr252722/B.java b/tests/bugs163/pr252722/B.java
new file mode 100644 (file)
index 0000000..23b516f
--- /dev/null
@@ -0,0 +1,28 @@
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+// Now the joinpoint is in a different type, does the super call from advice still work OK?
+
+
+abstract aspect Super {
+  void foo(String s) {}
+}
+
+@Aspect
+public class B extends Super {
+
+       @Around("execution(* m(..))")
+       public void invoke(ProceedingJoinPoint pjp) {
+               super.foo("hello");
+       }
+
+       public static void main(String []argv) {
+               new C().m();
+       }
+}
+
+class C { 
+
+       public void m() {}
+}
+
diff --git a/tests/bugs163/pr252722/BCode.java b/tests/bugs163/pr252722/BCode.java
new file mode 100644 (file)
index 0000000..1773ac0
--- /dev/null
@@ -0,0 +1,24 @@
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+
+abstract aspect Super {
+  void foo(String s) {}
+}
+
+public aspect BCode extends Super {
+
+       void around(): execution(* m(..)) {
+               super.foo("hello");
+       }
+
+       public static void main(String []argv) {
+               new C().m();
+       }
+}
+
+class C { 
+
+       public void m() {}
+}
+
index 0ad817a72f268a06193fd6eee4b117931b33ec74..a6c3900f4be3cdbc2d182b1828ff646902c1cfb1 100644 (file)
@@ -31,6 +31,22 @@ public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        // runTest("itd anonymous inner class in wrong package");
        // }
 
+       public void testExtendingASI_pr252722() {
+               runTest("extending AbstractSecurityInterceptor");
+       }
+
+       public void testExtendingASI_pr252722_2() {
+               runTest("extending AbstractSecurityInterceptor - 2");
+       }
+
+       public void testExtendingASI_pr252722_3() {
+               runTest("extending AbstractSecurityInterceptor - 3");
+       }
+
+       public void testExtendingASI_pr252722_4() {
+               runTest("extending AbstractSecurityInterceptor - 4");
+       }
+
        public void testGetNode_pr258653() {
                runTest("getNode");
        }
index 9a3ee182daa5bd52a65536b6f290abf569873803..cf8c9cf61472c81f3cc8a9aa96e31d8f0b75919d 100644 (file)
@@ -5,6 +5,26 @@
     <ajc-test dir="bugs163/pr258653" title="getNode">
          <compile files="staticinit.java" options="-1.5 -emacssym"/>
     </ajc-test>
+    
+    <ajc-test dir="bugs163/pr252722" title="extending AbstractSecurityInterceptor">
+         <compile files="A.java" options="-1.5"/>
+         <run class="A"/>
+    </ajc-test>
+    
+    <ajc-test dir="bugs163/pr252722" title="extending AbstractSecurityInterceptor - 2">
+         <compile files="ACode.java" options="-1.5"/>
+         <run class="ACode"/>
+    </ajc-test>
+    
+    <ajc-test dir="bugs163/pr252722" title="extending AbstractSecurityInterceptor - 3">
+         <compile files="B.java" options="-1.5"/>
+         <run class="B"/>
+    </ajc-test>
+    
+    <ajc-test dir="bugs163/pr252722" title="extending AbstractSecurityInterceptor - 4">
+         <compile files="BCode.java" options="-1.5"/>
+         <run class="BCode"/>
+    </ajc-test>
 
     <ajc-test dir="bugs163/pr154427" title="getMethod returning null">
          <compile files="AuthorizationImpl.java Authorization.java AuthorizationAdmin.java CallAndMethodSignatureAspect.java CallTest.java" options=""/>