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 2014/02/20 13:55:06 UTC
svn commit: r1570176 - in /tomcat/trunk/test: org/apache/el/TestELInJsp.java
org/apache/el/TesterBeanD.java webapp/bug5nnnn/bug56147.jsp
Author: markt
Date: Thu Feb 20 12:55:05 2014
New Revision: 1570176
URL: http://svn.apache.org/r1570176
Log:
Add a test case that demonstrates Bug 56147 is not reproducible.
Added:
tomcat/trunk/test/org/apache/el/TesterBeanD.java (with props)
tomcat/trunk/test/webapp/bug5nnnn/bug56147.jsp (with props)
Modified:
tomcat/trunk/test/org/apache/el/TestELInJsp.java
Modified: tomcat/trunk/test/org/apache/el/TestELInJsp.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestELInJsp.java?rev=1570176&r1=1570175&r2=1570176&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/TestELInJsp.java (original)
+++ tomcat/trunk/test/org/apache/el/TestELInJsp.java Thu Feb 20 12:55:05 2014
@@ -476,6 +476,32 @@ public class TestELInJsp extends TomcatB
}
+ @Test
+ public void testBug56147() throws Exception {
+ Tomcat tomcat = getTomcatInstance();
+
+ File appDir = new File("test/webapp");
+ // app dir is relative to server home
+ Context ctx = tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+
+ ctx.setResources(new StandardRoot(ctx));
+
+ // Add the JSTL (we need the TLD)
+ File lib = new File("webapps/examples/WEB-INF/lib");
+ ctx.getResources().createWebResourceSet(
+ WebResourceRoot.ResourceSetType.POST, "/WEB-INF/lib",
+ lib.getAbsolutePath(), null, "/");
+
+ tomcat.start();
+
+ ByteChunk res = getUrl("http://localhost:" + getPort() +
+ "/test/bug5nnnn/bug56147.jsp");
+
+ String result = res.toString();
+ assertEcho(result, "00-OK");
+ }
+
+
// Assertion for text contained with <p></p>, e.g. printed by tags:echo
private static void assertEcho(String result, String expected) {
assertTrue(result.indexOf("<p>" + expected + "</p>") > 0);
Added: tomcat/trunk/test/org/apache/el/TesterBeanD.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TesterBeanD.java?rev=1570176&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/el/TesterBeanD.java (added)
+++ tomcat/trunk/test/org/apache/el/TesterBeanD.java Thu Feb 20 12:55:05 2014
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class used to test the calling of overloaded methods.
+ */
+public class TesterBeanD {
+
+ private List<Object> things = new ArrayList<>();
+
+ public void addThing(String thing) {
+ things.add(thing);
+ }
+
+ public void addThing(Class<?> clazz) {
+ things.add(clazz);
+ }
+
+ public List<Object> getThings() {
+ return things;
+ }
+}
Propchange: tomcat/trunk/test/org/apache/el/TesterBeanD.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tomcat/trunk/test/webapp/bug5nnnn/bug56147.jsp
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug5nnnn/bug56147.jsp?rev=1570176&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/bug5nnnn/bug56147.jsp (added)
+++ tomcat/trunk/test/webapp/bug5nnnn/bug56147.jsp Thu Feb 20 12:55:05 2014
@@ -0,0 +1,32 @@
+<%--
+ 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 language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"
+ import="java.util.List,java.util.ArrayList,org.apache.el.TesterBeanD"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<html>
+ <%
+ List<Object> list = new ArrayList<>();
+ list.add(new TesterBeanD());
+ pageContext.setAttribute("listItems", list);
+ %>
+ <body>
+ <c:forEach var="item" items="${listItems}">
+ <p>${item.addThing("h")}</p>
+ </c:forEach>
+ </body>
+</html>
\ No newline at end of file
Propchange: tomcat/trunk/test/webapp/bug5nnnn/bug56147.jsp
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org