]> source.dussan.org Git - aspectj.git/commitdiff
72766 - annotation testdata
authoraclement <aclement>
Thu, 2 Dec 2004 10:40:38 +0000 (10:40 +0000)
committeraclement <aclement>
Thu, 2 Dec 2004 10:40:38 +0000 (10:40 +0000)
tests/java5/annotations/Annotation.java [new file with mode: 0644]
tests/java5/annotations/AnnotationAspect01.aj [new file with mode: 0644]
tests/java5/annotations/SimpleAnnotation.java [new file with mode: 0644]
tests/java5/annotations/build.xml [new file with mode: 0644]
tests/java5/annotations/testcode.jar [new file with mode: 0644]

diff --git a/tests/java5/annotations/Annotation.java b/tests/java5/annotations/Annotation.java
new file mode 100644 (file)
index 0000000..dee42f7
--- /dev/null
@@ -0,0 +1,5 @@
+package java.lang.annotation;
+
+// Fake class we can use in the absence of Java5
+public class Annotation {
+}
diff --git a/tests/java5/annotations/AnnotationAspect01.aj b/tests/java5/annotations/AnnotationAspect01.aj
new file mode 100644 (file)
index 0000000..5eed11e
--- /dev/null
@@ -0,0 +1,14 @@
+public aspect AnnotationAspect01 {\r
+\r
+  // ITDC - not allowed\r
+  public SimpleAnnotation.new(int i) {\r
+  }\r
+\r
+  // ITDM - not allowed\r
+  public int SimpleAnnotation.newMember(int i) {\r
+    return 75346;\r
+  }\r
+\r
+  // ITDF - not allowed\r
+  public int SimpleAnnotation.newField;\r
+}\r
diff --git a/tests/java5/annotations/SimpleAnnotation.java b/tests/java5/annotations/SimpleAnnotation.java
new file mode 100644 (file)
index 0000000..5b43037
--- /dev/null
@@ -0,0 +1,7 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface SimpleAnnotation {
+  int id();
+  String fruit() default "bananas";
+}
diff --git a/tests/java5/annotations/build.xml b/tests/java5/annotations/build.xml
new file mode 100644 (file)
index 0000000..7170813
--- /dev/null
@@ -0,0 +1,11 @@
+<project name="Java 5 compilation of test source" default="default" basedir=".">
+
+    <target name="default">
+       <delete dir="output" failonerror="false"/>
+       <mkdir dir="output"/>
+       <javac destdir="output" debug="on" srcdir="." includes="*.java"/>
+       <zip file="testcode.jar" basedir="output" includes="*"/>
+       <delete dir="output"/>
+    </target>
+
+</project>
diff --git a/tests/java5/annotations/testcode.jar b/tests/java5/annotations/testcode.jar
new file mode 100644 (file)
index 0000000..574b251
Binary files /dev/null and b/tests/java5/annotations/testcode.jar differ