You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/01/31 01:34:37 UTC

svn commit: r904935 - in /tomcat/trunk/test: org/apache/el/TestELInJsp.java webapp/WEB-INF/tags/echo-deferred.tag webapp/WEB-INF/tags/implicit.tld webapp/bug45451.jspf webapp/bug45451c.jsp webapp/bug45451d.jspx webapp/bug45451e.jsp

Author: markt
Date: Sun Jan 31 00:34:37 2010
New Revision: 904935

URL: http://svn.apache.org/viewvc?rev=904935&view=rev
Log:
Add tests for AttributeParser and deferredSyntaxAllowedAsLiteral

Added:
    tomcat/trunk/test/webapp/WEB-INF/tags/echo-deferred.tag   (with props)
    tomcat/trunk/test/webapp/WEB-INF/tags/implicit.tld   (with props)
    tomcat/trunk/test/webapp/bug45451e.jsp   (with props)
Modified:
    tomcat/trunk/test/org/apache/el/TestELInJsp.java
    tomcat/trunk/test/webapp/bug45451.jspf
    tomcat/trunk/test/webapp/bug45451c.jsp
    tomcat/trunk/test/webapp/bug45451d.jspx

Modified: tomcat/trunk/test/org/apache/el/TestELInJsp.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestELInJsp.java?rev=904935&r1=904934&r2=904935&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/TestELInJsp.java (original)
+++ tomcat/trunk/test/org/apache/el/TestELInJsp.java Sun Jan 31 00:34:37 2010
@@ -165,6 +165,11 @@
         assertTrue(result.indexOf("06-\\2") > 0);      
         assertTrue(result.indexOf("07-\\${1+1}") > 0);
         assertTrue(result.indexOf("08-\\\\2") > 0); 
+        assertTrue(result.indexOf("09-2") > 0);
+        assertTrue(result.indexOf("10-#{1+1}") > 0);
+        assertTrue(result.indexOf("11-\\2") > 0);      
+        assertTrue(result.indexOf("12-\\#{1+1}") > 0);
+        assertTrue(result.indexOf("13-\\\\2") > 0); 
         
         res = getUrl("http://localhost:" + getPort() + "/test/bug45451c.jsp");
         result = res.toString();
@@ -180,6 +185,11 @@
         assertTrue(result.indexOf("06-\\${1+1}") > 0);
         assertTrue(result.indexOf("07-\\\\${1+1}") > 0);
         assertTrue(result.indexOf("08-\\\\${1+1}") > 0);
+        assertTrue(result.indexOf("09-#{1+1}") > 0);
+        assertTrue(result.indexOf("10-\\#{1+1}") > 0);
+        assertTrue(result.indexOf("11-\\#{1+1}") > 0);
+        assertTrue(result.indexOf("12-\\\\#{1+1}") > 0);
+        assertTrue(result.indexOf("13-\\\\#{1+1}") > 0);
 
         res = getUrl("http://localhost:" + getPort() + "/test/bug45451d.jspx");
         result = res.toString();
@@ -194,6 +204,32 @@
         assertTrue(result.indexOf("06-\\${1+1}") > 0);
         assertTrue(result.indexOf("07-\\\\${1+1}") > 0);
         assertTrue(result.indexOf("08-\\\\\\${1+1}") > 0);
