use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class XtendValidationTest method testInterfaceExtendsClass.
@Test
public void testInterfaceExtendsClass() throws Exception {
XtendInterface interfaze = interfaze("interface Foo extends Object {}");
helper.assertError(interfaze, XTEND_INTERFACE, INTERFACE_EXPECTED, "Extended", "interface");
}
use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.
the class Java8ConverterTest method testDefaultMethod.
@Test
public void testDefaultMethod() throws Exception {
JavaConverterTest.DUMP = true;
StringConcatenation _builder = new StringConcatenation();
_builder.append("public interface XtendInterfaze {");
_builder.newLine();
_builder.append(" ");
_builder.append("public default String foo() {");
_builder.newLine();
_builder.append(" ");
_builder.append("return \"- Hi, I\\\'m a default impl\";");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.newLine();
_builder.append(" ");
_builder.append("public abstract String baar();");
_builder.newLine();
_builder.append("}");
final XtendInterface clazz = this.toValidXtendInterface(_builder.toString());
Assert.assertNotNull(clazz);
}
Aggregations