use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuperABReturnTypeParamTypes.
@Test
public void testInvokeWithSuperABReturnTypeParamTypes() {
MethodExpression me5 = factory.createMethodExpression(context, "${beanC.sayHello(beanA,beanB)}", String.class, new Class<?>[] { TesterBeanA.class, TesterBeanB.class });
Object r5 = me5.invoke(context, null);
Assert.assertEquals("AB: Hello A from B", r5.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuperAAB.
@Test
public void testInvokeWithSuperAAB() {
MethodExpression me8 = factory.createMethodExpression(context, "${beanC.sayHello(beanAA,beanB)}", null, null);
Object r8 = me8.invoke(context, null);
Assert.assertEquals("AAB: Hello AA from B", r8.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug52970.
@Test
public void testBug52970() {
MethodExpression me = factory.createMethodExpression(context, "${beanEnum.submit('APPLE')}", null, new Class<?>[] { TesterBeanEnum.class });
me.invoke(context, null);
ValueExpression ve = factory.createValueExpression(context, "#{beanEnum.lastSubmitted}", TesterEnum.class);
TesterEnum actual = (TesterEnum) ve.getValue(context);
Assert.assertEquals(TesterEnum.APPLE, actual);
}
use of jakarta.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);
Assert.assertEquals("AA2Hello World!", r.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuperAABB.
@Test
public void testInvokeWithSuperAABB() {
MethodExpression me9 = factory.createMethodExpression(context, "${beanC.sayHello(beanAA,beanBB)}", null, null);
Exception e = null;
try {
me9.invoke(context, null);
} catch (Exception e1) {
e = e1;
}
// Expected to fail
Assert.assertNotNull(e);
}
Aggregations