use of jakarta.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);
Assert.assertEquals("AAB: Hello AAA from B", r11.toString());
}
use of jakarta.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);
Assert.assertEquals("ABB[]: Hello AA from BB, BB", r5.toString());
}
use of jakarta.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
Assert.assertNotNull(e);
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithVarArgsAAABB.
@Test
public void testInvokeWithVarArgsAAABB() throws Exception {
MethodExpression me8 = factory.createMethodExpression(context, "${beanC.sayHello(beanAAA,beanBB,beanBB)}", null, null);
Object r8 = me8.invoke(context, null);
Assert.assertEquals("ABB[]: Hello AAA from BB, BB", r8.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testGetMethodInfo01.
@Test
public void testGetMethodInfo01() throws Exception {
MethodExpression me = factory.createMethodExpression(context, "#{beanA.setName('New value')}", null, null);
// This is the call that failed
MethodInfo mi = me.getMethodInfo(context);
// The rest is to check it worked correctly
Assert.assertEquals(void.class, mi.getReturnType());
Assert.assertEquals(1, mi.getParamTypes().length);
Assert.assertEquals(String.class, mi.getParamTypes()[0]);
}
Aggregations