use of spoon.test.reference.testclasses.Pozole in project spoon by INRIA.
the class VariableAccessTest method testDeclarationArray.
@Test
public void testDeclarationArray() throws Exception {
final CtType<Pozole> aPozole = ModelUtils.buildClass(Pozole.class);
final CtMethod<Object> m2 = aPozole.getMethod("m2");
final CtArrayWrite<?> ctArrayWrite = m2.getElements(new TypeFilter<CtArrayWrite<?>>(CtArrayWrite.class)).get(0);
final CtLocalVariable expected = m2.getElements(new TypeFilter<CtLocalVariable>(CtLocalVariable.class)).get(0);
assertEquals(expected, ((CtVariableAccess) ctArrayWrite.getTarget()).getVariable().getDeclaration());
}
Aggregations