tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1304930 - in /tomcat/trunk/test/org/apache/el: TestMethodExpressionImpl.java TesterBeanEnum.java
Date Sat, 24 Mar 2012 21:29:12 GMT
Author: markt
Date: Sat Mar 24 21:29:11 2012
New Revision: 1304930

URL: http://svn.apache.org/viewvc?rev=1304930&view=rev
Log:
Add test case for bug 52970. Need to apply coercion rules to method invocation

Added:
    tomcat/trunk/test/org/apache/el/TesterBeanEnum.java   (with props)
Modified:
    tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java

Modified: tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java?rev=1304930&r1=1304929&r2=1304930&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java (original)
+++ tomcat/trunk/test/org/apache/el/TestMethodExpressionImpl.java Sat Mar 24 21:29:11 2012
@@ -75,6 +75,10 @@ public class TestMethodExpressionImpl {
         TesterBeanC beanC = new TesterBeanC();
         context.getVariableMapper().setVariable("beanC",
                 factory.createValueExpression(beanC, TesterBeanC.class));
+
+        TesterBeanEnum beanEnum = new TesterBeanEnum();
+        context.getVariableMapper().setVariable("beanEnum",
+                factory.createValueExpression(beanEnum, TesterBeanEnum.class));
     }
 
     @Test
@@ -413,4 +417,17 @@ public class TestMethodExpressionImpl {
         assertEquals("Hello from BB", actual);
     }
 
+    @Test
+    public void testBug52970() {
+        MethodExpression me = factory.createMethodExpression(context,
+                "${beanEnum.submit('APPLE')}", null ,
+                new Class<?>[] { TesterBeanEnum.class });
+        me.invoke(context, null);
+
+        ValueExpression ve = factory.createValueExpression(context,
+                "#{beanEnum.lastSubmitted}", TesterEnum.class);
+        TesterEnum actual = (TesterEnum) ve.getValue(context);
+        assertEquals(TesterEnum.APPLE, actual);
+
+    }
 }

Added: tomcat/trunk/test/org/apache/el/TesterBeanEnum.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TesterBeanEnum.java?rev=1304930&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/el/TesterBeanEnum.java (added)
+++ tomcat/trunk/test/org/apache/el/TesterBeanEnum.java Sat Mar 24 21:29:11 2012
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.el;
+
+public class TesterBeanEnum {
+
+    private volatile TesterEnum lastSubmitted = null;
+
+    public void submit(TesterEnum testerEnum) {
+        this.lastSubmitted = testerEnum;
+    }
+
+    public TesterEnum getLastSubmitted() {
+        return lastSubmitted;
+    }
+}

Propchange: tomcat/trunk/test/org/apache/el/TesterBeanEnum.java
------------------------------------------------------------------------------
    svn:eol-style = native



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


Mime
View raw message