use of javax.el.MethodExpression in project tomcat by apache.
the class TestMethodExpressionImpl method testBug57855e.
@Test
public void testBug57855e() {
MethodExpression me = factory.createMethodExpression(context, "${beanB.echo}", null, new Class[] { String.class });
Object r = me.invoke(context, new String[] { "aaa", "bbb" });
assertEquals("aaa, bbb", r.toString());
}
use of javax.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);
}
use of javax.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);
assertEquals("BB", r);
}
use of javax.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);
assertEquals("Hello from BB", actual);
}
use of javax.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);
assertEquals("AAB: Hello AA from BBB", r10.toString());
}
Aggregations