use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug50449a.
@Test
public void testBug50449a() throws Exception {
MethodExpression me1 = factory.createMethodExpression(context, "${beanB.sayHello()}", null, null);
String actual = (String) me1.invoke(context, null);
Assert.assertEquals("Hello from B", actual);
}
use of jakarta.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);
Assert.assertEquals("ABB[]: Hello A from BB, BB", r2.toString());
}
use of jakarta.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
Assert.assertNotNull(e);
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuperAABBB.
@Test
public void testInvokeWithSuperAABBB() {
// The Java compiler reports this as ambiguous. Using the parameter that
// matches exactly seems reasonable to limit the scope of the method
// search so the EL will find a match.
MethodExpression me10 = factory.createMethodExpression(context, "${beanC.sayHello(beanAA,beanBBB)}", null, null);
Object r10 = me10.invoke(context, null);
Assert.assertEquals("AAB: Hello AA from BBB", r10.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug57855c.
@Test
public void testBug57855c() {
MethodExpression me = factory.createMethodExpression(context, "${beanB.echo}", null, new Class[] { String.class });
me.invoke(context, null);
}
Aggregations