use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingTest method testInstanceOverExtensionIfReceiverMismatch_01.
@Test
public void testInstanceOverExtensionIfReceiverMismatch_01() throws Exception {
XtendClass clazz = clazz("" + "class C {" + " def put(java.util.Map<String, String> map, Integer i, Integer j) {\n" + " (null as java.util.Map<String, CharSequence>).put(i, j)\n" + " }\n" + "}");
XAbstractFeatureCall substring = findSingleFeatureCall(clazz);
assertEquals("java.util.Map.put(K,V)", substring.getFeature().getIdentifier());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingTest method testParameterizedExtension_01.
@Test
public void testParameterizedExtension_01() throws Exception {
XtendFile file = file("package testPackage\n" + "import org.eclipse.xtext.testing.util.ParseHelper\n" + "import org.eclipse.xtend.core.xtend.XtendFile\n" + "class C {\n" + " extension ParseHelper<XtendFile>\n" + " def m() {" + " parse('').xtendTypes\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall substring = findSingleFeatureCall(c);
assertEquals("org.eclipse.xtend.core.xtend.XtendFile.getXtendTypes()", substring.getFeature().getIdentifier());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingTest method testOverloadedMethod_02.
@Test
public void testOverloadedMethod_02() throws Exception {
XtendFile file = file("package testPackage\n" + "class B extends A {\n" + " override m() {\n" + " super.m\n" + " }\n" + "}\n" + "class A {\n" + " def String m(String s) {\n" + " return null\n" + " }\n" + " def String m() {\n" + " return null\n" + " }\n" + "}");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall substring = findSingleFeatureCall(c);
assertEquals("testPackage.A.m()", substring.getFeature().getIdentifier());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingTest method testParameterizedExtension_02.
@Test
public void testParameterizedExtension_02() throws Exception {
XtendFile file = file("package testPackage\n" + "import org.eclipse.xtext.testing.util.ParseHelper\n" + "import org.eclipse.xtend.core.xtend.XtendFile\n" + "class C<T extends ParseHelper<XtendFile>> {\n" + " extension T\n" + " def m() {" + " parse('').xtendTypes\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall substring = findSingleFeatureCall(c);
assertEquals("org.eclipse.xtend.core.xtend.XtendFile.getXtendTypes()", substring.getFeature().getIdentifier());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingTest method testParameterizedExtension_05.
@Test
public void testParameterizedExtension_05() throws Exception {
XtendFile file = file("package testPackage\n" + "import org.eclipse.xtext.testing.util.ParseHelper\n" + "import org.eclipse.xtend.core.xtend.XtendFile\n" + "class C<F extends XtendFile, T extends ParseHelper<? extends F>> {\n" + " extension T\n" + " def m() {" + " parse('').xtendTypes\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall substring = findSingleFeatureCall(c);
assertEquals("org.eclipse.xtend.core.xtend.XtendFile.getXtendTypes()", substring.getFeature().getIdentifier());
}
Aggregations