use of spoon.test.enums.testclasses.Burritos in project spoon by INRIA.
the class EnumsTest method testGetAllMethods.
@Test
public void testGetAllMethods() throws Exception {
// contract: getAllMethods also returns the methods of Enum
final Factory factory = build(Burritos.class);
final CtType<Burritos> burritos = factory.Type().get(Burritos.class);
CtMethod name = factory.Core().createMethod();
// from Enum
name.setSimpleName("name");
name.setType(factory.Type().createReference(String.class));
assertTrue(burritos.hasMethod(name));
assertTrue(burritos.getAllMethods().contains(name));
}
use of spoon.test.enums.testclasses.Burritos in project spoon by INRIA.
the class EnumsTest method testEnumWithoutField.
@Test
public void testEnumWithoutField() throws Exception {
final Factory factory = build(Burritos.class);
final CtType<Burritos> burritos = factory.Type().get(Burritos.class);
assertEquals(//
"public enum Burritos {" + DefaultJavaPrettyPrinter.LINE_SEPARATOR + " ;" + DefaultJavaPrettyPrinter.LINE_SEPARATOR + //
DefaultJavaPrettyPrinter.LINE_SEPARATOR + " public static void m() {" + //
DefaultJavaPrettyPrinter.LINE_SEPARATOR + " }" + //
DefaultJavaPrettyPrinter.LINE_SEPARATOR + "}", burritos.toString());
}
Aggregations