use of spoon.test.annotation.testclasses.BoundNumber in project spoon by INRIA.
the class AnnotationValuesTest method testAnnotateWithEnum.
@Test
public void testAnnotateWithEnum() throws Exception {
final Factory factory = createFactory();
final CtClass<Object> target = factory.Class().create("org.example.Tacos");
final CtField<String> field = factory.Field().create(target, new HashSet<>(), factory.Type().STRING, "field");
target.addField(field);
final CtAnnotation<BoundNumber> byteOrder = factory.Annotation().annotate(field, BoundNumber.class, "byteOrder", BoundNumber.ByteOrder.LittleEndian);
assertEquals(byteOrder, on(field).giveMeAnnotation(BoundNumber.class));
assertTrue(on(byteOrder).giveMeAnnotationValue("byteOrder").element instanceof CtFieldRead);
}
Aggregations