Add a test the EL doesn't work if the web-app is a 2.3 web-app
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 7 Mar 2010 11:09:09 +0000 (11:09 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 7 Mar 2010 11:09:09 +0000 (11:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@919966 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/jasper/compiler/TestJspConfig.java [new file with mode: 0644]
test/webapp-2.3/WEB-INF/web.xml [new file with mode: 0644]
test/webapp-2.3/no-el.jsp [new file with mode: 0644]

diff --git a/test/org/apache/jasper/compiler/TestJspConfig.java b/test/org/apache/jasper/compiler/TestJspConfig.java
new file mode 100644 (file)
index 0000000..9dce88e
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * 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 TestJspConfig extends TomcatBaseTest {
+
+    public void testServlet23NoEL() throws Exception {
+        Tomcat tomcat = getTomcatInstance();
+
+        File appDir = 
+            new File("test/webapp-2.3");
+        // app dir is relative to server home
+        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
+        
+        tomcat.start();
+
+        ByteChunk res = getUrl("http://localhost:" + getPort() +
+                "/test/no-el.jsp");
+
+        String result = res.toString();
+        
+        assertTrue(result.indexOf("<p>00-${'hello world'}</p>") > 0);
+    }
+
+}
diff --git a/test/webapp-2.3/WEB-INF/web.xml b/test/webapp-2.3/WEB-INF/web.xml
new file mode 100644 (file)
index 0000000..06e870c
--- /dev/null
@@ -0,0 +1,32 @@
+<?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.
+-->
+<!DOCTYPE web-app PUBLIC
+  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+  "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+  <display-name>Tomcat Servlet 2.3 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
+    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. 
+  </description>
+</web-app>
\ No newline at end of file
diff --git a/test/webapp-2.3/no-el.jsp b/test/webapp-2.3/no-el.jsp
new file mode 100644 (file)
index 0000000..f48e114
--- /dev/null
@@ -0,0 +1,21 @@
+<%--
+ 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>
+  <body>
+    <p>00-${'hello world'}</p>
+  </body>
+</html>
\ No newline at end of file