diff options
author | Elliott Hughes <enh@google.com> | 2013-02-20 23:17:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-02-20 23:17:05 +0000 |
commit | 492899e445c21f09db458c76d773d571cc6cc0ac (patch) | |
tree | 3aed39b89bf11720c342ed5f81605a430b16ddba /test | |
parent | e877c8ea30cd2862a6d92cddde8a2671ea102600 (diff) | |
parent | db1e390acea08b4afc280711b4aa9b39f44ecfb0 (diff) | |
download | art-492899e445c21f09db458c76d773d571cc6cc0ac.zip art-492899e445c21f09db458c76d773d571cc6cc0ac.tar.gz art-492899e445c21f09db458c76d773d571cc6cc0ac.tar.bz2 |
Merge "Port new test for package annotations from dalvik." into dalvik-dev
Diffstat (limited to 'test')
4 files changed, 26 insertions, 0 deletions
diff --git a/test/004-annotations/expected.txt b/test/004-annotations/expected.txt index eade6de..36b3868 100644 --- a/test/004-annotations/expected.txt +++ b/test/004-annotations/expected.txt @@ -94,3 +94,10 @@ annotations on TYPE class android.test.anno.FullyNoted(1): SimplyNoted.get(AnnoSimpleType) = @android.test.anno.AnnoSimpleType() SubNoted.get(AnnoSimpleType) = @android.test.anno.AnnoSimpleType() + +Package annotations: + @android.test.anno.AnnoSimplePackage() + interface android.test.anno.AnnoSimplePackage +Package declared annotations: + @android.test.anno.AnnoSimplePackage() + interface android.test.anno.AnnoSimplePackage diff --git a/test/004-annotations/src/android/test/AnnoSimplePackage1.java b/test/004-annotations/src/android/test/AnnoSimplePackage1.java new file mode 100644 index 0000000..629cb7d --- /dev/null +++ b/test/004-annotations/src/android/test/AnnoSimplePackage1.java @@ -0,0 +1,8 @@ +package android.test; + +import java.lang.annotation.*; + +@Target(ElementType.PACKAGE) +@Retention(RetentionPolicy.RUNTIME) + +public @interface AnnoSimplePackage1 {} diff --git a/test/004-annotations/src/android/test/anno/TestAnnotations.java b/test/004-annotations/src/android/test/anno/TestAnnotations.java index 4ad32d5..4eabb12 100644 --- a/test/004-annotations/src/android/test/anno/TestAnnotations.java +++ b/test/004-annotations/src/android/test/anno/TestAnnotations.java @@ -173,5 +173,14 @@ public class TestAnnotations { // this is non-null if the @Inherited tag is present anno = SubNoted.class.getAnnotation(AnnoSimpleType.class); System.out.println("SubNoted.get(AnnoSimpleType) = " + anno); + + System.out.println(); + + // Package annotations aren't inherited, so getAnnotations and getDeclaredAnnotations are + // the same. + System.out.println("Package annotations:"); + printAnnotationArray(" ", TestAnnotations.class.getPackage().getAnnotations()); + System.out.println("Package declared annotations:"); + printAnnotationArray(" ", TestAnnotations.class.getPackage().getDeclaredAnnotations()); } } diff --git a/test/004-annotations/src/android/test/package-info.java b/test/004-annotations/src/android/test/package-info.java new file mode 100644 index 0000000..e188cda --- /dev/null +++ b/test/004-annotations/src/android/test/package-info.java @@ -0,0 +1,2 @@ +@AnnoSimplePackage1 +package android.test; |