diff options
author | aclement <aclement> | 2008-07-07 22:32:39 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-07-07 22:32:39 +0000 |
commit | ad03f314f66a7c49737f32fc23b4aea6bef3d8cf (patch) | |
tree | 8e533b3820ac979178e97c4c2f8179076e12d18b /tests | |
parent | 3d5b79a6b05bb26b025e9e9e7d4ad2772a85d023 (diff) | |
download | aspectj-ad03f314f66a7c49737f32fc23b4aea6bef3d8cf.tar.gz aspectj-ad03f314f66a7c49737f32fc23b4aea6bef3d8cf.zip |
238992: test and fix
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs162/pr238992/Foo.java | 36 | ||||
-rw-r--r-- | tests/bugs162/pr238992/Foo2.java | 36 | ||||
-rw-r--r-- | tests/bugs162/pr238992/Foo3.java | 36 | ||||
-rw-r--r-- | tests/bugs162/pr238992/Foo4.java | 36 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java | 8 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/ajc162.xml | 30 |
6 files changed, 180 insertions, 2 deletions
diff --git a/tests/bugs162/pr238992/Foo.java b/tests/bugs162/pr238992/Foo.java new file mode 100644 index 000000000..d4fe3600d --- /dev/null +++ b/tests/bugs162/pr238992/Foo.java @@ -0,0 +1,36 @@ +import java.lang.annotation.*; +import java.io.*; + +@Entity(indexed=false) +public class Foo { + public static void main(String []argv) { + Foo f = new Foo(); + Goo g = new Goo(); + if (f instanceof Serializable) { + throw new RuntimeException("Foo should not implement it"); + } + if (!(g instanceof Serializable)) { + throw new RuntimeException("Goo should implement it"); + } + if (new Hoo() instanceof Serializable) { + throw new RuntimeException("Hoo should not implement it"); + } + } +} + +@Entity(indexed=true) +class Goo { +} + +@Entity // default is false +class Hoo { +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Entity { + boolean indexed() default false; +} + +aspect X { + declare parents: (@Entity(indexed=true) *) implements java.io.Serializable; +} diff --git a/tests/bugs162/pr238992/Foo2.java b/tests/bugs162/pr238992/Foo2.java new file mode 100644 index 000000000..38f496dd5 --- /dev/null +++ b/tests/bugs162/pr238992/Foo2.java @@ -0,0 +1,36 @@ +import java.lang.annotation.*; +import java.io.*; + +@Entity(indexed=false) +public class Foo2 { + public static void main(String []argv) { + Foo2 f = new Foo2(); + Goo g = new Goo(); + if (f instanceof Serializable) { + throw new RuntimeException("Foo2 should not implement it"); + } + if (!(g instanceof Serializable)) { + throw new RuntimeException("Goo should implement it"); + } + if (!(new Hoo() instanceof Serializable)) { + throw new RuntimeException("Hoo should implement it"); + } + } +} + +@Entity(indexed=true) +class Goo { +} + +@Entity // default is true +class Hoo { +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Entity { + boolean indexed() default true; +} + +aspect X { + declare parents: (@Entity(indexed=true) *) implements java.io.Serializable; +} diff --git a/tests/bugs162/pr238992/Foo3.java b/tests/bugs162/pr238992/Foo3.java new file mode 100644 index 000000000..5935688ed --- /dev/null +++ b/tests/bugs162/pr238992/Foo3.java @@ -0,0 +1,36 @@ +import java.lang.annotation.*; +import java.io.*; + +@Entity(i=1) +public class Foo3 { + public static void main(String []argv) { + Foo3 f = new Foo3(); + Goo g = new Goo(); + if (f instanceof Serializable) { + throw new RuntimeException("Foo3 should not implement it"); + } + if (!(g instanceof Serializable)) { + throw new RuntimeException("Goo should implement it"); + } + if (new Hoo() instanceof Serializable) { + throw new RuntimeException("Hoo should not implement it"); + } + } +} + +@Entity(i=2) +class Goo { +} + +@Entity // default is 1 +class Hoo { +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Entity { + int i() default 1; +} + +aspect X { + declare parents: (@Entity(i=2) *) implements java.io.Serializable; +} diff --git a/tests/bugs162/pr238992/Foo4.java b/tests/bugs162/pr238992/Foo4.java new file mode 100644 index 000000000..87ee3c6b2 --- /dev/null +++ b/tests/bugs162/pr238992/Foo4.java @@ -0,0 +1,36 @@ +import java.lang.annotation.*; +import java.io.*; + +@Entity(i=1) +public class Foo4 { + public static void main(String []argv) { + Foo4 f = new Foo4(); + Goo g = new Goo(); + if (f instanceof Serializable) { + throw new RuntimeException("Foo4 should not implement it"); + } + if (!(g instanceof Serializable)) { + throw new RuntimeException("Goo should implement it"); + } + if (!(new Hoo() instanceof Serializable)) { + throw new RuntimeException("Hoo should implement it"); + } + } +} + +@Entity(i=2) +class Goo { +} + +@Entity // default is 2 +class Hoo { +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Entity { + int i() default 2; +} + +aspect X { + declare parents: (@Entity(i=2) *) implements java.io.Serializable; +} diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java index d8d539b24..2cb1d3826 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java @@ -19,8 +19,12 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.2 - public void testAnnotationDecp_pr239441() { runTest("annotation decp"); } - +// public void testAnnotationDecp_pr239441() { runTest("annotation decp"); } + public void testAnnotationValueDecp_pr238992() { runTest("annotation value decp"); } + public void testAnnotationValueDecp_pr238992_2() { runTest("annotation value decp - 2"); } + public void testAnnotationValueDecp_pr238992_3() { runTest("annotation value decp - 3"); } + public void testAnnotationValueDecp_pr238992_4() { runTest("annotation value decp - 4"); } + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Ajc162Tests.class); } diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml index 08e86272d..5b2b599ba 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml @@ -7,5 +7,35 @@ <compile files="Test3.java SampleAspect.java" options="-1.5 -showWeaveInfo -XhasMember"> </compile> </ajc-test> + + <ajc-test dir="bugs162/pr238992" title="annotation value decp"> + <compile files="Foo.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Extending interface set for type 'Goo'"/> + </compile> + <run class="Foo"/> + </ajc-test> + + <ajc-test dir="bugs162/pr238992" title="annotation value decp - 2"> + <compile files="Foo2.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Extending interface set for type 'Goo'"/> + <message kind="weave" text="Extending interface set for type 'Hoo'"/> + </compile> + <run class="Foo2"/> + </ajc-test> + + <ajc-test dir="bugs162/pr238992" title="annotation value decp - 3"> + <compile files="Foo3.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Extending interface set for type 'Goo'"/> + </compile> + <run class="Foo3"/> + </ajc-test> + + <ajc-test dir="bugs162/pr238992" title="annotation value decp - 4"> + <compile files="Foo4.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Extending interface set for type 'Goo'"/> + <message kind="weave" text="Extending interface set for type 'Hoo'"/> + </compile> + <run class="Foo4"/> + </ajc-test> </suite>
\ No newline at end of file |