Search in sources :

Example 26 with MethodExpression

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

the class TestMethodExpressionImpl method testInvokeWithSuperAAAB.

@Test
public void testInvokeWithSuperAAAB() {
    MethodExpression me11 = factory.createMethodExpression(context, "${beanC.sayHello(beanAAA,beanB)}", null, null);
    Object r11 = me11.invoke(context, null);
    assertEquals("AAB: Hello AAA from B", r11.toString());
}
Also used : MethodExpression(javax.el.MethodExpression) Test(org.junit.Test)

Example 27 with MethodExpression

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

the class TestMethodExpressionImpl method testInvokeWithSuperABBB.

@Test
public void testInvokeWithSuperABBB() {
    MethodExpression me7 = factory.createMethodExpression(context, "${beanC.sayHello(beanA,beanBBB)}", null, null);
    Object r7 = me7.invoke(context, null);
    assertEquals("ABB: Hello A from BBB", r7.toString());
}
Also used : MethodExpression(javax.el.MethodExpression) Test(org.junit.Test)

Example 28 with MethodExpression

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

the class TestMethodExpressionImpl method testInvokeWithVarArgsAAB.

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

Example 29 with MethodExpression

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

the class TestMethodExpressionImpl method testInvokeWithSuperAAABBB.

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

Example 30 with MethodExpression

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

the class TestMethodExpressionImpl method testBug50449b.

@Test
public void testBug50449b() throws Exception {
    MethodExpression me1 = factory.createMethodExpression(context, "${beanB.sayHello('Tomcat')}", null, null);
    String actual = (String) me1.invoke(context, null);
    assertEquals("Hello Tomcat from B", actual);
}
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