use of org.drools.mvel.parser.ast.expr.OOPathExpr in project drools by kiegroup.
the class DroolsMvelParserTest method testOOPathExprWithMultipleCondition.
@Test
public void testOOPathExprWithMultipleCondition() {
String expr = "$address : /address[street == \"Elm\",city == \"Big City\"]";
DrlxExpression drlx = parseExpression(parser, expr);
Expression expression = drlx.getExpr();
assertTrue(expression instanceof OOPathExpr);
assertEquals(expr, printNode(drlx));
}
use of org.drools.mvel.parser.ast.expr.OOPathExpr in project drools by kiegroup.
the class DroolsMvelParserTest method testOOPathExpr.
@Test
public void testOOPathExpr() {
String expr = "/wife/children[age > 10]/toys";
DrlxExpression drlx = parseExpression(parser, expr);
Expression expression = drlx.getExpr();
assertTrue(expression instanceof OOPathExpr);
assertEquals(expr, printNode(drlx));
}
use of org.drools.mvel.parser.ast.expr.OOPathExpr in project drools by kiegroup.
the class DroolsMvelParserTest method testOOPathExprWithDeclaration.
@Test
public void testOOPathExprWithDeclaration() {
String expr = "$toy : /wife/children[age > 10]/toys";
DrlxExpression drlx = parseExpression(parser, expr);
assertEquals("$toy", drlx.getBind().asString());
Expression expression = drlx.getExpr();
assertTrue(expression instanceof OOPathExpr);
assertEquals(expr, printNode(drlx));
}
Aggregations