Search in sources :

Example 41 with MethodExpression

use of javax.el.MethodExpression in project tomcat by apache.

the class TestMethodExpressionImpl method testInvokeWithVarArgsAABBB.

@Test
public void testInvokeWithVarArgsAABBB() throws Exception {
    MethodExpression me6 = factory.createMethodExpression(context, "${beanC.sayHello(beanAA,beanBBB,beanBBB)}", null, null);
    Object r6 = me6.invoke(context, null);
    assertEquals("ABB[]: Hello AA from BBB, BBB", r6.toString());
}
Also used : MethodExpression(javax.el.MethodExpression) Test(org.junit.Test)

Example 42 with MethodExpression

use of javax.el.MethodExpression in project tomcat by apache.

the class TestMethodExpressionImpl method testBugPrimitives.

@Test
public void testBugPrimitives() throws Exception {
    MethodExpression me = factory.createMethodExpression(context, "${beanA.setValLong(5)}", null, null);
    me.invoke(context, null);
    ValueExpression ve = factory.createValueExpression(context, "#{beanA.valLong}", java.lang.String.class);
    assertEquals("5", ve.getValue(context));
}
Also used : ValueExpression(javax.el.ValueExpression) MethodExpression(javax.el.MethodExpression) Test(org.junit.Test)

Aggregations

MethodExpression (javax.el.MethodExpression)42 Test (org.junit.Test)41 ValueExpression (javax.el.ValueExpression)7 ELException (javax.el.ELException)1 MethodNotFoundException (javax.el.MethodNotFoundException)1 VariableMapper (javax.el.VariableMapper)1