use of spoon.test.template.testclasses.ObjectIsNotParamTemplate in project spoon by INRIA.
the class TemplateTest method testObjectIsNotParamTemplate.
@Test
public void testObjectIsNotParamTemplate() throws Exception {
Launcher spoon = new Launcher();
spoon.addTemplateResource(new FileSystemFile("./src/test/java/spoon/test/template/testclasses/ObjectIsNotParamTemplate.java"));
spoon.buildModel();
Factory factory = spoon.getFactory();
// contract: String value is substituted in substring of literal, named element and reference
final CtClass<?> result = (CtClass<?>) new ObjectIsNotParamTemplate().apply(factory.createClass());
assertEquals(0, result.getMethodsByName("methXXXd").size());
assertEquals(1, result.getMethodsByName("method").size());
}
Aggregations