+        assertTrue(result.indexOf("09-2") > 0);
+        assertTrue(result.indexOf("10-#{1+1}") > 0);
+        assertTrue(result.indexOf("11-\\#{1+1}") > 0);
+        assertTrue(result.indexOf("12-\\\\#{1+1}") > 0);
+        assertTrue(result.indexOf("13-\\\\\\#{1+1}") > 0);
+        
+        res = getUrl("http://localhost:" + getPort() + "/test/bug45451e.jsp");
+        result = res.toString();
+        System.out.println(result);
+        // Warning: JSP attribute escaping != Java String escaping
+        // Warning: Attributes are always unescaped before passing to the EL
+        //          processor
+        assertTrue(result.indexOf("00-2") > 0);
+        assertTrue(result.indexOf("01-${1+1}") > 0);
+        assertTrue(result.indexOf("02-\\${1+1}") > 0);
+        assertTrue(result.indexOf("03-\\\\${1+1}") > 0);
+        assertTrue(result.indexOf("04-2") > 0);
+        assertTrue(result.indexOf("05-${1+1}") > 0);
+        assertTrue(result.indexOf("06-\\2") > 0);      
+        assertTrue(result.indexOf("07-\\${1+1}") > 0);
+        assertTrue(result.indexOf("08-\\\\2") > 0); 
+        assertTrue(result.indexOf("09-#{1+1}") > 0);
+        assertTrue(result.indexOf("10-\\#{1+1}") > 0);
+        assertTrue(result.indexOf("11-\\#{1+1}") > 0);
+        assertTrue(result.indexOf("12-\\\\#{1+1}") > 0);
+        assertTrue(result.indexOf("13-\\\\#{1+1}") > 0);
     }
 
     public void testBug45511() throws Exception {

Added: tomcat/trunk/test/webapp/WEB-INF/tags/echo-deferred.tag
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/WEB-INF/tags/echo-deferred.tag?rev=904935&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/WEB-INF/tags/echo-deferred.tag (added)
+++ tomcat/trunk/test/webapp/WEB-INF/tags/echo-deferred.tag Sun Jan 31 00:34:37 2010
@@ -0,0 +1,17 @@
+<%--
+ 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.
+--%>
+<%@ tag %><%@ attribute name="echo" deferredValue="true" %><p>${echo}</p>
\ No newline at end of file

Propchange: tomcat/trunk/test/webapp/WEB-INF/tags/echo-deferred.tag
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision

Added: tomcat/trunk/test/webapp/WEB-INF/tags/implicit.tld
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/WEB-INF/tags/implicit.tld?rev=904935&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/WEB-INF/tags/implicit.tld (added)
+++ tomcat/trunk/test/webapp/WEB-INF/tags/implicit.tld Sun Jan 31 00:34:37 2010
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  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.
+-->
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+      version="2.1">
+</taglib>
\ No newline at end of file

Propchange: tomcat/trunk/test/webapp/WEB-INF/tags/implicit.tld
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/trunk/test/webapp/WEB-INF/tags/implicit.tld
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision

Modified: tomcat/trunk/test/webapp/bug45451.jspf
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug45451.jspf?rev=904935&r1=904934&r2=904935&view=diff
==============================================================================
--- tomcat/trunk/test/webapp/bug45451.jspf (original)
+++ tomcat/trunk/test/webapp/bug45451.jspf Sun Jan 31 00:34:37 2010
@@ -23,3 +23,13 @@
 <tags:echo echo="06-\\${1+1}" />
 <tags:echo echo="07-\\\${1+1}" />
 <tags:echo echo="08-\\\\${1+1}" />
+<tags:echo echo="04-${1+1}" />
+<tags:echo echo="05-\${1+1}" />
+<tags:echo echo="06-\\${1+1}" />
+<tags:echo echo="07-\\\${1+1}" />
+<tags:echo echo="08-\\\\${1+1}" />
+<tags:echo-deferred echo="09-#{1+1}" />
+<tags:echo-deferred echo="10-\#{1+1}" />
+<tags:echo-deferred echo="11-\\#{1+1}" />
+<tags:echo-deferred echo="12-\\\#{1+1}" />
+<tags:echo-deferred echo="13-\\\\#{1+1}" />

Modified: tomcat/trunk/test/webapp/bug45451c.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug45451c.jsp?rev=904935&r1=904934&r2=904935&view=diff
==============================================================================
--- tomcat/trunk/test/webapp/bug45451c.jsp (original)
+++ tomcat/trunk/test/webapp/bug45451c.jsp Sun Jan 31 00:34:37 2010
@@ -14,6 +14,6 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --%>
-<%@page isELIgnored="true" %>
+<%@page isELIgnored="true" deferredSyntaxAllowedAsLiteral="true" %>
 <%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
 <%@ include file="bug45451.jspf" %>

Modified: tomcat/trunk/test/webapp/bug45451d.jspx
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug45451d.jspx?rev=904935&r1=904934&r2=904935&view=diff
==============================================================================
--- tomcat/trunk/test/webapp/bug45451d.jspx (original)
+++ tomcat/trunk/test/webapp/bug45451d.jspx Sun Jan 31 00:34:37 2010
@@ -30,6 +30,11 @@
     <tags:echo echo="06-\\${1+1}" />
     <tags:echo echo="07-\\\${1+1}" />
     <tags:echo echo="08-\\\\${1+1}" />
+    <tags:echo-deferred echo="09-#{1+1}" />
+    <tags:echo-deferred echo="10-\#{1+1}" />
+    <tags:echo-deferred echo="11-\\#{1+1}" />
+    <tags:echo-deferred echo="12-\\\#{1+1}" />
+    <tags:echo-deferred echo="13-\\\\#{1+1}" />
   </body>
 </html>
 </jsp:root>
\ No newline at end of file

Added: tomcat/trunk/test/webapp/bug45451e.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug45451e.jsp?rev=904935&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/bug45451e.jsp (added)
+++ tomcat/trunk/test/webapp/bug45451e.jsp Sun Jan 31 00:34:37 2010
@@ -0,0 +1,19 @@
+<%--
+ 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.
+--%>
+<%@page deferredSyntaxAllowedAsLiteral="true" %>
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<%@ include file="bug45451.jspf" %>

Propchange: tomcat/trunk/test/webapp/bug45451e.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/trunk/test/webapp/bug45451e.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision



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