summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2008-09-04 19:07:22 +0000
committeraclement <aclement>2008-09-04 19:07:22 +0000
commitcdd9d5fe5cf01ec317e1fee948fa1962e9465f6e (patch)
tree40f0bc3866b0441e84e7bdf2f2fa4b0bdf13d1fb /tests
parent7d9cd79e1bf3dbfe4c2e6c51bf37143bcbfb92aa (diff)
downloadaspectj-cdd9d5fe5cf01ec317e1fee948fa1962e9465f6e.tar.gz
aspectj-cdd9d5fe5cf01ec317e1fee948fa1962e9465f6e.zip
246264: test and fix
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs162/pr246264/A.java19
-rw-r--r--tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc162/ajc162.xml5
3 files changed, 26 insertions, 1 deletions
diff --git a/tests/bugs162/pr246264/A.java b/tests/bugs162/pr246264/A.java
new file mode 100644
index 000000000..919166af7
--- /dev/null
+++ b/tests/bugs162/pr246264/A.java
@@ -0,0 +1,19 @@
+enum Color {R,G,B;}
+@interface I { public Color a(); }
+@interface J { public Color b() default Color.B; }
+
+public class A {
+ @J
+ @I(a=Color.R)
+ public static void main(String []argv) {
+ }
+}
+
+aspect X {
+
+ before(Color var): execution(* main(..)) && @annotation(I(var)) {
+ if (var!=Color.R) {
+ throw new RuntimeException("Wrong! Was "+var);
+ }
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
index dbb7e8a18..bce389c85 100644
--- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
@@ -18,7 +18,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
- // AspectJ1.6.2
+ // AspectJ1.6.2
+ public void testAnnoValueBinding_pr246264() { runTest("anno value binding"); }
public void testAroundAdviceProceed_pr211607() { runTest("around advice proceed"); }
// public void testAdvisingInterfaces_pr163005() { runTest("advising joinpoints in interfaces"); }
public void testChainedItds_pr176905() { runTest("chained itds"); }
diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
index 664e5e527..f592b9717 100644
--- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
+++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
@@ -3,6 +3,11 @@
<!-- AspectJ v1.6.2 Tests -->
<suite>
+ <ajc-test dir="bugs162/pr246264" title="anno value binding">
+ <compile options="-1.5" files="A.java"/>
+ <run class="A"/>
+ </ajc-test>
+
<ajc-test dir="bugs162/pr211607" title="around advice proceed">
<compile options="-1.5" files="Bug.java"/>
<run class="Bug"/>