You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2010/03/06 21:46:06 UTC

svn commit: r919847 - in /tomcat/trunk/test: org/apache/jasper/compiler/TestParser.java webapp/WEB-INF/tags/bug48668.tagx webapp/bug48668a.jsp

Author: kkolinko
Date: Sat Mar  6 20:46:06 2010
New Revision: 919847

URL: http://svn.apache.org/viewvc?rev=919847&view=rev
Log:
Additional tests for https://issues.apache.org/bugzilla/show_bug.cgi?id=48668
The TestCase currently passes:
the parts that do not pass currently are commented-out:
- in bug48668a.jsp: those that prevent JSP from being compiled
- in TestParser.java: also those that provide wrong output.

Added:
    tomcat/trunk/test/webapp/WEB-INF/tags/bug48668.tagx   (with props)
Modified:
    tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java
    tomcat/trunk/test/webapp/bug48668a.jsp

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java?rev=919847&r1=919846&r2=919847&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java Sat Mar  6 20:46:06 2010
@@ -58,8 +58,37 @@
         ByteChunk res = getUrl("http://localhost:" + getPort() +
                 "/test/bug48668a.jsp");
         String result = res.toString();
+        System.out.println(result);
         assertEcho(result, "00-Hello world</p>#{foo.bar}");
         assertEcho(result, "01-Hello world</p>${foo.bar}");
