diff options
author | aclement <aclement> | 2011-09-07 22:00:30 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-09-07 22:00:30 +0000 |
commit | 6398f8e61d6ccffe14cdf62bfbf9b737fb25eddc (patch) | |
tree | 6f3a8d2b3e56162f3ac0b66eb9a66ce95432a39b /tests | |
parent | 668a0fbd632c4d4862f06d10fa01f2d10fa4689f (diff) | |
download | aspectj-6398f8e61d6ccffe14cdf62bfbf9b737fb25eddc.tar.gz aspectj-6398f8e61d6ccffe14cdf62bfbf9b737fb25eddc.zip |
357012/357013
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs1612/prx/C.java | 9 | ||||
-rw-r--r-- | tests/bugs1612/prx/D.java | 15 | ||||
-rw-r--r-- | tests/bugs1612/prx/E.java | 23 | ||||
-rw-r--r-- | tests/bugs1612/prx/F.java | 27 | ||||
-rw-r--r-- | tests/bugs1612/prx/G.java | 23 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java | 18 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml | 35 |
7 files changed, 135 insertions, 15 deletions
diff --git a/tests/bugs1612/prx/C.java b/tests/bugs1612/prx/C.java index e82f44ad5..6b8c336b3 100644 --- a/tests/bugs1612/prx/C.java +++ b/tests/bugs1612/prx/C.java @@ -3,22 +3,21 @@ import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) @interface Anno { Class value(); -//int i(); } public class C { @Anno(String.class) - //@Anno(i=3) public int i; + @Anno(Integer.class) + public int j; + public static void main(String []argv) { System.out.println(new C().i); + System.out.println(new C().j); } } - aspect X { - //before(): get(@Anno(String.class) * *(..)) {} before(): get(@Anno(value=String.class) * *) {} - //before(): get(@Anno(i=3) * *) {} } diff --git a/tests/bugs1612/prx/D.java b/tests/bugs1612/prx/D.java index 058bf8c3c..028022b26 100644 --- a/tests/bugs1612/prx/D.java +++ b/tests/bugs1612/prx/D.java @@ -5,16 +5,23 @@ import java.lang.annotation.*; int i(); } -public class C { +public class D { @Anno(i=3) public int i; + @Anno(i=4) + public int j; + + @Anno(i=5) + public int k; + public static void main(String []argv) { - System.out.println(new C().i); + System.out.println(new D().i); + System.out.println(new D().j); + System.out.println(new D().k); } } - aspect X { - before(): get(@Anno(i!=3) * *) {} + before(): get(@Anno(i!=5) * *) {} } diff --git a/tests/bugs1612/prx/E.java b/tests/bugs1612/prx/E.java new file mode 100644 index 000000000..bf9584b25 --- /dev/null +++ b/tests/bugs1612/prx/E.java @@ -0,0 +1,23 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + Class value() default String.class; +} + +public class E { + + @Anno + public int i; + + @Anno(Integer.class) + public int j; + + public static void main(String []argv) { + System.out.println(new E().i); + System.out.println(new E().j); + } +} +aspect X { + before(): get(@Anno(value=String.class) * *) {} +} diff --git a/tests/bugs1612/prx/F.java b/tests/bugs1612/prx/F.java new file mode 100644 index 000000000..6945024b9 --- /dev/null +++ b/tests/bugs1612/prx/F.java @@ -0,0 +1,27 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { +Class i() default Number.class; +} + +public class F { + + @Anno(i=Integer.class) + public int i; + + @Anno + public int j; + + @Anno(i=String.class) + public int k; + + public static void main(String []argv) { + System.out.println(new F().i); + System.out.println(new F().j); + System.out.println(new F().k); + } +} +aspect X { + before(): get(@Anno(i!=String.class) * *) {} +} diff --git a/tests/bugs1612/prx/G.java b/tests/bugs1612/prx/G.java new file mode 100644 index 000000000..8158d6b25 --- /dev/null +++ b/tests/bugs1612/prx/G.java @@ -0,0 +1,23 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + Class value(); +} + +public class G { + + @Anno(String.class) + public int i; + + @Anno(Integer.class) + public int j; + + public static void main(String []argv) { + System.out.println(new G().i); + System.out.println(new G().j); + } +} +aspect X { + before(): get(@Anno(value=Foo.class) * *) {} +} diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java index a6182f18e..27f6c58ae 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java @@ -35,12 +35,24 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // runTest("itd split compilation"); // } - public void testClassRef() throws Exception { + public void testNotEqualWithAnnotationValues_357013() throws Exception { + runTest("annotation values not equal"); + } + + public void testNotEqualWithAnnotationValues_357013_2() throws Exception { + runTest("annotation values not equal 2"); + } + + public void testClassRef_357012() throws Exception { runTest("class reference in annotation value"); } - public void testClassRef2() throws Exception { - runTest("class reference in annotation value 2"); + public void testClassRefInvalidName_357012_2() throws Exception { + runTest("class reference in annotation value - invalid typename"); + } + + public void testClassRef_357012_3() throws Exception { + runTest("class reference in annotation value 3"); } public void testAnnotationFieldBindingOptimization_356612() throws Exception { diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml index 60ba01244..efabde26a 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -3,17 +3,46 @@ <suite> <ajc-test dir="bugs1612/prx" title="class reference in annotation value"> -<compile files="C.java" options="-1.5"/> +<compile files="C.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/> +</compile> <run class="C"> </run> </ajc-test> -<ajc-test dir="bugs1612/prx" title="class reference in annotation value 2"> -<compile files="D.java" options="-1.5"/> +<ajc-test dir="bugs1612/prx" title="annotation values not equal"> +<compile files="D.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int D.i)' in Type 'D' (D.java:20) advised by before advice from 'X' (D.java:26)"/> +<message kind="weave" text="Join point 'field-get(int D.j)' in Type 'D' (D.java:21) advised by before advice from 'X' (D.java:26)"/> +</compile> <run class="D"> </run> </ajc-test> +<ajc-test dir="bugs1612/prx" title="class reference in annotation value 3"> +<compile files="E.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int E.i)' in Type 'E' (E.java:17) advised by before advice from 'X' (E.java:22)"/> +</compile> +<run class="E"> +</run> +</ajc-test> + +<ajc-test dir="bugs1612/prx" title="annotation values not equal 2"> +<compile files="F.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int F.i)' in Type 'F' (F.java:20) advised by before advice from 'X' (F.java:26)"/> +<message kind="weave" text="Join point 'field-get(int F.j)' in Type 'F' (F.java:21) advised by before advice from 'X' (F.java:26)"/> +</compile> +<run class="F"> +</run> +</ajc-test> + + +<ajc-test dir="bugs1612/prx" title="class reference in annotation value - invalid typename"> +<compile files="G.java" options="-1.5 -showWeaveInfo"> +<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/> +</compile> +</ajc-test> + <ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization"> <compile files="AnnoBinding.java" options="-1.5"/> <run class="AnnoBinding"> |