use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class JavaConverterTest method testRichStringSpecialCase2.
@Test
public void testRichStringSpecialCase2() throws Exception {
XtendClass clazz = this.toValidXtendClass((("class Z { String richTxt = \"test\" + \"\'\'\'�FOR a: \'123\'.toCharArray SEPARATOR \',\\n \\t\'�\\n" + "a\\n") + "�ENDFOR�\'\'\'\";}"));
Assert.assertNotNull(clazz);
XtendMember _get = clazz.getMembers().get(0);
XtendField xtendMember = ((XtendField) _get);
Assert.assertEquals("richTxt", xtendMember.getName());
XExpression _initialValue = xtendMember.getInitialValue();
Assert.assertFalse((_initialValue instanceof RichString));
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class ValueConverterExceptionProducesErrorTest method assertLiteral.
private void assertLiteral(final String expectation, final Resource resource) {
EObject _head = IterableExtensions.<EObject>head(resource.getContents());
final XtendFile file = ((XtendFile) _head);
final XtendTypeDeclaration type = IterableExtensions.<XtendTypeDeclaration>head(file.getXtendTypes());
XtendMember _head_1 = IterableExtensions.<XtendMember>head(type.getMembers());
final XtendFunction method = ((XtendFunction) _head_1);
XExpression _expression = method.getExpression();
final RichString body = ((RichString) _expression);
XExpression _head_2 = IterableExtensions.<XExpression>head(body.getExpressions());
final RichStringLiteral singleElement = ((RichStringLiteral) _head_2);
Assert.assertEquals(expectation, singleElement.getValue());
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class XtendValidationTest method testJavaDocRefs_5.
@Test
public void testJavaDocRefs_5() throws Exception {
XtendFile file = file("class Foo {\n" + "/**" + " * {@link List}\n" + " */" + "String field = '42'\n" + "def doStuff(){}" + "}");
XtendClass clazz = (XtendClass) file.getXtendTypes().get(0);
XtendMember field = clazz.getMembers().get(0);
helper.assertError(field, XTEND_FIELD, IssueCodes.JAVA_DOC_LINKING_DIAGNOSTIC, "javaDoc", "List", "cannot be resolved to a type");
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class XtendValidationTest method testJavaDocRefs_4.
@Test
public void testJavaDocRefs_4() throws Exception {
XtendFile file = file("class Foo {\n" + "/**" + " * {@link List}\n" + " */" + "String field = '42'\n" + "def doStuff(){}" + "}");
XtendClass clazz = (XtendClass) file.getXtendTypes().get(0);
XtendMember field = clazz.getMembers().get(0);
helper.assertError(field, XTEND_FIELD, IssueCodes.JAVA_DOC_LINKING_DIAGNOSTIC, "javaDoc", "List", "cannot be resolved to a type");
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class XtendValidationTest method testJavaDocRefs_6.
@Test
public void testJavaDocRefs_6() throws Exception {
XtendFile file = file("class Foo {\n" + "/**" + " * {@link List}\n" + " */" + "String field = '42'\n" + "def doStuff(){}" + "}");
XtendClass clazz = (XtendClass) file.getXtendTypes().get(0);
XtendMember field = clazz.getMembers().get(0);
helper.assertError(field, XTEND_FIELD, IssueCodes.JAVA_DOC_LINKING_DIAGNOSTIC, "javaDoc", "List", "cannot be resolved to a type");
}
Aggregations