aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <andrew.clement@gmail.com>2012-04-02 14:15:08 -0700
committerAndy Clement <andrew.clement@gmail.com>2012-04-02 14:15:08 -0700
commit096b004fda4d21cca0e1ee4c776e5824715d0ecd (patch)
tree1b56bf3e3ba31d909df8822f9ef7093166916c19 /tests
parentf85631fd2fb2e0f3213abb9c5a7cd86eec2c9ab5 (diff)
downloadaspectj-096b004fda4d21cca0e1ee4c776e5824715d0ecd.tar.gz
aspectj-096b004fda4d21cca0e1ee4c776e5824715d0ecd.zip
375881
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs170/xmldefs/Anno.classbin0 -> 128 bytes
-rw-r--r--tests/bugs170/xmldefs/Anno.java5
-rw-r--r--tests/bugs170/xmldefs/Anno2.java5
-rw-r--r--tests/bugs170/xmldefs/Anno4.java25
-rw-r--r--tests/bugs170/xmldefs/Anno5.java37
-rw-r--r--tests/bugs170/xmldefs/Anno6.java9
-rw-r--r--tests/bugs170/xmldefs/AnnoBoolean.classbin0 -> 220 bytes
-rw-r--r--tests/bugs170/xmldefs/AnnoClass.classbin0 -> 267 bytes
-rw-r--r--tests/bugs170/xmldefs/AnnoLong.classbin0 -> 225 bytes
-rw-r--r--tests/bugs170/xmldefs/AnnoString.classbin0 -> 238 bytes
-rw-r--r--tests/bugs170/xmldefs/Foo.classbin0 -> 2300 bytes
-rw-r--r--tests/bugs170/xmldefs/Foo.java3
-rw-r--r--tests/bugs170/xmldefs/Hello.java36
-rw-r--r--tests/bugs170/xmldefs/Hello2.java27
-rw-r--r--tests/bugs170/xmldefs/Hello4.java42
-rw-r--r--tests/bugs170/xmldefs/Hello5.java42
-rw-r--r--tests/bugs170/xmldefs/Hello6.java41
-rw-r--r--tests/bugs170/xmldefs/aop.xml13
-rw-r--r--tests/bugs170/xmldefs/aop2.xml13
-rw-r--r--tests/bugs170/xmldefs/aop3.xml13
-rw-r--r--tests/bugs170/xmldefs/aop4.xml17
-rw-r--r--tests/bugs170/xmldefs/aop5.xml18
-rw-r--r--tests/bugs170/xmldefs/aop6.xml13
-rw-r--r--tests/bugs170/xmldefs/aop6a.xml13
-rw-r--r--tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java38
-rw-r--r--tests/src/org/aspectj/systemtest/ajc170/ajc170.xml100
26 files changed, 502 insertions, 8 deletions
diff --git a/tests/bugs170/xmldefs/Anno.class b/tests/bugs170/xmldefs/Anno.class
new file mode 100644
index 000000000..6e378d760
--- /dev/null
+++ b/tests/bugs170/xmldefs/Anno.class
Binary files differ
diff --git a/tests/bugs170/xmldefs/Anno.java b/tests/bugs170/xmldefs/Anno.java
new file mode 100644
index 000000000..7bb1cb2aa
--- /dev/null
+++ b/tests/bugs170/xmldefs/Anno.java
@@ -0,0 +1,5 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Anno {
+}
diff --git a/tests/bugs170/xmldefs/Anno2.java b/tests/bugs170/xmldefs/Anno2.java
new file mode 100644
index 000000000..f5dfcb99f
--- /dev/null
+++ b/tests/bugs170/xmldefs/Anno2.java
@@ -0,0 +1,5 @@
+import java.lang.annotation.*;
+
+// deliberately wrong retention
+public @interface Anno2 {
+}
diff --git a/tests/bugs170/xmldefs/Anno4.java b/tests/bugs170/xmldefs/Anno4.java
new file mode 100644
index 000000000..ebff22092
--- /dev/null
+++ b/tests/bugs170/xmldefs/Anno4.java
@@ -0,0 +1,25 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoString {
+ String value() default "xyz";
+ String sss() default "xyz";
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoLong {
+ long value() default 111L;
+ long jjj() default 111L;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoBoolean {
+ boolean value() default false;
+ boolean zzz() default false;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoClass {
+ Class value() default String.class;
+ Class ccc() default String.class;
+}
diff --git a/tests/bugs170/xmldefs/Anno5.java b/tests/bugs170/xmldefs/Anno5.java
new file mode 100644
index 000000000..5906bcaa1
--- /dev/null
+++ b/tests/bugs170/xmldefs/Anno5.java
@@ -0,0 +1,37 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoShort {
+ short value() default 3;
+ short sss() default 3;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoDouble {
+ double value() default 3.0d;
+ double ddd() default 3.0d;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoFloat {
+ float value() default 4.0f;
+ float fff() default 4.0f;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoChar {
+ char value() default 'a';
+ char ccc() default 'a';
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoByte {
+ byte value() default 66;
+ byte bbb() default 66;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnoInt {
+ int value() default 111;
+ int iii() default 111;
+}
diff --git a/tests/bugs170/xmldefs/Anno6.java b/tests/bugs170/xmldefs/Anno6.java
new file mode 100644
index 000000000..18d8f544b
--- /dev/null
+++ b/tests/bugs170/xmldefs/Anno6.java
@@ -0,0 +1,9 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Annot {
+ char a();
+ boolean fred();
+ String value();
+}
+
diff --git a/tests/bugs170/xmldefs/AnnoBoolean.class b/tests/bugs170/xmldefs/AnnoBoolean.class
new file mode 100644
index 000000000..33b76156a
--- /dev/null
+++ b/tests/bugs170/xmldefs/AnnoBoolean.class
Binary files differ
diff --git a/tests/bugs170/xmldefs/AnnoClass.class b/tests/bugs170/xmldefs/AnnoClass.class
new file mode 100644
index 000000000..4071d56d6
--- /dev/null
+++ b/tests/bugs170/xmldefs/AnnoClass.class
Binary files differ
diff --git a/tests/bugs170/xmldefs/AnnoLong.class b/tests/bugs170/xmldefs/AnnoLong.class
new file mode 100644
index 000000000..a7990fbad
--- /dev/null
+++ b/tests/bugs170/xmldefs/AnnoLong.class
Binary files differ
diff --git a/tests/bugs170/xmldefs/AnnoString.class b/tests/bugs170/xmldefs/AnnoString.class
new file mode 100644
index 000000000..ba0e8eaf7
--- /dev/null
+++ b/tests/bugs170/xmldefs/AnnoString.class
Binary files differ
diff --git a/tests/bugs170/xmldefs/Foo.class b/tests/bugs170/xmldefs/Foo.class
new file mode 100644
index 000000000..eaa12c965
--- /dev/null
+++ b/tests/bugs170/xmldefs/Foo.class
Binary files differ
diff --git a/tests/bugs170/xmldefs/Foo.java b/tests/bugs170/xmldefs/Foo.java
new file mode 100644
index 000000000..2edbdabfd
--- /dev/null
+++ b/tests/bugs170/xmldefs/Foo.java
@@ -0,0 +1,3 @@
+public aspect Foo {
+ declare @method: * sayHello(..): @Anno;
+}
diff --git a/tests/bugs170/xmldefs/Hello.java b/tests/bugs170/xmldefs/Hello.java
new file mode 100644
index 000000000..fdf29eab3
--- /dev/null
+++ b/tests/bugs170/xmldefs/Hello.java
@@ -0,0 +1,36 @@
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+
+public class Hello {
+
+ public static void main(String[] args) {
+ sayHello();
+ printAnnos("sayHello");
+ }
+
+ public static void sayHello() {
+ System.out.println("Hello");
+ sayWorld();
+ }
+
+ public static int sayWorld() {
+ System.out.println("World");
+ return 0;
+ }
+
+ public static void printAnnos(String methodname) {
+ try {
+ Method m = Hello.class.getDeclaredMethod(methodname);
+ Annotation[] annos = m.getAnnotations();
+ System.out.println("Annotations on "+methodname+"? "+(annos!=null && annos.length!=0));
+ if (annos!=null && annos.length>0) {
+ System.out.println("Annotation count is "+annos.length);
+ for (Annotation anno: annos) {
+ System.out.println(anno);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/tests/bugs170/xmldefs/Hello2.java b/tests/bugs170/xmldefs/Hello2.java
new file mode 100644
index 000000000..9fa6a4a9a
--- /dev/null
+++ b/tests/bugs170/xmldefs/Hello2.java
@@ -0,0 +1,27 @@
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+public class Hello2 {
+
+ public static int i;
+
+ public static void main(String[] args) {
+ printAnnos("i");
+ }
+
+ public static void printAnnos(String fieldname) {
+ try {
+ Field m = Hello2.class.getDeclaredField(fieldname);
+ Annotation[] annos = m.getAnnotations();
+ System.out.println("Annotations on "+fieldname+"? "+(annos!=null && annos.length!=0));
+ if (annos!=null && annos.length>0) {
+ System.out.println("Annotation count is "+annos.length);
+ for (Annotation anno: annos) {
+ System.out.println(anno);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/tests/bugs170/xmldefs/Hello4.java b/tests/bugs170/xmldefs/Hello4.java
new file mode 100644
index 000000000..7f7c6183b
--- /dev/null
+++ b/tests/bugs170/xmldefs/Hello4.java
@@ -0,0 +1,42 @@
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.*;
+public class Hello4 {
+
+ public static int field1;
+ public static int field2;
+
+ public static void main(String[] args) {
+ printAnnos("field1");
+ printAnnos("field2");
+ }
+
+ public static void printAnnos(String fieldname) {
+ try {
+ Field m = Hello4.class.getDeclaredField(fieldname);
+ Annotation[] annos = m.getAnnotations();
+ System.out.println("Annotations on "+fieldname+"? "+(annos!=null && annos.length!=0));
+ if (annos!=null && annos.length>0) {
+ List<Annotation> la = new ArrayList<Annotation>();
+ for (Annotation anno: annos) {
+ la.add(anno);
+ }
+ Collections.<Annotation>sort(la,new AnnoComparator());
+
+ System.out.println("Annotation count is "+annos.length);
+ for (Annotation anno: la) {
+ System.out.println(anno);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ static class AnnoComparator implements Comparator<Annotation> {
+ public int compare(Annotation a, Annotation b) {
+ return a.toString().compareTo(b.toString());
+ }
+ }
+}
diff --git a/tests/bugs170/xmldefs/Hello5.java b/tests/bugs170/xmldefs/Hello5.java
new file mode 100644
index 000000000..361415a3e
--- /dev/null
+++ b/tests/bugs170/xmldefs/Hello5.java
@@ -0,0 +1,42 @@
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.*;
+public class Hello5 {
+
+ public static int field1;
+ public static int field2;
+
+ public static void main(String[] args) {
+ printAnnos("field1");
+ printAnnos("field2");
+ }
+
+ public static void printAnnos(String fieldname) {
+ try {
+ Field m = Hello5.class.getDeclaredField(fieldname);
+ Annotation[] annos = m.getAnnotations();
+ System.out.println("Annotations on "+fieldname+"? "+(annos!=null && annos.length!=0));
+ if (annos!=null && annos.length>0) {
+ List<Annotation> la = new ArrayList<Annotation>();
+ for (Annotation anno: annos) {
+ la.add(anno);
+ }
+ Collections.<Annotation>sort(la,new AnnoComparator());
+
+ System.out.println("Annotation count is "+annos.length);
+ for (Annotation anno: la) {
+ System.out.println(anno);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ static class AnnoComparator implements Comparator<Annotation> {
+ public int compare(Annotation a, Annotation b) {
+ return a.toString().compareTo(b.toString());
+ }
+ }
+}
diff --git a/tests/bugs170/xmldefs/Hello6.java b/tests/bugs170/xmldefs/Hello6.java
new file mode 100644
index 000000000..568a5b46e
--- /dev/null
+++ b/tests/bugs170/xmldefs/Hello6.java
@@ -0,0 +1,41 @@
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.*;
+
+public class Hello6 {
+
+ public static int field1;
+
+ public static void main(String[] args) {
+ printAnnos("field1");
+ }
+
+ public static void printAnnos(String fieldname) {
+ try {
+ Field m = Hello6.class.getDeclaredField(fieldname);
+ Annotation[] annos = m.getAnnotations();
+ System.out.println("Annotations on "+fieldname+"? "+(annos!=null && annos.length!=0));
+ if (annos!=null && annos.length>0) {
+ List<Annotation> la = new ArrayList<Annotation>();
+ for (Annotation anno: annos) {
+ la.add(anno);
+ }
+ Collections.<Annotation>sort(la,new AnnoComparator());
+
+ System.out.println("Annotation count is "+annos.length);
+ for (Annotation anno: la) {
+ System.out.println(anno);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ static class AnnoComparator implements Comparator<Annotation> {
+ public int compare(Annotation a, Annotation b) {
+ return a.toString().compareTo(b.toString());
+ }
+ }
+}
diff --git a/tests/bugs170/xmldefs/aop.xml b/tests/bugs170/xmldefs/aop.xml
new file mode 100644
index 000000000..afa85168b
--- /dev/null
+++ b/tests/bugs170/xmldefs/aop.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="ConjuredUp">
+ <declare-annotation method="* Hello.sayHello(..)" annotation="@Anno"/>
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/bugs170/xmldefs/aop2.xml b/tests/bugs170/xmldefs/aop2.xml
new file mode 100644
index 000000000..d5ebdf7af
--- /dev/null
+++ b/tests/bugs170/xmldefs/aop2.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="ConjuredUp">
+ <declare-annotation method="* Hello.sayHello(..)" annotation="@Anno2"/>
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/bugs170/xmldefs/aop3.xml b/tests/bugs170/xmldefs/aop3.xml
new file mode 100644
index 000000000..a65a552ed
--- /dev/null
+++ b/tests/bugs170/xmldefs/aop3.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="ConjuredUp">
+ <declare-annotation field="* i" annotation="@Anno"/>
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello2"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/bugs170/xmldefs/aop4.xml b/tests/bugs170/xmldefs/aop4.xml
new file mode 100644
index 000000000..1cf61807b
--- /dev/null
+++ b/tests/bugs170/xmldefs/aop4.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="ConjuredUp">
+ <declare-annotation field="* field1(..)" annotation="@AnnoString(&quot;set from xml&quot;)"/>
+ <declare-annotation field="* field1(..)" annotation="@AnnoLong(999)"/>
+ <declare-annotation field="* field1(..)" annotation="@AnnoBoolean(true)"/>
+ <declare-annotation field="* field1(..)" annotation="@AnnoClass(Integer.class)"/>
+ <declare-annotation field="* field2(..)" annotation="@AnnoClass()"/> <!-- testing empty paren -->
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello4"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/bugs170/xmldefs/aop5.xml b/tests/bugs170/xmldefs/aop5.xml
new file mode 100644
index 000000000..31a5f7d48
--- /dev/null
+++ b/tests/bugs170/xmldefs/aop5.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="ConjuredUp">
+ <declare-annotation field="* field1(..)" annotation="@AnnoShort(8)"/>
+ <declare-annotation field="* field1(..)" annotation="@AnnoChar('z')"/>
+ <declare-annotation field="* field1(..)" annotation="@AnnoDouble(99.0d)"/>
+ <declare-annotation field="* field1(..)" annotation="@AnnoFloat(6.0f)"/>
+ <declare-annotation field="* field2(..)" annotation="@AnnoByte(88)"/>
+ <declare-annotation field="* field2(..)" annotation="@AnnoInt(99)"/>
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello5"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/bugs170/xmldefs/aop6.xml b/tests/bugs170/xmldefs/aop6.xml
new file mode 100644
index 000000000..06300b72f
--- /dev/null
+++ b/tests/bugs170/xmldefs/aop6.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="ConjuredUp">
+ <declare-annotation field="* field1(..)" annotation="@Annot(a='a',fred=false,'abc')"/>
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello6"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/bugs170/xmldefs/aop6a.xml b/tests/bugs170/xmldefs/aop6a.xml
new file mode 100644
index 000000000..2c6410a9b
--- /dev/null
+++ b/tests/bugs170/xmldefs/aop6a.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aspectj>
+ <aspects>
+ <concrete-aspect name="ConjuredUp">
+ <declare-annotation field="* field1(..)" annotation="@Annot( a= 'a' , fred = false, 'abc' )"/>
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-Xreweavable -verbose -XlazyTjp -showWeaveInfo">
+ <include within="Hello6"/>
+ </weaver>
+</aspectj>
+
diff --git a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
index 9ce29a36f..907464990 100644
--- a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Contributors
+ * Copyright (c) 2008-2012 Contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,20 +17,13 @@ import junit.framework.Test;
import org.aspectj.apache.bcel.classfile.Field;
import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.weaver.ResolvedMember;
-import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.TypeFactory;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.World;
import org.aspectj.weaver.internal.tools.StandardPointcutExpressionImpl;
-import org.aspectj.weaver.patterns.BasicTokenSource;
-import org.aspectj.weaver.patterns.ITokenSource;
-import org.aspectj.weaver.patterns.PatternParser;
import org.aspectj.weaver.patterns.Pointcut;
-import org.aspectj.weaver.patterns.PointcutEvaluationExpenseComparator;
import org.aspectj.weaver.patterns.PointcutRewriter;
import org.aspectj.weaver.reflect.ReflectionWorld;
-import org.aspectj.weaver.tools.StandardPointcutExpression;
import org.aspectj.weaver.tools.StandardPointcutParser;
/**
@@ -38,6 +31,35 @@ import org.aspectj.weaver.tools.StandardPointcutParser;
*/
public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testXmlDefsDeclareAnnoMethod() {
+ runTest("xml defined dec at method");
+ }
+
+ // anno not runtime vis
+ public void testXmlDefsDeclareAnnoMethod2() {
+ runTest("xml defined dec at method 2");
+ }
+
+ public void testXmlDefsDeclareAnnoField() {
+ runTest("xml defined dec at field");
+ }
+
+ public void testXmlDefsDeclareAnnoFieldVariants1() {
+ runTest("xml defined dec anno - variants 1");
+ }
+
+ public void testXmlDefsDeclareAnnoFieldVariants2() {
+ runTest("xml defined dec anno - variants 2");
+ }
+
+ public void testXmlDefsDeclareAnnoFieldMultipleValues() {
+ runTest("xml defined dec anno - multiple values");
+ }
+
+ public void testXmlDefsDeclareAnnoFieldMultipleValuesAndSpaces() {
+ runTest("xml defined dec anno - multiple values and spaces");
+ }
+
public void testPointcutExpense_374964() {
// check a declaring type being specified causes the call() to be considered cheaper than this()
diff --git a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml
index 58c936905..daed3a8e7 100644
--- a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml
+++ b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml
@@ -2,6 +2,106 @@
<suite>
+
+ <ajc-test dir="bugs170/xmldefs" title="xml defined dec at method">
+ <compile files="Hello.java Anno.java" options="-1.5"/>
+ <run class="Hello" ltw="aop.xml">
+ <stdout>
+ <line text="Hello"/>
+ <line text="World"/>
+ <line text="Annotations on sayHello? true"/>
+ <line text="Annotation count is 1"/>
+ <line text="@Anno"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs170/xmldefs" title="xml defined dec at method 2">
+ <compile files="Hello.java Anno2.java" options="-1.5"/>
+ <run class="Hello" ltw="aop2.xml">
+ <stdout>
+ <line text="Hello"/>
+ <line text="World"/>
+ <line text="Annotations on sayHello? false"/>
+ </stdout>
+ <stderr>
+ <line text="info AspectJ Weaver"/>
+ <line text="info register"/>
+ <line text="info using configuration"/>
+ <line text="info define aspect ConjuredUp"/>
+ <line text="error declare is using an annotation type that does not have runtime retention: @Anno2"/>
+ <line text="info weaver"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs170/xmldefs" title="xml defined dec at field">
+ <compile files="Hello2.java Anno.java" options="-1.5"/>
+ <run class="Hello2" ltw="aop3.xml">
+ <stdout>
+ <line text="Annotations on i? true"/>
+ <line text="Annotation count is 1"/>
+ <line text="@Anno"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - variants 1">
+ <compile files="Hello4.java Anno4.java" options="-1.5"/>
+ <run class="Hello4" ltw="aop4.xml">
+ <stdout>
+ <line text="Annotations on field1? true"/>
+ <line text="Annotation count is 4"/>
+ <line text="@AnnoBoolean(zzz=false, value=true)"/>
+ <line text="@AnnoClass(value=class java.lang.Integer, ccc=class java.lang.String)"/>
+ <line text="@AnnoLong(jjj=111, value=999)"/>
+ <line text="@AnnoString(sss=xyz, value=set from xml)"/>
+ <line text="Annotations on field2? true"/>
+ <line text="Annotation count is 1"/>
+ <line text="@AnnoClass(value=class java.lang.String, ccc=class java.lang.String)"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - variants 2">
+ <compile files="Hello5.java Anno5.java" options="-1.5"/>
+ <run class="Hello5" ltw="aop5.xml">
+ <stdout>
+ <line text="Annotations on field1? true"/>
+ <line text="Annotation count is 4"/>
+ <line text="@AnnoChar(value=z, ccc=a)"/>
+ <line text="@AnnoDouble(ddd=3.0, value=99.0)"/>
+ <line text="@AnnoFloat(fff=4.0, value=6.0)"/>
+ <line text="@AnnoShort(sss=3, value=8)"/>
+ <line text="Annotations on field2? true"/>
+ <line text="Annotation count is 2"/>
+ <line text="@AnnoByte(value=88, bbb=66)"/>
+ <line text="@AnnoInt(value=99, iii=111)"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - multiple values">
+ <compile files="Hello6.java Anno6.java" options="-1.5"/>
+ <run class="Hello6" ltw="aop6.xml">
+ <stdout>
+ <line text="Annotations on field1? true"/>
+ <line text="Annotation count is 1"/>
+ <line text="@Annot(a=a, fred=false, value=abc)"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs170/xmldefs" title="xml defined dec anno - multiple values and spaces">
+ <compile files="Hello6.java Anno6.java" options="-1.5"/>
+ <run class="Hello6" ltw="aop6a.xml">
+ <stdout>
+ <line text="Annotations on field1? true"/>
+ <line text="Annotation count is 1"/>
+ <line text="@Annot(a=a, fred=false, value=abc)"/>
+ </stdout>
+ </run>
+ </ajc-test>
<ajc-test dir="bugs170/pr73507" title="public ITDfs - 1">
<compile files="Case1.java" options="-1.5"/>