use of org.eclipse.xtext.xbase.XFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperationWithTwoParams_overloaded.
@Test
public void testOperationWithTwoParams_overloaded() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method() {\n" + " methodWithParam('foo', 'bar')\n" + " }\n" + " def methodWithParam(String s1, String s2) {}\n" + " def methodWithParam(StringBuffer s1, String s2) {}\n" + "}");
XFeatureCall featureCall = (XFeatureCall) getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.methodWithParam(java.lang.String,java.lang.String)", featureCall);
assertNull(featureCall.getImplicitFirstArgument());
}
use of org.eclipse.xtext.xbase.XFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperationWithTwoParams_noConflict.
@Test
public void testOperationWithTwoParams_noConflict() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method() {\n" + " methodWithParam('foo', 'bar')\n" + " }\n" + " def methodWithParam(String s1, String s2) {}" + "}");
XFeatureCall featureCall = (XFeatureCall) getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.methodWithParam(java.lang.String,java.lang.String)", featureCall);
assertNull(featureCall.getImplicitFirstArgument());
}
use of org.eclipse.xtext.xbase.XFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testStaticMethod_overloaded_noImport.
@Test
public void testStaticMethod_overloaded_noImport() throws Exception {
XtendClass clazz = clazz("class SomeClass extends org.junit.Assert {\n" + " def void method() {\n" + " assertTrue(false)\n" + " }\n" + "}");
XFeatureCall featureCall = (XFeatureCall) getFirstFeatureCall(clazz);
assertLinksTo("org.junit.Assert.assertTrue(boolean)", featureCall);
assertNull(featureCall.getImplicitFirstArgument());
assertNull(featureCall.getImplicitReceiver());
}
use of org.eclipse.xtext.xbase.XFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperationWithParam_overloaded_itPresent.
@Test
public void testOperationWithParam_overloaded_itPresent() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method(String it) {\n" + " methodWithParam('foo')\n" + " }\n" + " def methodWithParam(String s) {}\n" + " def methodWithParam(StringBuffer s) {}\n" + "}");
XFeatureCall featureCall = (XFeatureCall) getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.methodWithParam(java.lang.String)", featureCall);
assertNull(featureCall.getImplicitFirstArgument());
}
use of org.eclipse.xtext.xbase.XFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperationWithParam_itPresent.
@Test
public void testOperationWithParam_itPresent() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method(String it) {\n" + " methodWithParam('foo')\n" + " }\n" + " def methodWithParam(String s) {}" + "}");
XFeatureCall featureCall = (XFeatureCall) getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.methodWithParam(java.lang.String)", featureCall);
assertNull(featureCall.getImplicitFirstArgument());
}
Aggregations