use of spoon.test.annotation.testclasses.AnnotationValues in project spoon by INRIA.
the class AnnotationValuesTest method testValuesOnJava8Annotation.
@Test
public void testValuesOnJava8Annotation() throws Exception {
CtType<AnnotationValues> aClass = buildClass(AnnotationValues.class);
CtConstructorCall aConstructorCall = aClass.getMethod("method").getElements(new TypeFilter<>(CtConstructorCall.class)).get(0);
CtAnnotation<?> ctAnnotation = on(aConstructorCall.getType()).giveMeAnnotation(AnnotationValues.Annotation.class);
on(ctAnnotation).giveMeAnnotationValue("integer").isTypedBy(CtLiteral.class);
on(ctAnnotation).giveMeAnnotationValue("integers").isTypedBy(CtNewArray.class);
on(ctAnnotation).giveMeAnnotationValue("string").isTypedBy(CtLiteral.class);
on(ctAnnotation).giveMeAnnotationValue("strings").isTypedBy(CtLiteral.class);
on(ctAnnotation).giveMeAnnotationValue("clazz").isTypedBy(CtFieldAccess.class);
on(ctAnnotation).giveMeAnnotationValue("classes").isTypedBy(CtNewArray.class);
on(ctAnnotation).giveMeAnnotationValue("b").isTypedBy(CtLiteral.class);
on(ctAnnotation).giveMeAnnotationValue("e").isTypedBy(CtFieldAccess.class);
on(ctAnnotation).giveMeAnnotationValue("ia").isTypedBy(CtAnnotation.class);
on(ctAnnotation).giveMeAnnotationValue("ias").isTypedBy(CtNewArray.class);
}
Aggregations