]> source.dussan.org Git - aspectj.git/commitdiff
tests for 211674
authoraclement <aclement>
Sun, 2 Dec 2007 09:24:51 +0000 (09:24 +0000)
committeraclement <aclement>
Sun, 2 Dec 2007 09:24:51 +0000 (09:24 +0000)
tests/bugs154/pr211674/Test.java [new file with mode: 0644]
tests/bugs154/pr211674/Test2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
tests/src/org/aspectj/systemtest/ajc154/ajc154.xml

diff --git a/tests/bugs154/pr211674/Test.java b/tests/bugs154/pr211674/Test.java
new file mode 100644 (file)
index 0000000..0cb1ed5
--- /dev/null
@@ -0,0 +1,29 @@
+import java.lang.annotation.*;
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+@Aspect class A {
+
+  @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)")
+        void annotatedMethods(Tracing tracing) { }
+       
+        @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t")
+        public void logException(JoinPoint thisJoinPoint, Tracing tracing,Throwable t) {
+        }
+
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Tracing { }
+
+public class Test {
+
+  @Tracing
+  public void m() {}
+
+
+  public static void main(String []argv) {}
+   
+
+}
+
diff --git a/tests/bugs154/pr211674/Test2.java b/tests/bugs154/pr211674/Test2.java
new file mode 100644 (file)
index 0000000..791eabf
--- /dev/null
@@ -0,0 +1,27 @@
+import java.lang.annotation.*;
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.*;
+
+@Aspect class A {
+
+  @Pointcut("execution(@Tracing * *(..)) && @annotation(tracing)")
+        void annotatedMethods(Tracing tracing) { }
+       
+        @AfterThrowing(pointcut = "annotatedMethods(tracing)", throwing = "t")
+        public void logException(JoinPoint thisJoinPoint, Throwable t,Tracing tracing) {
+        }
+
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Tracing { }
+
+public class Test2 {
+
+  @Tracing
+  public void m() {}
+
+  public static void main(String []argv) {}
+
+}
+
index 6560b56bf707a2748c7c0c6c2213a2ab86425b28..76c2eb154740386113f94b5ae8e7199735c75834 100644 (file)
@@ -44,6 +44,9 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 //     //parser.registerPointcutDesignatorHandler(beanHandler);
 //             runTest("new pointcut designators in a reference pointcut");
 //     }
+       //public void testAfterThrowingAnnotationStyle_pr211674_1() { runTest("after throwing annotation style problem - 1");}
+       //public void testAfterThrowingAnnotationStyle_pr211674_2() { runTest("after throwing annotation style problem - 2");}
+
        public void testNPEWithMissingAtAspectAnnotationInPointcutLibrary_pr162539_1() { runTest("NPE with missing @aspect annotation in pointcut library - 1"); }
        public void testNPEWithMissingAtAspectAnnotationInPointcutLibrary_pr162539_2() { runTest("NPE with missing @aspect annotation in pointcut library - 2"); }
         
index 371985a8ef747d1fdd75d9d2978688cdab770786..2b333d0b641a9fd8b876a8988ca6ff715930fdc0 100644 (file)
@@ -2,6 +2,16 @@
 
 <!-- AspectJ v1.6.0 Tests -->
 <suite>
+   <ajc-test dir="bugs154/pr211674" title="after throwing annotation style problem - 1">
+     <compile options="-1.5" files="Test.java"/>
+     <run class="Test"/>
+   </ajc-test>
+
+   <ajc-test dir="bugs154/pr211674" title="after throwing annotation style problem - 2">
+     <compile options="-1.5" files="Test2.java"/>
+     <run class="Test2"/>
+   </ajc-test>
+
    <ajc-test dir="bugs154/pr194314" title="broken lvt for woven at aspectj around advice">
      <compile options="-1.5" files="test/IService.java,test/Main.java,test/Service.java,test/ServiceInterceptor.java"/>
    </ajc-test>