DirectAttributeEvaluator extends AbstractAttributeEvaluator { public Object evaluate(String expression, Request request) { return expression; }  Object evaluate(String expression, Request request);  }
@Test public void testEvaluate() { String expression = "This is an expression"; Attribute attribute = new Attribute(null, Expression.createExpression( expression, null), null, (String) null); Object result = evaluator.evaluate(attribute, null); assertEquals("The expression has not been evaluated correctly", result, expression); expression = "${attributeName}"; attribute.setExpressionObject(new Expression(expression)); result = evaluator.evaluate(attribute, null); assertEquals("The expression has not been evaluated correctly", result, expression); }
@Test(expected = IllegalArgumentException.class) public void testEvaluateNullAttribute() { evaluator.evaluate((Attribute) null, null); }
@Test public void testEvaluateString() { String expression = "This is an expression"; Object result = evaluator.evaluate(expression, null); assertEquals("The expression has not been evaluated correctly", result, expression); expression = "${attributeName}"; result = evaluator.evaluate(expression, null); assertEquals("The expression has not been evaluated correctly", result, expression); }