use of org.eclipse.xtend.ide.tests.findrefs.FindReferencesTestUtil.MockAcceptor in project xtext-xtend by eclipse.
the class FindReferencesTest method testFindReferencesToAnonymousExplicitSuperConstructor.
@Test
public void testFindReferencesToAnonymousExplicitSuperConstructor() throws Exception {
XtendClass classFoo = (XtendClass) testHelper.xtendFile("Foo", "class Foo { new() {} }").getXtendTypes().get(0);
XtendClass classBar = (XtendClass) testHelper.xtendFile("Bar", "class Bar { val foo = new Foo{} }").getXtendTypes().get(0);
waitForBuild();
XtendField fieldFoo = (XtendField) classBar.getMembers().get(0);
JvmConstructor inferredConstructor = associations.getInferredConstructor((XtendConstructor) classFoo.getMembers().get(0));
final MockAcceptor mockAcceptor = new MockAcceptor();
mockAcceptor.expect(((AnonymousClass) fieldFoo.getInitialValue()).getConstructorCall(), inferredConstructor, XCONSTRUCTOR_CALL__CONSTRUCTOR);
findReferencesTester.checkFindReferences(inferredConstructor, "Java References to Foo (/test.project/src/Foo.xtend)", mockAcceptor);
}
Aggregations