From: aclement Date: Sun, 2 Dec 2007 09:24:51 +0000 (+0000) Subject: tests for 211674 X-Git-Tag: V1_5_4rc1~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9de03b75977599b12208c93c20cfc50fa85d7e22;p=aspectj.git tests for 211674 --- diff --git a/tests/bugs154/pr211674/Test.java b/tests/bugs154/pr211674/Test.java new file mode 100644 index 000000000..0cb1ed514 --- /dev/null +++ b/tests/bugs154/pr211674/Test.java @@ -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 index 000000000..791eabfa3 --- /dev/null +++ b/tests/bugs154/pr211674/Test2.java @@ -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) {} + +} + diff --git a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java index 6560b56bf..76c2eb154 100644 --- a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java @@ -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"); } diff --git a/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml b/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml index 371985a8e..2b333d0b6 100644 --- a/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml +++ b/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml @@ -2,6 +2,16 @@ + + + + + + + + + +