* @param expected is the expected value of the expression
* @throws Exception if the expression could not be evaluationed or an assertion
* fails
*/
public void assertExpression(String expression, Object expected) throws Exception {
Expression exp = engine.createExpression(expression);
Object value = exp.evaluate(context);
if (expected instanceof BigDecimal) {
JexlArithmetic jexla = engine.getArithmetic();
assertTrue("expression: " + expression, ((BigDecimal) expected).compareTo(jexla.toBigDecimal(value)) == 0);
} else {
assertEquals("expression: " + expression, expected, value);