Search in sources :

Example 26 with EvaluationException

use of org.springframework.expression.EvaluationException in project uPortal by Jasig.

the class StylesheetAttributeSourceForSpELVariablesTest method spELEvaluationForInputThrowsEvaluationException.

private void spELEvaluationForInputThrowsEvaluationException(final String input) {
    final Expression expression = mock(Expression.class);
    given(this.portalSpELService.parseExpression(input)).willReturn(expression);
    given(this.portalSpELService.getValue(eq(expression), any(WebRequest.class), eq(String.class))).willThrow(new EvaluationException(input));
}
Also used : WebRequest(org.springframework.web.context.request.WebRequest) Expression(org.springframework.expression.Expression) EvaluationException(org.springframework.expression.EvaluationException)

Aggregations

EvaluationException (org.springframework.expression.EvaluationException)26 Expression (org.springframework.expression.Expression)16 Test (org.junit.Test)14 SpelExpressionParser (org.springframework.expression.spel.standard.SpelExpressionParser)11 StandardEvaluationContext (org.springframework.expression.spel.support.StandardEvaluationContext)10 ArrayList (java.util.ArrayList)5 AccessException (org.springframework.expression.AccessException)5 ParseException (org.springframework.expression.ParseException)5 TypeDescriptor (org.springframework.core.convert.TypeDescriptor)4 SpelEvaluationException (org.springframework.expression.spel.SpelEvaluationException)4 MethodParameter (org.springframework.core.MethodParameter)3 TypeConverter (org.springframework.expression.TypeConverter)3 SpelExpression (org.springframework.expression.spel.standard.SpelExpression)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 PropertyAccessor (org.springframework.expression.PropertyAccessor)2 CompilablePropertyAccessor (org.springframework.expression.spel.CompilablePropertyAccessor)2 ReflectivePropertyAccessor (org.springframework.expression.spel.support.ReflectivePropertyAccessor)2 StandardTypeLocator (org.springframework.expression.spel.support.StandardTypeLocator)2 Constructor (java.lang.reflect.Constructor)1