@Test public void resolve_literal_expression_throw_exception() { BindingTuple bindingTuple = ExprValueUtils.tupleValue(ImmutableMap.of("ip", "209.160.24.63")).bindingTuples(); ExpressionEvaluationException exception = assertThrows(ExpressionEvaluationException.class, () -> bindingTuple.resolve(DSL.literal(1))); assertEquals("can resolve expression: 1", exception.getMessage()); }
@Override public ExprValue resolve(Expression var) { if (var instanceof ReferenceExpression) { return resolve(((ReferenceExpression) var)); } else { throw new ExpressionEvaluationException(String.format("can resolve expression: %s", var)); } }
BindingTuple implements Environment<Expression, ExprValue> { @Override public ExprValue resolve(Expression var) { if (var instanceof ReferenceExpression) { return resolve(((ReferenceExpression) var)); } else { throw new ExpressionEvaluationException(String.format("can resolve expression: %s", var)); } } }
BindingTuple implements Environment<Expression, ExprValue> { @Override public ExprValue resolve(Expression var) { if (var instanceof ReferenceExpression) { return resolve(((ReferenceExpression) var)); } else { throw new ExpressionEvaluationException(String.format("can resolve expression: %s", var)); } }  }
BindingTuple implements Environment<Expression, ExprValue> { @Override public ExprValue resolve(Expression var) { if (var instanceof ReferenceExpression) { return resolve(((ReferenceExpression) var)); } else { throw new ExpressionEvaluationException(String.format("can resolve expression: %s", var)); } }  @Override ExprValue resolve(Expression var); abstract ExprValue resolve(ReferenceExpression ref); }
BindingTuple implements Environment<Expression, ExprValue> { @Override public ExprValue resolve(Expression var) { if (var instanceof ReferenceExpression) { return resolve(((ReferenceExpression) var)); } else { throw new ExpressionEvaluationException(String.format("can resolve expression: %s", var)); } }  @Override ExprValue resolve(Expression var); abstract ExprValue resolve(ReferenceExpression ref); static BindingTuple EMPTY; }