Author: markt
Date: Mon Jul 8 21:44:32 2013
New Revision: 1500979
URL: http://svn.apache.org/r1500979
Log:
Add a Servlet 2.2 test web application.
Extracted from a larger patch by Jeremy Boynes
Added:
tomcat/trunk/test/webapp-2.2/
- copied from r1500948, tomcat/trunk/test/webapp-2.3/
Modified:
tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java
tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java
tomcat/trunk/test/webapp-2.2/WEB-INF/web.xml
Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java?rev=1500979&r1=1500978&r2=1500979&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java Mon Jul 8
21:44:32 2013
@@ -30,6 +30,26 @@ import org.apache.tomcat.util.buf.ByteCh
public class TestJspConfig extends TomcatBaseTest {
@Test
+ public void testServlet22NoEL() throws Exception {
+ Tomcat tomcat = getTomcatInstance();
+
+ File appDir =
+ new File("test/webapp-2.2");
+ // app dir is relative to server home
+ tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+
+ tomcat.start();
+
+ ByteChunk res = getUrl("http://localhost:" + getPort() +
+ "/test/el-as-literal.jsp");
+
+ String result = res.toString();
+
+ assertTrue(result.indexOf("<p>00-${'hello world'}</p>") > 0);
+ assertTrue(result.indexOf("<p>01-#{'hello world'}</p>") > 0);
+ }
+
+ @Test
public void testServlet23NoEL() throws Exception {
Tomcat tomcat = getTomcatInstance();
Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java?rev=1500979&r1=1500978&r2=1500979&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java Mon Jul 8
21:44:32 2013
@@ -53,6 +53,31 @@ public class TestValidator extends Tomca
}
@Test
+ public void testTldVersions22() throws Exception {
+ Tomcat tomcat = getTomcatInstance();
+
+ File appDir =
+ new File("test/webapp-2.2");
+ // app dir is relative to server home
+ tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+
+ tomcat.start();
+
+ ByteChunk res = getUrl("http://localhost:" + getPort() +
+ "/test/tld-versions.jsp");
+
+ String result = res.toString();
+
+ assertTrue(result.indexOf("<p>${'00-hello world'}</p>") > 0);
+ assertTrue(result.indexOf("<p>#{'01-hello world'}</p>") > 0);
+ assertTrue(result.indexOf("<p>${'02-hello world'}</p>") > 0);
+ assertTrue(result.indexOf("<p>#{'03-hello world'}</p>") > 0);
+ assertTrue(result.indexOf("<p>${'04-hello world'}</p>") > 0);
+ assertTrue(result.indexOf("<p>#{'05-hello world'}</p>") > 0);
+ assertTrue(result.indexOf("<p>${'06-hello world'}</p>") > 0);
+ }
+
+ @Test
public void testTldVersions23() throws Exception {
Tomcat tomcat = getTomcatInstance();
Modified: tomcat/trunk/test/webapp-2.2/WEB-INF/web.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-2.2/WEB-INF/web.xml?rev=1500979&r1=1500948&r2=1500979&view=diff
==============================================================================
--- tomcat/trunk/test/webapp-2.2/WEB-INF/web.xml (original)
+++ tomcat/trunk/test/webapp-2.2/WEB-INF/web.xml Mon Jul 8 21:44:32 2013
@@ -16,15 +16,15 @@
limitations under the License.
-->
<!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
+ "http://java.sun.com/dtd/web-app_2_2.dtd">
<web-app>
- <display-name>Tomcat Servlet 2.3 Tests</display-name>
+ <display-name>Tomcat Servlet 2.2 Tests</display-name>
<description>
Provides a web application used by the Tomcat unit tests to ensure that
Tomcat meets the requirements of the current JSP and Servlet specification
- for web applications that declare that they follow version 2.3 of the
- Servlet specification and version 1.2 of the JSP specification. This
+ for web applications that declare that they follow version 2.2 of the
+ Servlet specification and version 1.1 of the JSP specification. This
typically means ensuring that features introduced in later versions of the
specification do not change the behaviour of applications that declared an
earlier version of the specification.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]