Search in sources :

Example 16 with MethodExpression

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

the class TestMethodExpressionImpl method testInvokeWithVarArgsAABB.

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

Example 17 with MethodExpression

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

the class TestMethodExpressionImpl method testBug56797a.

@Test
public void testBug56797a() {
    MethodExpression me = factory.createMethodExpression(context, "${beanAA.echo1('Hello World!')}", null, null);
    Object r = me.invoke(context, null);
    assertEquals("AA1Hello World!", r.toString());
}
Also used : MethodExpression(javax.el.MethodExpression) Test(org.junit.Test)

Example 18 with MethodExpression

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

the class TestMethodExpressionImpl method testBug56797b.

@Test
public void testBug56797b() {
    MethodExpression me = factory.createMethodExpression(context, "${beanAA.echo2('Hello World!')}", null, null);
    Object r = me.invoke(context, null);
    assertEquals("AA2Hello World!", r.toString());
}
Also used : MethodExpression(javax.el.MethodExpression) Test(org.junit.Test)

Example 19 with MethodExpression

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

the class TestMethodExpressionImpl method testInvokeWithVarArgsAB.

@Test
public void testInvokeWithVarArgsAB() throws Exception {
    MethodExpression me1 = factory.createMethodExpression(context, "${beanC.sayHello(beanA,beanB,beanB)}", null, null);
    Exception e = null;
    try {
        me1.invoke(context, null);
    } catch (Exception e1) {
        e = e1;
    }
    // Expected to fail
    assertNotNull(e);
}
Also used : MethodExpression(javax.el.MethodExpression) Test(org.junit.Test)

Example 20 with MethodExpression

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

the class TestMethodExpressionImpl method testInvokeWithVarArgsABB.

@Test
public void testInvokeWithVarArgsABB() throws Exception {
    MethodExpression me2 = factory.createMethodExpression(context, "${beanC.sayHello(beanA,beanBB,beanBB)}", null, null);
    Object r2 = me2.invoke(context, null);
    assertEquals("ABB[]: Hello A from BB, BB", r2.toString());
}
Also used : 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