Example #1
0
  @Test
  public void testNormalizeSymbolReferenceAndReference() throws Exception {
    OrOperator operator = new OrOperator();

    Function function =
        new Function(operator.info(), Arrays.<Symbol>asList(new Reference(), new Reference()));
    Symbol normalizedSymbol = operator.normalizeSymbol(function);
    assertThat(normalizedSymbol, instanceOf(Function.class));
  }
Example #2
0
  @Test
  public void testNormalizeSymbolReferenceAndLiteral() throws Exception {
    OrOperator operator = new OrOperator();

    Function function =
        new Function(
            operator.info(), Arrays.<Symbol>asList(new Reference(), Literal.newLiteral(true)));
    Symbol normalizedSymbol = operator.normalizeSymbol(function);
    assertLiteralSymbol(normalizedSymbol, true);
  }
Example #3
0
 private Boolean or(Boolean left, Boolean right) {
   OrOperator operator = new OrOperator();
   return operator.evaluate(Literal.newLiteral(left), Literal.newLiteral(right));
 }