Add test case for https://issues.apache.org/bugzilla/show_bug.cgi?id=42390
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 31 Jan 2010 22:49:34 +0000 (22:49 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 31 Jan 2010 22:49:34 +0000 (22:49 +0000)
JSP & tag file provided by MicroNova YUZU Team

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@905133 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/jasper/compiler/TestScriptingVariabler.java [new file with mode: 0644]
test/webapp/WEB-INF/tags/bug42390.tag [new file with mode: 0644]
test/webapp/bug42390.jsp [new file with mode: 0644]

diff --git a/test/org/apache/jasper/compiler/TestScriptingVariabler.java b/test/org/apache/jasper/compiler/TestScriptingVariabler.java
new file mode 100644 (file)
index 0000000..9256195
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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 java.io.IOException;
+
+import org.apache.catalina.startup.Tomcat;
+import org.apache.catalina.startup.TomcatBaseTest;
+
+public class TestScriptingVariabler extends TomcatBaseTest {
+    
+    public void testBug42390() 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();
+
+        Exception e = null;
+        try {
+            getUrl("http://localhost:" + getPort() + "/test/bug42390.jsp");
+        } catch (IOException ioe) {
+            e = ioe;
+        }
+
+        // Should not fail
+        assertNull(e);
+    }
+}
diff --git a/test/webapp/WEB-INF/tags/bug42390.tag b/test/webapp/WEB-INF/tags/bug42390.tag
new file mode 100644 (file)
index 0000000..2e6840a
--- /dev/null
@@ -0,0 +1,18 @@
+<%--\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+  contributor license agreements.  See the NOTICE file distributed with\r
+  this work for additional information regarding copyright ownership.\r
+  The ASF licenses this file to You under the Apache License, Version 2.0\r
+  (the "License"); you may not use this file except in compliance with\r
+  the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+--%>\r
+<%@ variable name-given="X" scope="AT_BEGIN" %>\r
+<jsp:doBody/>
\ No newline at end of file
diff --git a/test/webapp/bug42390.jsp b/test/webapp/bug42390.jsp
new file mode 100644 (file)
index 0000000..7e4c000
--- /dev/null
@@ -0,0 +1,18 @@
+<%--
+ 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.
+--%>
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<tags:bug42390><tags:bug42390/></tags:bug42390>
\ No newline at end of file