use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug52445a.
@Test
public void testBug52445a() {
MethodExpression me = factory.createMethodExpression(context, "${beanA.setBean(beanBB)}", null, new Class<?>[] { TesterBeanB.class });
me.invoke(context, null);
MethodExpression me1 = factory.createMethodExpression(context, "${beanA.bean.sayHello()}", null, null);
String actual = (String) me1.invoke(context, null);
Assert.assertEquals("Hello from BB", actual);
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBugPrimitives.
@Test
public void testBugPrimitives() throws Exception {
MethodExpression me = factory.createMethodExpression(context, "${beanA.setValLong(5)}", null, null);
me.invoke(context, null);
ValueExpression ve = factory.createValueExpression(context, "#{beanA.valLong}", java.lang.String.class);
Assert.assertEquals("5", ve.getValue(context));
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug57855d.
@Test
public void testBug57855d() {
MethodExpression me = factory.createMethodExpression(context, "${beanB.echo}", null, new Class[] { String.class });
Object r = me.invoke(context, new String[] { "aaa" });
Assert.assertEquals("aaa", r.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug57855e.
@Test(expected = MethodNotFoundException.class)
public void testBug57855e() {
MethodExpression me = factory.createMethodExpression(context, "${beanB.echo}", null, new Class[] { String.class });
Object r = me.invoke(context, new String[] { "aaa", "bbb" });
Assert.assertEquals("aaa, bbb", r.toString());
}
use of jakarta.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testInvokeWithSuperABNoReturnTypeNoParamTypes.
@Test
public void testInvokeWithSuperABNoReturnTypeNoParamTypes() {
MethodExpression me2 = factory.createMethodExpression(context, "${beanC.sayHello(beanA,beanB)}", null, null);
Object r2 = me2.invoke(context, null);
Assert.assertEquals("AB: Hello A from B", r2.toString());
}
Aggregations