From: markt Date: Sun, 31 Jan 2010 23:57:56 +0000 (+0000) Subject: Add minimal version of test case provided by 'agharta' in for https://issues.apache... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=676b752d5a145f68ef826414727251c0ee05c004;p=tomcat7.0 Add minimal version of test case provided by 'agharta' in for https://issues.apache.org/bugzilla/show_bug.cgi?id=48616 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@905142 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/org/apache/jasper/compiler/TestScriptingVariabler.java b/test/org/apache/jasper/compiler/TestScriptingVariabler.java index 925619563..fcce86834 100644 --- a/test/org/apache/jasper/compiler/TestScriptingVariabler.java +++ b/test/org/apache/jasper/compiler/TestScriptingVariabler.java @@ -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 index 000000000..bcbeb4db1 --- /dev/null +++ b/test/webapp/WEB-INF/bugs.tld @@ -0,0 +1,38 @@ + + + 1.0 + BugTags + http://tomcat.apache.org/bugs + + + Bug46816a + org.apache.jasper.compiler.TestScriptingVariabler$Bug48616aTag + JSP + + + + Bug48616b + org.apache.jasper.compiler.TestScriptingVariabler$Bug48616bTag + org.apache.jasper.compiler.TestScriptingVariabler$Bug48616bTei + JSP + + \ No newline at end of file diff --git a/test/webapp/bug48616.jsp b/test/webapp/bug48616.jsp new file mode 100644 index 000000000..efc77cb58 --- /dev/null +++ b/test/webapp/bug48616.jsp @@ -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" %> + + + + \ No newline at end of file