Author: kkolinko
Date: Tue Feb 25 16:27:40 2014
New Revision: 1571725

URL: http://svn.apache.org/r1571725
Log:
Test for https://issues.apache.org/bugzilla/show_bug.cgi?id=56185

Added:
    tomcat/trunk/test/org/apache/el/parser/TesterBeanC.java   (with props)
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=1571725&r1=1571724&r2=1571725&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/parser/TestELParser.java (original)
+++ tomcat/trunk/test/org/apache/el/parser/TestELParser.java Tue Feb 25 
16:27:40 2014
@@ -199,6 +199,25 @@ public class TestELParser {
         assertEquals("true", result);
     }
 
+    @Test
+    public void bug56185() {
+        ExpressionFactory factory = ExpressionFactory.newInstance();
+        ELContext context = new ELContextImpl(factory);
+
+        TesterBeanC beanC = new TesterBeanC();
+        ValueExpression var =
+            factory.createValueExpression(beanC, TesterBeanC.class);
+        context.getVariableMapper().setVariable("myBean", var);
+
+        ValueExpression ve = factory.createValueExpression(context,
+            "${(myBean.int1 > 1 and myBean.myBool) or "+
+            "((myBean.myBool or myBean.myBool1) and myBean.int1 > 1)}",
+            Boolean.class);
+        assertEquals(Boolean.FALSE, ve.getValue(context));
+        beanC.setInt1(2);
+        beanC.setMyBool1(true);
+        assertEquals(Boolean.TRUE, ve.getValue(context));
+    }
 
     private void testExpression(String expression, String expected) {
         ExpressionFactory factory = ExpressionFactory.newInstance();

Added: tomcat/trunk/test/org/apache/el/parser/TesterBeanC.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/parser/TesterBeanC.java?rev=1571725&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/el/parser/TesterBeanC.java (added)
+++ tomcat/trunk/test/org/apache/el/parser/TesterBeanC.java Tue Feb 25 16:27:40 
2014
@@ -0,0 +1,49 @@
+/*
+ * 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.parser;
+
+public class TesterBeanC {
+
+    private int int1;
+    private boolean myBool;
+    private boolean myBool1;
+
+    public int getInt1() {
+        return int1;
+    }
+
+    public void setInt1(int int1) {
+        this.int1 = int1;
+    }
+
+    public boolean isMyBool() {
+        return myBool;
+    }
+
+    public void setMyBool(boolean myBool) {
+        this.myBool = myBool;
+    }
+
+    public boolean isMyBool1() {
+        return myBool1;
+    }
+
+    public void setMyBool1(boolean myBool1) {
+        this.myBool1 = myBool1;
+    }
+
+}

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



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

Reply via email to