use of org.graylog.plugins.pipelineprocessor.ast.expressions.AndExpression in project graylog2-server by Graylog2.
the class PrecedenceTest method andVsEquality.
@Test
public void andVsEquality() {
final Rule rule = parseRule("rule \"test\" when true == false && true then end");
final LogicalExpression when = rule.when();
assertThat(when).isInstanceOf(AndExpression.class);
AndExpression andExpr = (AndExpression) when;
assertThat(andExpr.left()).isInstanceOf(EqualityExpression.class);
assertThat(andExpr.right()).isInstanceOf(BooleanExpression.class);
}
use of org.graylog.plugins.pipelineprocessor.ast.expressions.AndExpression 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);
}
Aggregations