Search in sources :

Example 1 with Pozole

use of spoon.test.executable.testclasses.Pozole in project spoon by INRIA.

the class ExecutableRefTest method testOverridingMethod.

@Test
public void testOverridingMethod() throws Exception {
    final CtType<Pozole> aPozole = ModelUtils.buildClass(Pozole.class);
    final CtExecutableReference<?> run = aPozole.getMethodsByName("run").get(0).getReference();
    final List<CtInvocation<?>> elements = Query.getElements(run.getFactory(), new InvocationFilter(run));
    assertEquals(1, elements.size());
    assertEquals(run, elements.get(0).getExecutable());
}
Also used : CtInvocation(spoon.reflect.code.CtInvocation) InvocationFilter(spoon.reflect.visitor.filter.InvocationFilter) Pozole(spoon.test.executable.testclasses.Pozole) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CtInvocation (spoon.reflect.code.CtInvocation)1 InvocationFilter (spoon.reflect.visitor.filter.InvocationFilter)1 Pozole (spoon.test.executable.testclasses.Pozole)1