Search in sources :

Example 76 with XtendInterface

use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.

the class OverrideValidationTest method testInterfaceCompatibleThrowsClause_04.

@Test
public void testInterfaceCompatibleThrowsClause_04() throws Exception {
    XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override throwable() throws RuntimeException }");
    helper.assertNoError(xtendInterface.getMembers().get(0), INCOMPATIBLE_THROWS_CLAUSE);
}
Also used : XtendInterface(org.eclipse.xtend.core.xtend.XtendInterface) Test(org.junit.Test)

Example 77 with XtendInterface

use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.

the class OverrideValidationTest method testInterfaceIncompatibleThrowsClause_05.

@Test
public void testInterfaceIncompatibleThrowsClause_05() throws Exception {
    XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override generifiedRuntimeException() throws java.io.FileNotFoundException }");
    helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, INCOMPATIBLE_THROWS_CLAUSE, "Exception", "FileNotFoundException", "not", "compatible", "throws", "clause");
}
Also used : XtendInterface(org.eclipse.xtend.core.xtend.XtendInterface) Test(org.junit.Test)

Example 78 with XtendInterface

use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.

the class OverrideValidationTest method testInterfaceIncompatibleThrowsClause_01.

@Test
public void testInterfaceIncompatibleThrowsClause_01() throws Exception {
    XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override runtimeException() throws Exception }");
    helper.assertError(xtendInterface.getMembers().get(0), XTEND_FUNCTION, INCOMPATIBLE_THROWS_CLAUSE, "Exception", "not", "compatible", "throws", "clause");
}
Also used : XtendInterface(org.eclipse.xtend.core.xtend.XtendInterface) Test(org.junit.Test)

Example 79 with XtendInterface

use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.

the class OverrideValidationTest method testInterfaceCompatibleThrowsClause_10.

@Test
public void testInterfaceCompatibleThrowsClause_10() throws Exception {
    XtendInterface xtendInterface = interfaze("interface Foo extends test.ExceptionThrowingInterface { override <E extends java.io.IOException> generifiedIoException() throws E, NullPointerException, OutOfMemoryError }");
    helper.assertNoError(xtendInterface.getMembers().get(0), INCOMPATIBLE_THROWS_CLAUSE);
}
Also used : XtendInterface(org.eclipse.xtend.core.xtend.XtendInterface) Test(org.junit.Test)

Example 80 with XtendInterface

use of org.eclipse.xtend.core.xtend.XtendInterface in project xtext-xtend by eclipse.

the class XtendValidationTest method testAbstractMethodWithoutReturnType_1.

@Test
public void testAbstractMethodWithoutReturnType_1() throws Exception {
    XtendInterface clazz = interfaze("interface Foo { def test() }");
    helper.assertError(clazz.getMembers().get(0), XTEND_FUNCTION, ABSTRACT_METHOD_MISSING_RETURN_TYPE);
}
Also used : XtendInterface(org.eclipse.xtend.core.xtend.XtendInterface) Test(org.junit.Test)

Aggregations

XtendInterface (org.eclipse.xtend.core.xtend.XtendInterface)82 Test (org.junit.Test)78 XtendClass (org.eclipse.xtend.core.xtend.XtendClass)5 XtendAnnotationType (org.eclipse.xtend.core.xtend.XtendAnnotationType)4 XtendEnum (org.eclipse.xtend.core.xtend.XtendEnum)4 RichString (org.eclipse.xtend.core.xtend.RichString)3 XtendField (org.eclipse.xtend.core.xtend.XtendField)3 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)3 XtendMember (org.eclipse.xtend.core.xtend.XtendMember)2 XtendParameter (org.eclipse.xtend.core.xtend.XtendParameter)2 EObject (org.eclipse.emf.ecore.EObject)1 EPackage (org.eclipse.emf.ecore.EPackage)1 InternalEObject (org.eclipse.emf.ecore.InternalEObject)1 XtendAnnotationTypeDeclarationImpl (org.eclipse.xtend.core.macro.declaration.XtendAnnotationTypeDeclarationImpl)1 XtendClassDeclarationImpl (org.eclipse.xtend.core.macro.declaration.XtendClassDeclarationImpl)1 XtendEnumerationDeclarationImpl (org.eclipse.xtend.core.macro.declaration.XtendEnumerationDeclarationImpl)1 XtendInterfaceDeclarationImpl (org.eclipse.xtend.core.macro.declaration.XtendInterfaceDeclarationImpl)1 XtendTypeDeclarationImpl (org.eclipse.xtend.core.macro.declaration.XtendTypeDeclarationImpl)1 JavaConverterTest (org.eclipse.xtend.core.tests.javaconverter.JavaConverterTest)1 RichStringLiteral (org.eclipse.xtend.core.xtend.RichStringLiteral)1