Search in sources :

Example 1 with Foo

use of spoon.test.position.testclasses.Foo in project spoon by INRIA.

the class PositionTest method defaultConstructorPositionTest.

@Test
public void defaultConstructorPositionTest() throws Exception {
    CtClass<Foo> aClass = (CtClass<Foo>) buildClass(Foo.class);
    CtConstructor<Foo> defaultConstructor = aClass.getConstructor();
    assertEquals(SourcePosition.NOPOSITION, defaultConstructor.getPosition());
    CtStatement implicitSuperCall = defaultConstructor.getBody().getStatement(0);
    assertTrue(implicitSuperCall.isImplicit());
    assertEquals(SourcePosition.NOPOSITION, implicitSuperCall.getPosition());
}
Also used : CtClass(spoon.reflect.declaration.CtClass) CtStatement(spoon.reflect.code.CtStatement) Foo(spoon.test.position.testclasses.Foo) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CtStatement (spoon.reflect.code.CtStatement)1 CtClass (spoon.reflect.declaration.CtClass)1 Foo (spoon.test.position.testclasses.Foo)1