Search in sources :

Example 6 with PropertyValueNode

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

the class ExpressionNodeToHQLConverterTest method parseWithGreaterThanNode.

@Test
public void parseWithGreaterThanNode() {
    AbstractNode testAST = new GreaterThanNode(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 : AbstractNode(org.xwiki.notifications.filters.expression.generics.AbstractNode) StringValueNode(org.xwiki.notifications.filters.expression.StringValueNode) GreaterThanNode(org.xwiki.notifications.filters.expression.GreaterThanNode) PropertyValueNode(org.xwiki.notifications.filters.expression.PropertyValueNode) Test(org.junit.Test)

Aggregations

PropertyValueNode (org.xwiki.notifications.filters.expression.PropertyValueNode)6 Test (org.junit.Test)5 StringValueNode (org.xwiki.notifications.filters.expression.StringValueNode)4 AbstractNode (org.xwiki.notifications.filters.expression.generics.AbstractNode)4 EqualsNode (org.xwiki.notifications.filters.expression.EqualsNode)2 GreaterThanNode (org.xwiki.notifications.filters.expression.GreaterThanNode)2 NotificationPreference (org.xwiki.notifications.preferences.NotificationPreference)2 DocumentReference (org.xwiki.model.reference.DocumentReference)1 NotificationFilter (org.xwiki.notifications.filters.NotificationFilter)1 AndNode (org.xwiki.notifications.filters.expression.AndNode)1 DateValueNode (org.xwiki.notifications.filters.expression.DateValueNode)1 ExpressionNode (org.xwiki.notifications.filters.expression.ExpressionNode)1 InNode (org.xwiki.notifications.filters.expression.InNode)1 LesserThanNode (org.xwiki.notifications.filters.expression.LesserThanNode)1 NotEqualsNode (org.xwiki.notifications.filters.expression.NotEqualsNode)1 AbstractOperatorNode (org.xwiki.notifications.filters.expression.generics.AbstractOperatorNode)1