Search in sources :

Example 1 with OrExpression

use of org.graylog.plugins.pipelineprocessor.ast.expressions.OrExpression in project graylog2-server by Graylog2.

the class PrecedenceTest method orVsEquality.

@Test
public void orVsEquality() {
    final Rule rule = parseRule("rule \"test\" when true == false || true then end");
    final LogicalExpression when = rule.when();
    assertThat(when).isInstanceOf(OrExpression.class);
    OrExpression orEprx = (OrExpression) when;
    assertThat(orEprx.left()).isInstanceOf(EqualityExpression.class);
    assertThat(orEprx.right()).isInstanceOf(BooleanExpression.class);
}
Also used : LogicalExpression(org.graylog.plugins.pipelineprocessor.ast.expressions.LogicalExpression) Rule(org.graylog.plugins.pipelineprocessor.ast.Rule) OrExpression(org.graylog.plugins.pipelineprocessor.ast.expressions.OrExpression) BaseParserTest(org.graylog.plugins.pipelineprocessor.BaseParserTest) Test(org.junit.Test)

Aggregations

BaseParserTest (org.graylog.plugins.pipelineprocessor.BaseParserTest)1 Rule (org.graylog.plugins.pipelineprocessor.ast.Rule)1 LogicalExpression (org.graylog.plugins.pipelineprocessor.ast.expressions.LogicalExpression)1 OrExpression (org.graylog.plugins.pipelineprocessor.ast.expressions.OrExpression)1 Test (org.junit.Test)1