use of org.drools.mvel.parser.ast.expr.PointFreeExpr in project drools by kiegroup.
the class DroolsMvelParserTest method testDotFreeExprWithTemporalArgs.
@Test
public void testDotFreeExprWithTemporalArgs() {
String expr = "this after[5ms,8d] $a";
Expression expression = parseExpression(parser, expr).getExpr();
assertTrue(expression instanceof PointFreeExpr);
assertEquals(expr, printNode(expression));
}
use of org.drools.mvel.parser.ast.expr.PointFreeExpr in project drools by kiegroup.
the class DroolsMvelParserTest method testDotFreeExprWithThreeArgsInfinite.
@Test
public void testDotFreeExprWithThreeArgsInfinite() {
String expr = "this after[*,*,*,2s] $a";
Expression expression = parseExpression(parser, expr).getExpr();
assertTrue(expression instanceof PointFreeExpr);
assertFalse(((PointFreeExpr) expression).isNegated());
// please note the parsed expression once normalized would take the time unit for milliseconds.
assertEquals("this after[*,*,*,2s] $a", printNode(expression));
}
use of org.drools.mvel.parser.ast.expr.PointFreeExpr in project drools by kiegroup.
the class DroolsMvelParserTest method testDotFreeExprWithArgsInfinite.
@Test
public void testDotFreeExprWithArgsInfinite() {
String expr = "this after[5s,*] $a";
Expression expression = parseExpression(parser, expr).getExpr();
assertTrue(expression instanceof PointFreeExpr);
assertFalse(((PointFreeExpr) expression).isNegated());
// please note the parsed expression once normalized would take the time unit for milliseconds.
assertEquals("this after[5s,*] $a", printNode(expression));
}
use of org.drools.mvel.parser.ast.expr.PointFreeExpr in project drools by kiegroup.
the class DroolsMvelParserTest method testDotFreeExprWithFourTemporalArgs.
@Test
public void testDotFreeExprWithFourTemporalArgs() {
String expr = "this includes[1s,1m,1h,1d] $a";
Expression expression = parseExpression(parser, expr).getExpr();
assertTrue(expression instanceof PointFreeExpr);
assertEquals(expr, printNode(expression));
}
Aggregations