Search in sources :

Example 1 with ExtensionFile

use of org.eclipse.internal.xtend.xtend.ast.ExtensionFile in project dsl-devkit by dsldevkit.

the class CompilationContextTest method isExtension.

@Test
public void isExtension() {
    ExecutionContextImpl executionContext = new ExecutionContextImpl();
    executionContext.registerMetaModel(new JavaBeansMetaModel());
    ExtensionFile extensionFile = ParseFacade.file(new InputStreamReader(getClass().getResourceAsStream("/com/avaloq/tools/ddk/xtext/generator/expression/TestExtensions.ext")), "TestExtensions.ext");
    executionContext = (ExecutionContextImpl) executionContext.cloneWithResource(extensionFile);
    final CompilationContext context = new CompilationContext(executionContext, null);
    assertTrue("test extension not identified", context.isExtension("test"));
}
Also used : InputStreamReader(java.io.InputStreamReader) ExecutionContextImpl(org.eclipse.xtend.expression.ExecutionContextImpl) CompilationContext(com.avaloq.tools.ddk.xtext.expression.generator.CompilationContext) JavaBeansMetaModel(org.eclipse.xtend.type.impl.java.JavaBeansMetaModel) ExtensionFile(org.eclipse.internal.xtend.xtend.ast.ExtensionFile) Test(org.junit.Test)

Aggregations

CompilationContext (com.avaloq.tools.ddk.xtext.expression.generator.CompilationContext)1 InputStreamReader (java.io.InputStreamReader)1 ExtensionFile (org.eclipse.internal.xtend.xtend.ast.ExtensionFile)1 ExecutionContextImpl (org.eclipse.xtend.expression.ExecutionContextImpl)1 JavaBeansMetaModel (org.eclipse.xtend.type.impl.java.JavaBeansMetaModel)1 Test (org.junit.Test)1