use of spoon.test.template.testclasses.SimpleTemplate in project spoon by INRIA.
the class TemplateTest method testSimpleTemplate.
@Test
public void testSimpleTemplate() {
Launcher spoon = new Launcher();
spoon.addTemplateResource(new FileSystemFile("./src/test/java/spoon/test/template/testclasses/SimpleTemplate.java"));
spoon.buildModel();
Factory factory = spoon.getFactory();
CtClass<?> testSimpleTpl = factory.Class().create("TestSimpleTpl");
new SimpleTemplate("Hello world").apply(testSimpleTpl);
Set<CtMethod<?>> listMethods = testSimpleTpl.getMethods();
assertEquals(0, testSimpleTpl.getMethodsByName("apply").size());
assertEquals(1, listMethods.size());
}
Aggregations