use of spoon.test.annotation.testclasses.Bound in project spoon by INRIA.
the class AnnotationTest method testModelBuildingAnnotationBoundUsage.
@Test
public void testModelBuildingAnnotationBoundUsage() throws Exception {
final Launcher launcher = new Launcher();
launcher.addInputResource("./src/test/java/spoon/test/annotation/testclasses/Main.java");
launcher.buildModel();
Factory factory = launcher.getFactory();
CtType<?> type = factory.Type().get("spoon.test.annotation.testclasses.Main");
assertEquals("Main", type.getSimpleName());
CtParameter<?> param = type.getElements(new TypeFilter<CtParameter<?>>(CtParameter.class)).get(0);
assertEquals("a", param.getSimpleName());
List<CtAnnotation<? extends Annotation>> annotations = param.getAnnotations();
assertEquals(1, annotations.size());
CtAnnotation<?> a = annotations.get(0);
Bound actualAnnotation = (Bound) a.getActualAnnotation();
assertEquals(8, actualAnnotation.max());
}
Aggregations