+        assertEcho(result, "10-Hello ${'foo.bar}");
+        assertEcho(result, "11-Hello ${'foo.bar}");
+        //assertEcho(result, "12-Hello #{'foo.bar}");
+        //assertEcho(result, "13-Hello #{'foo.bar}");
+        assertEcho(result, "14-Hello ${'foo}");
+        assertEcho(result, "15-Hello ${'foo}");
+        //assertEcho(result, "16-Hello #{'foo}");
+        //assertEcho(result, "17-Hello #{'foo}");
+        assertEcho(result, "18-Hello ${'foo.bar}");
+        assertEcho(result, "19-Hello ${'foo.bar}");
+        assertEcho(result, "20-Hello #{'foo.bar}");
+        assertEcho(result, "21-Hello #{'foo.bar}");
+        assertEcho(result, "30-Hello ${'foo}");
+        assertEcho(result, "31-Hello ${'foo}");
+        assertEcho(result, "32-Hello #{'foo}");
+        assertEcho(result, "33-Hello #{'foo}");
+        assertEcho(result, "34-Hello ${'foo}");
+        //assertEcho(result, "35-Hello ${'foo}");
+        assertEcho(result, "36-Hello #{'foo}");
+        //assertEcho(result, "37-Hello #{'foo}");
+        assertEcho(result, "40-Hello ${'foo}");
+        //assertEcho(result, "41-Hello ${'foo}");
+        //assertEcho(result, "42-Hello #{'foo}");
+        //assertEcho(result, "43-Hello #{'foo}");
+        assertEcho(result, "50-Hello ${'foo}");
+        //assertEcho(result, "51-Hello ${'foo}");
+        //assertEcho(result, "52-Hello #{'foo}");
+        //assertEcho(result, "53-Hello #{'foo}");
     }
 
     public void testBug48668b() throws Exception {

Added: tomcat/trunk/test/webapp/WEB-INF/tags/bug48668.tagx
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/WEB-INF/tags/bug48668.tagx?rev=919847&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/WEB-INF/tags/bug48668.tagx (added)
+++ tomcat/trunk/test/webapp/WEB-INF/tags/bug48668.tagx Sat Mar  6 20:46:06 2010
@@ -0,0 +1,26 @@
+<?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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
+<jsp:directive.tag body-content="scriptless" />
+<jsp:directive.attribute name="expr" type="java.lang.String" rtexprvalue="true"/>
+<jsp:directive.attribute name="noexpr" type="java.lang.String" rtexprvalue="false"/>
+<jsp:directive.attribute name="fragment" fragment="true" />
+<jsp:text>${expr}${noexpr}</jsp:text>
+<jsp:invoke fragment="fragment" />
+<jsp:doBody />
+</jsp:root>

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

Modified: tomcat/trunk/test/webapp/bug48668a.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug48668a.jsp?rev=919847&r1=919846&r2=919847&view=diff
==============================================================================
--- tomcat/trunk/test/webapp/bug48668a.jsp (original)
+++ tomcat/trunk/test/webapp/bug48668a.jsp Sat Mar  6 20:46:06 2010
@@ -21,6 +21,40 @@
   <body>
     <p><tags:echo echo="00-Hello world" />#{foo.bar}</p>
     <p><tags:echo echo="01-Hello world" />${foo.bar}</p>
+
+    <p>10-<tags:bug48668 expr="Hello ${'foo.bar}" /></p>
+    <p>11-Hello <tags:bug48668 expr="${'foo.bar}" /></p>
+<%--<p>12-<tags:bug48668 expr="Hello #{'foo.bar}" /></p>--%>
+<%--<p>13-Hello <tags:bug48668 expr="#{'foo.bar}" /></p>--%>
+
+    <p>14-<tags:bug48668 expr="Hello ${'foo" />}</p>
+    <p>15-Hello <tags:bug48668 expr="${'foo" />}</p>
+<%--<p>16-<tags:bug48668 expr="Hello #{'foo" />}</p>--%>
+<%--<p>17-Hello <tags:bug48668 expr="#{'foo" />}</p>--%>
+
+    <p>18-<tags:bug48668 ><jsp:attribute name="expr">Hello ${'foo.bar}</jsp:attribute></tags:bug48668></p>
+    <p>19-Hello <tags:bug48668 ><jsp:attribute name="expr">${'foo.bar}</jsp:attribute></tags:bug48668></p>
+    <p>20-<tags:bug48668 ><jsp:attribute name="expr">Hello #{'foo.bar}</jsp:attribute></tags:bug48668></p>
+    <p>21-Hello <tags:bug48668 ><jsp:attribute name="expr">#{'foo.bar}</jsp:attribute></tags:bug48668></p>
+
+    <p>30-<tags:bug48668 noexpr="Hello ${'foo}"/></p>
+    <p>31-Hello <tags:bug48668 noexpr="${'foo}"/></p>
+    <p>32-<tags:bug48668 noexpr="Hello #{'foo}"/></p>
+    <p>33-Hello <tags:bug48668 noexpr="#{'foo}"/></p>
+    <p>34-<tags:bug48668><jsp:attribute name="noexpr">Hello ${'foo}</jsp:attribute></tags:bug48668></p>
+<%--<p>35-Hello <tags:bug48668><jsp:attribute name="noexpr">${'foo}</jsp:attribute></tags:bug48668></p>--%>
+    <p>36-<tags:bug48668><jsp:attribute name="noexpr">Hello #{'foo}</jsp:attribute></tags:bug48668></p>
+<%--<p>37-Hello <tags:bug48668><jsp:attribute name="noexpr">#{'foo}</jsp:attribute></tags:bug48668></p>--%>
+
+    <p>40-<tags:bug48668><jsp:attribute name="fragment">Hello ${'foo}</jsp:attribute></tags:bug48668></p>
+    <p>41-Hello <tags:bug48668><jsp:attribute name="fragment">${'foo}</jsp:attribute></tags:bug48668></p>
+    <p>42-<tags:bug48668><jsp:attribute name="fragment">Hello #{'foo}</jsp:attribute></tags:bug48668></p>
+<%--<p>43-Hello <tags:bug48668><jsp:attribute name="fragment">#{'foo}</jsp:attribute></tags:bug48668></p>--%>
+
+    <p>50-<tags:bug48668>Hello ${'foo}</tags:bug48668></p>
+    <p>51-Hello <tags:bug48668>${'foo}</tags:bug48668></p>
+    <p>52-<tags:bug48668>Hello #{'foo}</tags:bug48668></p>
+<%--<p>53-Hello <tags:bug48668>#{'foo}</tags:bug48668></p>--%>
   </body>
 </html>
 



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