Search in sources :

Example 1 with XbaseFactoryImpl

use of org.eclipse.xtext.xbase.impl.XbaseFactoryImpl in project xtext-xtend by eclipse.

the class JavaConverterTest method testForceStatementForTargetObject.

@Test
public void testForceStatementForTargetObject() {
    Assert.assertFalse("Not a statement before annotation", this.j2x.shouldForceStatementMode(new XAnnotationsFactoryImpl().createXAnnotation()));
    final XtendConstructor xc = new XtendFactoryImpl().createXtendConstructor();
    Assert.assertFalse("Not a statement before constructor", this.j2x.shouldForceStatementMode(xc));
    final XBlockExpression block = new XbaseFactoryImpl().createXBlockExpression();
    xc.setExpression(block);
    Assert.assertTrue("Force statement when parent is executable", this.j2x.shouldForceStatementMode(block));
}
Also used : XBlockExpression(org.eclipse.xtext.xbase.XBlockExpression) XAnnotationsFactoryImpl(org.eclipse.xtext.xbase.annotations.xAnnotations.impl.XAnnotationsFactoryImpl) XbaseFactoryImpl(org.eclipse.xtext.xbase.impl.XbaseFactoryImpl) XtendConstructor(org.eclipse.xtend.core.xtend.XtendConstructor) XtendFactoryImpl(org.eclipse.xtend.core.xtend.impl.XtendFactoryImpl) Test(org.junit.Test)

Aggregations

XtendConstructor (org.eclipse.xtend.core.xtend.XtendConstructor)1 XtendFactoryImpl (org.eclipse.xtend.core.xtend.impl.XtendFactoryImpl)1 XBlockExpression (org.eclipse.xtext.xbase.XBlockExpression)1 XAnnotationsFactoryImpl (org.eclipse.xtext.xbase.annotations.xAnnotations.impl.XAnnotationsFactoryImpl)1 XbaseFactoryImpl (org.eclipse.xtext.xbase.impl.XbaseFactoryImpl)1 Test (org.junit.Test)1