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/29 00:35:40 UTC
svn commit: r904305 - in /tomcat/trunk/test:
org/apache/jasper/compiler/TestParser.java
webapp/WEB-INF/tags/echo-noel.tag webapp/bug48627.jsp
Author: markt
Date: Thu Jan 28 23:35:39 2010
New Revision: 904305
URL: http://svn.apache.org/viewvc?rev=904305&view=rev
Log:
Add a test case for bug 48627
Added:
tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java (with props)
tomcat/trunk/test/webapp/WEB-INF/tags/echo-noel.tag
tomcat/trunk/test/webapp/bug48627.jsp (with props)
Added: 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=904305&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java (added)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java Thu Jan 28 23:35:39 2010
@@ -0,0 +1,50 @@
+/*
+ * 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.jasper.compiler;
+
+import java.io.File;
+
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.tomcat.util.buf.ByteChunk;
+
+public class TestParser extends TomcatBaseTest {
+
+ public void testBug48627() throws Exception {
+ Tomcat tomcat = getTomcatInstance();
+
+ File appDir =
+ new File("test/webapp");
+ // app dir is relative to server home
+ tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+
+ tomcat.start();
+
+ ByteChunk res = getUrl("http://localhost:" + getPort() +
+ "/test/bug48627.jsp");
+
+ String result = res.toString();
+
+ System.out.println(result);
+
+ // Beware of the differences between escaping in JSP attributes and
+ // in Java Strings
+ assertTrue(result.indexOf("00-\\") > 0);
+ assertTrue(result.indexOf("01-\\") > 0);
+ }
+}
Propchange: tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tomcat/trunk/test/webapp/WEB-INF/tags/echo-noel.tag
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/WEB-INF/tags/echo-noel.tag?rev=904305&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/WEB-INF/tags/echo-noel.tag (added)
+++ tomcat/trunk/test/webapp/WEB-INF/tags/echo-noel.tag Thu Jan 28 23:35:39 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.
+--%>
+<%@ tag%><%@
+attribute name="echo" type="java.lang.String" rtexprvalue="false"
+%><p>${echo}</p>
\ No newline at end of file
Added: tomcat/trunk/test/webapp/bug48627.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug48627.jsp?rev=904305&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/bug48627.jsp (added)
+++ tomcat/trunk/test/webapp/bug48627.jsp Thu Jan 28 23:35:39 2010
@@ -0,0 +1,24 @@
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<%--
+ 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.
+--%>
+<html>
+ <head><title>Bug 46596 test case</title></head>
+ <body>
+ <tags:echo-noel echo="00-\\"/>
+ <tags:echo echo="01-\\"/>
+ </body>
+</html>
\ No newline at end of file
Propchange: tomcat/trunk/test/webapp/bug48627.jsp
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org