Add minimal version of test case provided by 'agharta' in for https://issues.apache...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 31 Jan 2010 23:57:56 +0000 (23:57 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 31 Jan 2010 23:57:56 +0000 (23:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@905142 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/jasper/compiler/TestScriptingVariabler.java
test/webapp/WEB-INF/bugs.tld [new file with mode: 0644]
test/webapp/bug48616.jsp [new file with mode: 0644]

index 9256195..fcce868 100644 (file)
@@ -20,6 +20,11 @@ package org.apache.jasper.compiler;
 import java.io.File;
 import java.io.IOException;
 
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.TagSupport;
+import javax.servlet.jsp.tagext.VariableInfo;
+
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 
@@ -45,4 +50,47 @@ public class TestScriptingVariabler extends TomcatBaseTest {
         // Should not fail
         assertNull(e);
     }
+    
+    public static class Bug48616aTag extends TagSupport {
+        private static final long serialVersionUID = 1L;
+    }
+
+    public static class Bug48616bTag extends TagSupport {
+        private static final long serialVersionUID = 1L;
+    }
+
+    public static class Bug48616bTei extends TagExtraInfo {
+        /**
+         * Return information about the scripting variables to be created.
+         */
+        @Override
+        public VariableInfo[] getVariableInfo(TagData data) {
+            return new VariableInfo[] {
+                new VariableInfo("Test", "java.lang.String", true,
+                    VariableInfo.AT_END)
+            };
+        }
+    }
+    
+    public void testBug48616() 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/bug48616.jsp");
+        } catch (IOException ioe) {
+            e = ioe;
+        }
+
+        // Should not fail
+        assertNull(e);
+    }
+
 }
diff --git a/test/webapp/WEB-INF/bugs.tld b/test/webapp/WEB-INF/bugs.tld
new file mode 100644 (file)
index 0000000..bcbeb4d
--- /dev/null
@@ -0,0 +1,38 @@
+<?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.
+--><taglib xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+      version="2.1">
+  <tlib-version>1.0</tlib-version>
+  <short-name>BugTags</short-name>
+  <uri>http://tomcat.apache.org/bugs</uri>
+
+  <tag>
+    <name>Bug46816a</name>
+    <tag-class>org.apache.jasper.compiler.TestScriptingVariabler$Bug48616aTag</tag-class>
+    <body-content>JSP</body-content>
+  </tag>
+
+  <tag>
+    <name>Bug48616b</name>
+    <tag-class>org.apache.jasper.compiler.TestScriptingVariabler$Bug48616bTag</tag-class>
+    <tei-class>org.apache.jasper.compiler.TestScriptingVariabler$Bug48616bTei</tei-class>
+    <body-content>JSP</body-content>
+  </tag>
+</taglib>
\ No newline at end of file
diff --git a/test/webapp/bug48616.jsp b/test/webapp/bug48616.jsp
new file mode 100644 (file)
index 0000000..efc77cb
--- /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.
+--%>
+<%@ taglib prefix="bugs" uri="http://tomcat.apache.org/bugs" %>
+<bugs:Bug48616b />
+<bugs:Bug46816a>
+  <bugs:Bug48616b />
+</bugs:Bug46816a>
\ No newline at end of file