use of org.whole.lang.java.model.Assignment in project whole by wholeplatform.
the class ResolversTest method testAmbiguousDataEntityResolverTightening.
@Category(KnownFailingTests.class)
@Test
public void testAmbiguousDataEntityResolverTightening() {
// workaround for JVM termination on StackOverflowError
Assert.fail();
Expression expression = createResolver(JavaEntityDescriptorEnum.Expression);
Assignment assignment = jf.createAssignment();
assignment.setRightHandSide(expression);
expression.wSetValue("stringLiteral");
Assert.assertTrue(Matcher.matchImpl(JavaEntityDescriptorEnum.StringLiteral, assignment.getRightHandSide()));
}
use of org.whole.lang.java.model.Assignment in project whole by wholeplatform.
the class SelectQueriesTest method testSelectTupleOfTemplatesAs.
@Test
public void testSelectTupleOfTemplatesAs() {
Model model = new XmlModel().create();
ITemplateManager tm = SelectQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("selectTupleOfTemplatesAs");
IBindingManager bm = BindingManagerFactory.instance.createArguments();
for (IEntity tuple : BehaviorUtils.compileAndLazyEvaluate(query, model, bm)) {
FieldDeclaration f = (FieldDeclaration) tuple.wGet(0);
SingleVariableDeclaration p = (SingleVariableDeclaration) tuple.wGet(1);
ExpressionStatement s = (ExpressionStatement) tuple.wGet(2);
Feature e = (Feature) tuple.wGet(3);
String ptype = e.getType().wStringValue();
String pname = e.getName().wStringValue();
assertSame(f, bm.wGet("field"));
assertEquals(ptype, f.getType().wStringValue());
assertSame(p, bm.wGet("param"));
assertEquals(ptype, p.getType().wStringValue());
assertEquals(pname, p.getName().wStringValue());
assertSame(s, bm.wGet("init"));
assertEquals(pname, ((Assignment) s.getExpression()).getRightHandSide().wStringValue());
}
}
use of org.whole.lang.java.model.Assignment in project whole by wholeplatform.
the class ResolversTest method testDataEntityResolverTightening.
@Test
public void testDataEntityResolverTightening() {
Expression expression = createResolver(JavaEntityDescriptorEnum.Expression);
Assignment assignment = jf.createAssignment();
assignment.setRightHandSide(expression);
expression.wSetValue(false);
Assert.assertTrue(Matcher.matchImpl(JavaEntityDescriptorEnum.BooleanLiteral, assignment.getRightHandSide()));
}
Aggregations