assertTrue(set.contains(TestAnnotations.LongArray.class));
annotations = Annotations.getAnnotations(Target.METHOD);
}
public void testReadInResolvedValues() {
final AnnotationReader reader = AnnotationReader.getReaderFor(Target.METHOD.getDeclaringClass());
Annotation annotation = reader.getAnnotation("test.TestAnnotations$Complex", Target.METHOD);
TestAnnotations.Complex ann = (TestAnnotations.Complex)annotation;
assertEquals(111, ann.i());
double[] doubleArr = ann.doubleArr();
assertEquals(1.1D, doubleArr[0], 0);
assertEquals(2.2D, doubleArr[1], 0);
assertEquals(3.3D, doubleArr[2], 0);
assertEquals(4.4D, doubleArr[3], 0);
assertEquals(double[][][].class, ann.type());
Class[] types = ann.typeArr();
assertEquals(Target[].class, types[0]);
assertEquals(Target.class, types[1]);
AnnotationElement.Type enumRef = ann.enumeration();
assertTrue(enumRef.equals(AnnotationElement.Type.ANNOTATION));
// second time -> values are not resolved again but cache is used
final AnnotationReader reader1 = AnnotationReader.getReaderFor(Target.METHOD.getDeclaringClass());
annotation = reader1.getAnnotation("test.TestAnnotations$Complex", Target.METHOD);
ann = (TestAnnotations.Complex)annotation;
assertEquals(111, ann.i());
doubleArr = ann.doubleArr();
assertEquals(1.1D, doubleArr[0], 0);
assertEquals(2.2D, doubleArr[1], 0);