Search in sources :

Example 6 with LogicalExpression

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

the class PrecedenceTest method notVsAndOr.

@Test
public void notVsAndOr() {
    final Rule rule = parseRule("rule \"test\" when !true && false then end");
    final LogicalExpression when = rule.when();
    assertThat(when).isInstanceOf(AndExpression.class);
    AndExpression and = (AndExpression) when;
    assertThat(and.left()).isInstanceOf(NotExpression.class);
    assertThat(and.right()).isInstanceOf(BooleanExpression.class);
}
Also used : LogicalExpression(org.graylog.plugins.pipelineprocessor.ast.expressions.LogicalExpression) AndExpression(org.graylog.plugins.pipelineprocessor.ast.expressions.AndExpression) Rule(org.graylog.plugins.pipelineprocessor.ast.Rule) BaseParserTest(org.graylog.plugins.pipelineprocessor.BaseParserTest) Test(org.junit.Test)

Aggregations

LogicalExpression (org.graylog.plugins.pipelineprocessor.ast.expressions.LogicalExpression)6 BaseParserTest (org.graylog.plugins.pipelineprocessor.BaseParserTest)5 Rule (org.graylog.plugins.pipelineprocessor.ast.Rule)5 Test (org.junit.Test)5 AndExpression (org.graylog.plugins.pipelineprocessor.ast.expressions.AndExpression)2 EqualityExpression (org.graylog.plugins.pipelineprocessor.ast.expressions.EqualityExpression)2 ExecutionException (java.util.concurrent.ExecutionException)1 BooleanExpression (org.graylog.plugins.pipelineprocessor.ast.expressions.BooleanExpression)1 OrExpression (org.graylog.plugins.pipelineprocessor.ast.expressions.OrExpression)1