From: aclement Date: Thu, 21 Sep 2006 13:03:02 +0000 (+0000) Subject: test code for 158126 - already fixed ;) just a nice test to have X-Git-Tag: BEFORE_133532~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9d1a56b3e8a0ffd055986e08612e3baf30efc25f;p=aspectj.git test code for 158126 - already fixed ;) just a nice test to have --- diff --git a/tests/bugs153/pr158126/A.java b/tests/bugs153/pr158126/A.java new file mode 100644 index 000000000..d92c77fcb --- /dev/null +++ b/tests/bugs153/pr158126/A.java @@ -0,0 +1,17 @@ +public class A { + + @MyAnnotation + public A() { + new B(); + } + + @MyAnnotation + public A(int i) { + new B(i); + } + + public static void main(String[] args) { + new A(); + new A(1); + } +} diff --git a/tests/bugs153/pr158126/B.java b/tests/bugs153/pr158126/B.java new file mode 100644 index 000000000..bdbfa788d --- /dev/null +++ b/tests/bugs153/pr158126/B.java @@ -0,0 +1,12 @@ +public class B { + + @MyAnnotation + public B() { + + } + + @MyAnnotation + public B(int i) { + + } +} diff --git a/tests/bugs153/pr158126/MyAnnotation.java b/tests/bugs153/pr158126/MyAnnotation.java new file mode 100644 index 000000000..33d13ead8 --- /dev/null +++ b/tests/bugs153/pr158126/MyAnnotation.java @@ -0,0 +1,7 @@ +import java.lang.annotation.*; + +@Target(ElementType.CONSTRUCTOR) +@Retention(RetentionPolicy.RUNTIME) +public @interface MyAnnotation { + +} diff --git a/tests/bugs153/pr158126/MyAspect.java b/tests/bugs153/pr158126/MyAspect.java new file mode 100644 index 000000000..0ab4a323e --- /dev/null +++ b/tests/bugs153/pr158126/MyAspect.java @@ -0,0 +1,7 @@ +public aspect MyAspect { + + before() : + call(@MyAnnotation *.new(..)) { + System.out.println(thisJoinPoint); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java index 4c8fdd0cd..7e6c95f56 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java @@ -28,6 +28,7 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); } // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");} // public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); } + public void testAnnotationsCallConstructors_pr158126() { runTest("annotations, call and constructors problem");} public void testIllegalStateExceptionGenerics_pr153845() { runTest("IllegalStateException at GenericSignatureParser.java"); } public void testNoIllegalStateExceptionFromAsmDelegate_pr153490_1() { runTest("no illegal state exception from AsmDelegate - 1");} public void testNoIllegalStateExceptionFromAsmDelegate_pr153490_2() { runTest("no illegal state exception from AsmDelegate - 2");} diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index 2beddab01..665c73c0f 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -8,6 +8,15 @@ + + + + + + + + +