tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r949808 - /tomcat/trunk/test/org/apache/el/TestValueExpressionImpl.java
Date Mon, 31 May 2010 17:29:17 GMT
Author: markt
Date: Mon May 31 17:29:17 2010
New Revision: 949808

URL: http://svn.apache.org/viewvc?rev=949808&view=rev
Log:
Test case for https://issues.apache.org/bugzilla/show_bug.cgi?id=49345
Fix to follow

Modified:
    tomcat/trunk/test/org/apache/el/TestValueExpressionImpl.java

Modified: tomcat/trunk/test/org/apache/el/TestValueExpressionImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestValueExpressionImpl.java?rev=949808&r1=949807&r2=949808&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/TestValueExpressionImpl.java (original)
+++ tomcat/trunk/test/org/apache/el/TestValueExpressionImpl.java Mon May 31 17:29:17 2010
@@ -53,4 +53,32 @@ public class TestValueExpressionImpl ext
         assertEquals("name", vr.getProperty());
     }
 
+ 
+    public void testBug49345() {
+        ExpressionFactory factory = ExpressionFactory.newInstance();
+        ELContext context = new ELContextImpl();
+        
+        TesterBeanA beanA = new TesterBeanA();
+        TesterBeanB beanB = new TesterBeanB();
+        beanB.setName("Tomcat");
+        beanA.setBean(beanB);
+        
+        ValueExpression var =
+            factory.createValueExpression(beanA, TesterBeanA.class);
+        context.getVariableMapper().setVariable("beanA", var);
+
+        ValueExpression ve = factory.createValueExpression(
+                context, "${beanA.bean.name}", String.class);
+
+        // First check the basics work
+        String result = (String) ve.getValue(context);
+        assertEquals("Tomcat", result);
+        
+        // Now check the value reference
+        ValueReference vr = ve.getValueReference(context);
+        assertNotNull(vr);
+        
+        assertEquals(beanB, vr.getBase());
+        assertEquals("name", vr.getProperty());
+    }
 }



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


Mime
View raw message