tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r933140 - /tomcat/trunk/test/org/apache/el/parser/TestELParser.java
Date Mon, 12 Apr 2010 08:26:34 GMT
Author: markt
Date: Mon Apr 12 08:26:34 2010
New Revision: 933140

URL: http://svn.apache.org/viewvc?rev=933140&view=rev
Log:
Re-factor to allow easier addition of extra tests

Modified:
    tomcat/trunk/test/org/apache/el/parser/TestELParser.java

Modified: tomcat/trunk/test/org/apache/el/parser/TestELParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/parser/TestELParser.java?rev=933140&r1=933139&r2=933140&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/parser/TestELParser.java (original)
+++ tomcat/trunk/test/org/apache/el/parser/TestELParser.java Mon Apr 12 08:26:34 2010
@@ -28,15 +28,17 @@ import junit.framework.TestCase;
 public class TestELParser extends TestCase {
 
     public void testBug49081() {
+        testExpression("#${1+1}", "#2");
+    }
+
+    private void testExpression(String expression, String expected) {
         ExpressionFactory factory = ExpressionFactory.newInstance();
         ELContext context = new ELContextImpl();
         
         ValueExpression ve = factory.createValueExpression(
-                context, "#${1+1}", String.class);
+                context, expression, String.class);
 
-        // First check the basics work
         String result = (String) ve.getValue(context);
-        assertEquals("#2", result);
+        assertEquals(expected, result);
     }
-
 }



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


Mime
View raw message