From 52c4b84db0281b3a393179d6ea14618d04467ca4 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 16 Jun 2010 18:11:52 +0000 Subject: [PATCH] 310506: optional aspects --- tests/bugs169/pr310506/Anno.java | 7 +++ tests/bugs169/pr310506/AspectA.java | 5 ++ tests/bugs169/pr310506/AspectB.java | 3 ++ tests/bugs169/pr310506/Code.java | 11 +++++ tests/bugs169/pr310506/Code2.java | 11 +++++ tests/bugs169/pr310506/META-INF/aop.xml | 7 +++ .../systemtest/ajc169/Ajc169Tests.java | 18 +++++--- .../org/aspectj/systemtest/ajc169/ajc169.xml | 46 +++++++++++++++++++ 8 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 tests/bugs169/pr310506/Anno.java create mode 100644 tests/bugs169/pr310506/AspectA.java create mode 100644 tests/bugs169/pr310506/AspectB.java create mode 100644 tests/bugs169/pr310506/Code.java create mode 100644 tests/bugs169/pr310506/Code2.java create mode 100644 tests/bugs169/pr310506/META-INF/aop.xml diff --git a/tests/bugs169/pr310506/Anno.java b/tests/bugs169/pr310506/Anno.java new file mode 100644 index 000000000..f298cf761 --- /dev/null +++ b/tests/bugs169/pr310506/Anno.java @@ -0,0 +1,7 @@ +package a.b.c; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Anno { +} diff --git a/tests/bugs169/pr310506/AspectA.java b/tests/bugs169/pr310506/AspectA.java new file mode 100644 index 000000000..95919fa8f --- /dev/null +++ b/tests/bugs169/pr310506/AspectA.java @@ -0,0 +1,5 @@ +import a.b.c.Anno; + +public aspect AspectA { + before(): execution(@Anno * *(..)) {System.out.println("A");} +} diff --git a/tests/bugs169/pr310506/AspectB.java b/tests/bugs169/pr310506/AspectB.java new file mode 100644 index 000000000..6f6ac8e62 --- /dev/null +++ b/tests/bugs169/pr310506/AspectB.java @@ -0,0 +1,3 @@ +public aspect AspectB { + before():staticinitialization(!Aspect*) { System.out.println("staticinitialization");} +} diff --git a/tests/bugs169/pr310506/Code.java b/tests/bugs169/pr310506/Code.java new file mode 100644 index 000000000..07ea2520b --- /dev/null +++ b/tests/bugs169/pr310506/Code.java @@ -0,0 +1,11 @@ +import java.lang.annotation.*; + +@Blah +public class Code { + public static void main(String[] argv) { + System.out.println("abcde"); + } +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Blah {} diff --git a/tests/bugs169/pr310506/Code2.java b/tests/bugs169/pr310506/Code2.java new file mode 100644 index 000000000..bb48df62a --- /dev/null +++ b/tests/bugs169/pr310506/Code2.java @@ -0,0 +1,11 @@ +import java.lang.annotation.*; +import a.b.c.*; + +@Anno +public class Code2 { + @Anno + public static void main(String[] argv) { + System.out.println("abcde"); + } +} + diff --git a/tests/bugs169/pr310506/META-INF/aop.xml b/tests/bugs169/pr310506/META-INF/aop.xml new file mode 100644 index 000000000..c9b57ca67 --- /dev/null +++ b/tests/bugs169/pr310506/META-INF/aop.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java b/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java index a350ed06c..5c339c3f5 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java @@ -18,24 +18,30 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc169Tests extends org.aspectj.testing.XMLBasedAjcTestCase { -// public void testClashingDeclareAnnos_313026_1() { -// runTest("clashing declare annos"); -// } + public void testOptionalAspects_pr310506() { + runTest("optional aspects"); + } + + public void testOptionalAspects_pr310506_2() { + runTest("optional aspects 2"); + } + + // public void testClashingDeclareAnnos_313026_1() { + // runTest("clashing declare annos"); + // } public void testInfiniteLoop_pr315651() { runTest("infinite loop"); } - + public void testAnnoType_pr314965() { runTest("anno typo"); } - public void testValidateBranchRecursion_314840() { runTest("validate branch recursion"); } - public void testClassFileSize_312839_1() { runTest("class file size - 1"); // 2531 (0x404): 1.6.9.M2 size of Class.class diff --git a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml index 3e5ba7b0e..58a61d56e 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml +++ b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml @@ -2,6 +2,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5