tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1378716 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/el/TestMethodExpressionImpl.java
Date Wed, 29 Aug 2012 20:50:35 GMT
Author: markt
Date: Wed Aug 29 20:50:34 2012
New Revision: 1378716

URL: http://svn.apache.org/viewvc?rev=1378716&view=rev
Log:
Add some tests for Bug 53792

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/test/org/apache/el/TestMethodExpressionImpl.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1378715

Modified: tomcat/tc7.0.x/trunk/test/org/apache/el/TestMethodExpressionImpl.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/el/TestMethodExpressionImpl.java?rev=1378716&r1=1378715&r2=1378716&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/el/TestMethodExpressionImpl.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/el/TestMethodExpressionImpl.java Wed Aug 29 20:50:34
2012
@@ -34,6 +34,8 @@ import org.apache.jasper.el.ELContextImp
 
 public class TestMethodExpressionImpl {
 
+    private static final String BUG53792 = "TEST_PASS";
+
     private ExpressionFactory factory;
     private ELContext context;
 
@@ -430,4 +432,38 @@ public class TestMethodExpressionImpl {
         assertEquals(TesterEnum.APPLE, actual);
 
     }
+
+    @Test
+    public void testBug53792a() {
+        MethodExpression me = factory.createMethodExpression(context,
+                "${beanA.setBean(beanB)}", null ,
+                new Class<?>[] { TesterBeanB.class });
+        me.invoke(context, null);
+        me = factory.createMethodExpression(context,
+                "${beanB.setName('" + BUG53792 + "')}", null ,
+                new Class<?>[] { TesterBeanB.class });
+        me.invoke(context, null);
+
+        ValueExpression ve = factory.createValueExpression(context,
+                "#{beanA.getBean().name}", java.lang.String.class);
+        String actual = (String) ve.getValue(context);
+        assertEquals(BUG53792, actual);
+    }
+
+    @Test
+    public void testBug53792b() {
+        MethodExpression me = factory.createMethodExpression(context,
+                "${beanA.setBean(beanB)}", null ,
+                new Class<?>[] { TesterBeanB.class });
+        me.invoke(context, null);
+        me = factory.createMethodExpression(context,
+                "${beanB.setName('" + BUG53792 + "')}", null ,
+                new Class<?>[] { TesterBeanB.class });
+        me.invoke(context, null);
+
+        ValueExpression ve = factory.createValueExpression(context,
+                "#{beanA.getBean().name.length()}", java.lang.Integer.class);
+        Integer actual = (Integer) ve.getValue(context);
+        assertEquals(Integer.valueOf(BUG53792.length()), actual);
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message