Search in sources :

Example 1 with LesserThanNode

use of org.xwiki.notifications.filters.expression.LesserThanNode in project xwiki-platform by xwiki.

the class ExpressionNodeToHQLConverterTest method parseWithLesserThanNode.

@Test
public void parseWithLesserThanNode() {
    AbstractNode testAST = new LesserThanNode(new PropertyValueNode(EventProperty.DATE), new StringValueNode(TEST_VALUE_1));
    ExpressionNodeToHQLConverter.HQLQuery result = parser.parse(testAST);
    assertEquals(String.format("event.date <= :%s", TEST_VALUE_1_IDENTIFIER), result.getQuery());
    assertEquals(TEST_VALUE_1, result.getQueryParameters().get(TEST_VALUE_1_IDENTIFIER));
}
Also used : LesserThanNode(org.xwiki.notifications.filters.expression.LesserThanNode) AbstractNode(org.xwiki.notifications.filters.expression.generics.AbstractNode) StringValueNode(org.xwiki.notifications.filters.expression.StringValueNode) PropertyValueNode(org.xwiki.notifications.filters.expression.PropertyValueNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 LesserThanNode (org.xwiki.notifications.filters.expression.LesserThanNode)1 PropertyValueNode (org.xwiki.notifications.filters.expression.PropertyValueNode)1 StringValueNode (org.xwiki.notifications.filters.expression.StringValueNode)1 AbstractNode (org.xwiki.notifications.filters.expression.generics.AbstractNode)1