use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperation_implicitArgumentOnStatic.
@Test
public void testOperation_implicitArgumentOnStatic() throws Exception {
XtendClass clazz = clazz("import static testdata.LinkingStaticTypeEquallyNamed.*" + "class SomeClass {\n" + " def void method(Object it) {\n" + " withArgument\n" + " }\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertNotNull("feature is available", featureCall.getFeature());
JvmIdentifiableElement linked = featureCall.getFeature();
assertFalse("is resolved", linked.eIsProxy());
assertTrue("testdata.LinkingStaticTypeEquallyNamed.withArgument(java.lang.Object)".equals(linked.getIdentifier()) || "testdata.LinkingStaticTypeEquallyNamed.withArgument(java.lang.Object,int,int)".equals(linked.getIdentifier()));
assertFalse(clazz.eResource().getErrors().isEmpty());
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperation_sugarImplicitArgumentOnThis_shadows_sugarImplicitArgumentOnExtension.
@Test
public void testOperation_sugarImplicitArgumentOnThis_shadows_sugarImplicitArgumentOnExtension() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method(Object it) {\n" + " withArgument2\n" + " }" + " def getWithArgument2(Object it) {}\n" + " extension testdata.LinkingType\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.getWithArgument2(java.lang.Object)", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testField_noConflicts_protectedStaticImport.
@Test
public void testField_noConflicts_protectedStaticImport() throws Exception {
XtendClass clazz = clazz("import static testdata.LinkingStaticType.*\n" + "class SomeClass {\n" + " def method() {\n" + " protectedField\n" + " }" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingStaticType.protectedField", featureCall, true);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testField_onIt_shadows_importedExtension.
@Test
public void testField_onIt_shadows_importedExtension() throws Exception {
XtendClass clazz = clazz("import static extension testdata.LinkingStaticType.*\n" + "class SomeClass {\n" + " def method(testdata.LinkingType it) {\n" + " publicField\n" + " }\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingType.publicField", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testField_inherited_shadowsInvisibleOnIt.
@Test
public void testField_inherited_shadowsInvisibleOnIt() throws Exception {
XtendClass clazz = clazz("class SomeClass extends testdata.LinkingType {\n" + " def method(testdata.LinkingTypeEquallyNamed it) {\n" + " protectedField\n" + " }\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingType.protectedField", featureCall);
}
Aggregations