Search in sources :

Example 1 with OverrideTester

use of org.eclipse.xtext.xbase.typesystem.override.OverrideTester in project xtext-xtend by eclipse.

the class SuperMemberImplementorTest method checkOverrideMethodCode.

protected void checkOverrideMethodCode(String operationName, String overrideCode) {
    StringBuilderBasedAppendable appendable = new StringBuilderBasedAppendable();
    LightweightTypeReference contextType = getContextType();
    IResolvedOperation resolvedOperation = new BottomResolvedOperation((JvmOperation) findExecutable(implementedInterface, operationName), contextType, new OverrideTester());
    implementor.appendOverrideFunction(xtendClass, resolvedOperation, appendable);
    String code = appendable.toString();
    if (!equalsIgnoreWhitespace(overrideCode, code))
        assertEquals(overrideCode, code);
}
Also used : LightweightTypeReference(org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference) StringBuilderBasedAppendable(org.eclipse.xtext.xbase.compiler.StringBuilderBasedAppendable) OverrideTester(org.eclipse.xtext.xbase.typesystem.override.OverrideTester) IResolvedOperation(org.eclipse.xtext.xbase.typesystem.override.IResolvedOperation) BottomResolvedOperation(org.eclipse.xtext.xbase.typesystem.override.BottomResolvedOperation)

Aggregations

StringBuilderBasedAppendable (org.eclipse.xtext.xbase.compiler.StringBuilderBasedAppendable)1 BottomResolvedOperation (org.eclipse.xtext.xbase.typesystem.override.BottomResolvedOperation)1 IResolvedOperation (org.eclipse.xtext.xbase.typesystem.override.IResolvedOperation)1 OverrideTester (org.eclipse.xtext.xbase.typesystem.override.OverrideTester)1 LightweightTypeReference (org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference)1