use of spoon.test.enums.testclasses.Foo in project spoon by INRIA.
the class EnumsTest method testAnnotationsOnEnum.
@Test
public void testAnnotationsOnEnum() throws Exception {
final Launcher launcher = new Launcher();
launcher.run(new String[] { "-i", "./src/test/java/spoon/test/enums/testclasses", "-o", "./target/spooned" });
final CtEnum<?> foo = (CtEnum) launcher.getFactory().Type().get(Foo.class);
assertEquals(1, foo.getFields().size());
assertEquals(1, foo.getFields().get(0).getAnnotations().size());
assertEquals(Deprecated.class, AnnotationTest.getActualClassFromAnnotation(foo.getFields().get(0).getAnnotations().get(0)));
assertEquals("public enum Foo {" + DefaultJavaPrettyPrinter.LINE_SEPARATOR + " @java.lang.Deprecated" + DefaultJavaPrettyPrinter.LINE_SEPARATOR + " Bar;}", foo.toString());
}
Aggregations