Add some tests for bug50449 but haven't reproduced it yet
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 12 Dec 2010 19:50:45 +0000 (19:50 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 12 Dec 2010 19:50:45 +0000 (19:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1044898 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/el/TestMethodExpressionImpl.java
test/org/apache/el/TesterBeanB.java

index f7cd1c5..fd7cb96 100644 (file)
@@ -335,4 +335,18 @@ public class TestMethodExpressionImpl extends TestCase {
                 "#{beanA.valLong}", java.lang.String.class);
         assertEquals("5", ve.getValue(context));
     }
+    
+    public void testBug50449a() throws Exception {
+        MethodExpression me1 = factory.createMethodExpression(context,
+                "${beanB.sayHello()}", null, null);
+        String actual = (String) me1.invoke(context, null);
+        assertEquals("Hello from B", actual);
+    }
+
+    public void testBug50449b() throws Exception {
+        MethodExpression me1 = factory.createMethodExpression(context,
+                "${beanB.sayHello('Tomcat')}", null, null);
+        String actual = (String) me1.invoke(context, null);
+        assertEquals("Hello Tomcat from B", actual);
+    }
 }
index e92926b..de5d7a0 100644 (file)
@@ -28,6 +28,10 @@ public class TesterBeanB {
         this.name = name;
     }
     
+    public String sayHello() {
+        return "Hello from " + name;
+    }
+
     public String sayHello(String to) {
         return "Hello " + to + " from " + name;
     }