From: aclement Date: Sat, 27 Nov 2010 06:23:20 +0000 (+0000) Subject: annotation removal - extra checks X-Git-Tag: V1_6_11M1~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=03de7d656faafc1ac55d9994b9e311c860d97a52;p=aspectj.git annotation removal - extra checks --- diff --git a/tests/features1611/declareMinus/Unsupported.java b/tests/features1611/declareMinus/Unsupported.java new file mode 100644 index 000000000..4275b5aec --- /dev/null +++ b/tests/features1611/declareMinus/Unsupported.java @@ -0,0 +1,24 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + String foo(); +} + +@Anno(foo="anc") +aspect X { + + //declare @method: int i: -@Anno; + declare @method: int i(..): -@Anno; + declare @type: X: -@Anno; + declare @field: int i: -@Anno(foo="abc"); + + public static void main(String[] args) throws Exception { + if (X.class.getDeclaredField("i").getAnnotation(Anno.class)==null) { + System.out.println("not there"); + } else { + System.out.println("failed"); + } + } +} \ No newline at end of file diff --git a/tests/features1611/declareMinus/WithValues.java b/tests/features1611/declareMinus/WithValues.java new file mode 100644 index 000000000..a756c2e23 --- /dev/null +++ b/tests/features1611/declareMinus/WithValues.java @@ -0,0 +1,22 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + String foo(); +} + +public aspect WithValues { + @Anno(foo="anc") + int i; + + declare @field: int i: -@Anno; + + public static void main(String[] args) throws Exception { + if (WithValues.class.getDeclaredField("i").getAnnotation(Anno.class)==null) { + System.out.println("not there"); + } else { + System.out.println("failed"); + } + } +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc1611/NewFeatures.java b/tests/src/org/aspectj/systemtest/ajc1611/NewFeatures.java index 5fd491f61..3df8d1a00 100644 --- a/tests/src/org/aspectj/systemtest/ajc1611/NewFeatures.java +++ b/tests/src/org/aspectj/systemtest/ajc1611/NewFeatures.java @@ -54,6 +54,14 @@ public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("declare minus - multifiles - 3"); } + public void testDeclareMinusWithValues() { + runTest("declare minus - with values"); + } + + public void testDeclareMinusUnsupported() { + runTest("declare minus - unsupported"); + } + public void testBinaryWeaving() { runTest("binary weaving"); } diff --git a/tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml b/tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml index d8bae42fb..ff56008a8 100644 --- a/tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml @@ -104,6 +104,22 @@ + + + + + + + + + + + + + + + +