use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuper.
@Test
public void testInvokeWithSuper() {
MethodExpression me = factory.createMethodExpression(context, "${beanA.setBean(beanBB)}", null, new Class<?>[] { TesterBeanB.class });
me.invoke(context, null);
ValueExpression ve = factory.createValueExpression(context, "${beanA.bean.name}", String.class);
Object r = ve.getValue(context);
Assert.assertEquals("BB", r);
}
use of jakarta.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);
Assert.assertEquals("ABB[]: Hello AA from BBB, BBB", r6.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug53792c.
@Test
public void testBug53792c() {
MethodExpression me = factory.createMethodExpression(context, "#{beanB.sayHello().length()}", null, new Class<?>[] {});
Integer result = (Integer) me.invoke(context, null);
Assert.assertEquals(beanB.sayHello().length(), result.intValue());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuperABReturnTypeNoParamTypes.
@Test
public void testInvokeWithSuperABReturnTypeNoParamTypes() {
MethodExpression me3 = factory.createMethodExpression(context, "${beanC.sayHello(beanA,beanB)}", String.class, null);
Object r3 = me3.invoke(context, null);
Assert.assertEquals("AB: Hello A from B", r3.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuperABNoReturnTypeParamTypes.
@Test
public void testInvokeWithSuperABNoReturnTypeParamTypes() {
MethodExpression me4 = factory.createMethodExpression(context, "${beanC.sayHello(beanA,beanB)}", null, new Class<?>[] { TesterBeanA.class, TesterBeanB.class });
Object r4 = me4.invoke(context, null);
Assert.assertEquals("AB: Hello A from B", r4.toString());
}
Aggregations