From 51bcda9534fef50953283a8ace2be2e43c5914ac Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 31 Jan 2010 22:49:34 +0000 Subject: [PATCH] Add test case for https://issues.apache.org/bugzilla/show_bug.cgi?id=42390 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 --- .../jasper/compiler/TestScriptingVariabler.java | 48 ++++++++++++++++++++++ test/webapp/WEB-INF/tags/bug42390.tag | 18 ++++++++ test/webapp/bug42390.jsp | 18 ++++++++ 3 files changed, 84 insertions(+) create mode 100644 test/org/apache/jasper/compiler/TestScriptingVariabler.java create mode 100644 test/webapp/WEB-INF/tags/bug42390.tag create mode 100644 test/webapp/bug42390.jsp diff --git a/test/org/apache/jasper/compiler/TestScriptingVariabler.java b/test/org/apache/jasper/compiler/TestScriptingVariabler.java new file mode 100644 index 000000000..925619563 --- /dev/null +++ b/test/org/apache/jasper/compiler/TestScriptingVariabler.java @@ -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 index 000000000..2e6840a60 --- /dev/null +++ b/test/webapp/WEB-INF/tags/bug42390.tag @@ -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. +--%> +<%@ variable name-given="X" scope="AT_BEGIN" %> + \ No newline at end of file diff --git a/test/webapp/bug42390.jsp b/test/webapp/bug42390.jsp new file mode 100644 index 000000000..7e4c00072 --- /dev/null +++ b/test/webapp/bug42390.jsp @@ -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" %> + \ No newline at end of file -- 2.11.0