From 6f506a0da0c07ed1d22dc5a653b5a4cbdd8df80b Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 7 Jan 2010 16:06:45 +0000 Subject: [PATCH] Add various EL test cases, mostly extracted from local test JSPs I have used for individual issues. Thanks to kkolinko and the numerous bug reporters that provided the basis for many of these. At present, although this is Tomcat 7, the tests only cover JSP 2.1 functionality. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@896913 13f79535-47bb-0310-9956-ffa450edef68 --- test/org/apache/el/TestELEvaluation.java | 6 +- test/org/apache/el/TestELInJsp.java | 276 +++++++++++++++++++++ test/org/apache/el/TesterFunctions.java | 24 ++ test/org/apache/jasper/compiler/TestGenerator.java | 60 +++++ test/org/apache/jasper/compiler/TestValidator.java | 31 +++ test/webapp/WEB-INF/tags/echo-double.tag | 3 + test/webapp/WEB-INF/tags/echo-long.tag | 3 + test/webapp/WEB-INF/tags/echo.tag | 1 + test/webapp/WEB-INF/test.tld | 34 +++ test/webapp/WEB-INF/web.xml | 30 +++ test/webapp/bug42565.jsp | 38 +++ test/webapp/bug44994.jsp | 25 ++ test/webapp/bug45015a.jsp | 32 +++ test/webapp/bug45015b.jsp | 23 ++ test/webapp/bug45427.jsp | 41 +++ test/webapp/bug45451.jspf | 9 + test/webapp/bug45451a.jsp | 26 ++ test/webapp/bug45451b.jsp | 2 + test/webapp/bug45451c.jsp | 2 + test/webapp/bug45451d.jspx | 19 ++ test/webapp/bug45511.jsp | 24 ++ test/webapp/bug46381.jsp | 28 +++ test/webapp/bug46596.jsp | 25 ++ test/webapp/bug47331.jsp | 23 ++ test/webapp/bug47413.jsp | 51 ++++ test/webapp/bug48112.jsp | 24 ++ test/webapp/el-misc.jsp | 32 +++ 27 files changed, 887 insertions(+), 5 deletions(-) create mode 100644 test/org/apache/el/TestELInJsp.java create mode 100644 test/org/apache/el/TesterFunctions.java create mode 100644 test/org/apache/jasper/compiler/TestGenerator.java create mode 100644 test/org/apache/jasper/compiler/TestValidator.java create mode 100644 test/webapp/WEB-INF/tags/echo-double.tag create mode 100644 test/webapp/WEB-INF/tags/echo-long.tag create mode 100644 test/webapp/WEB-INF/tags/echo.tag create mode 100644 test/webapp/WEB-INF/test.tld create mode 100644 test/webapp/WEB-INF/web.xml create mode 100644 test/webapp/bug42565.jsp create mode 100644 test/webapp/bug44994.jsp create mode 100644 test/webapp/bug45015a.jsp create mode 100644 test/webapp/bug45015b.jsp create mode 100644 test/webapp/bug45427.jsp create mode 100644 test/webapp/bug45451.jspf create mode 100644 test/webapp/bug45451a.jsp create mode 100644 test/webapp/bug45451b.jsp create mode 100644 test/webapp/bug45451c.jsp create mode 100644 test/webapp/bug45451d.jspx create mode 100644 test/webapp/bug45511.jsp create mode 100644 test/webapp/bug46381.jsp create mode 100644 test/webapp/bug46596.jsp create mode 100644 test/webapp/bug47331.jsp create mode 100644 test/webapp/bug47413.jsp create mode 100644 test/webapp/bug48112.jsp create mode 100644 test/webapp/el-misc.jsp diff --git a/test/org/apache/el/TestELEvaluation.java b/test/org/apache/el/TestELEvaluation.java index 0c21ff43d..424603643 100644 --- a/test/org/apache/el/TestELEvaluation.java +++ b/test/org/apache/el/TestELEvaluation.java @@ -137,7 +137,7 @@ public class TestELEvaluation extends TestCase { if ("trim".equals(localName)) { Method m; try { - m = this.getClass().getMethod("trim", String.class); + m = TesterFunctions.class.getMethod("trim", String.class); return m; } catch (SecurityException e) { // Ignore @@ -147,9 +147,5 @@ public class TestELEvaluation extends TestCase { } return null; } - - public static String trim(String input) { - return input.trim(); - } } } diff --git a/test/org/apache/el/TestELInJsp.java b/test/org/apache/el/TestELInJsp.java new file mode 100644 index 000000000..c1a721f6b --- /dev/null +++ b/test/org/apache/el/TestELInJsp.java @@ -0,0 +1,276 @@ +/* + * 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.el; + +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 TestELInJsp extends TomcatBaseTest { + + public void testBug42565() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug42565.jsp"); + + String result = res.toString(); + assertTrue(result.indexOf("00-false") > 0); + assertTrue(result.indexOf("01-false") > 0); + assertTrue(result.indexOf("02-false") > 0); + assertTrue(result.indexOf("03-false") > 0); + assertTrue(result.indexOf("04-false") > 0); + assertTrue(result.indexOf("05-false") > 0); + assertTrue(result.indexOf("06-false") > 0); + assertTrue(result.indexOf("07-false") > 0); + assertTrue(result.indexOf("08-false") > 0); + assertTrue(result.indexOf("09-false") > 0); + assertTrue(result.indexOf("10-false") > 0); + assertTrue(result.indexOf("11-false") > 0); + assertTrue(result.indexOf("12-false") > 0); + assertTrue(result.indexOf("13-false") > 0); + assertTrue(result.indexOf("14-false") > 0); + assertTrue(result.indexOf("15-false") > 0); + } + + public void testBug44994() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug44994.jsp"); + + String result = res.toString(); + assertTrue(result.indexOf("00-none") > 0); + assertTrue(result.indexOf("01-one") > 0); + assertTrue(result.indexOf("02-many") > 0); + } + + public void testBug45427() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug45427.jsp"); + + String result = res.toString(); + // Warning: JSP attribute escaping != Java String escaping + assertTrue(result.indexOf("00-hello world") > 0); + assertTrue(result.indexOf("01-hello 'world") > 0); + assertTrue(result.indexOf("02-hello \"world") > 0); + assertTrue(result.indexOf("03-hello world") > 0); + assertTrue(result.indexOf("04-hello 'world") > 0); + assertTrue(result.indexOf("05-hello \"world") > 0); + assertTrue(result.indexOf("06-hello world") > 0); + assertTrue(result.indexOf("07-hello 'world") > 0); + assertTrue(result.indexOf("08-hello \"world") > 0); + assertTrue(result.indexOf("09-hello world") > 0); + assertTrue(result.indexOf("10-hello 'world") > 0); + assertTrue(result.indexOf("11-hello \"world") > 0); + assertTrue(result.indexOf("12-hello world") > 0); + assertTrue(result.indexOf("13-hello 'world") > 0); + assertTrue(result.indexOf("14-hello \"world") > 0); + assertTrue(result.indexOf("15-hello world") > 0); + assertTrue(result.indexOf("16-hello 'world") > 0); + assertTrue(result.indexOf("17-hello \"world") > 0); + } + + public void testBug45451() 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(); + + ByteChunk res = /* getUrl("http://localhost:" + getPort() + + "/test/bug45451a.jsp"); + + String result = res.toString(); + // Warning: JSP attribute escaping != Java String escaping + assertTrue(result.indexOf("00-\\'hello world\\'") > 0); + assertTrue(result.indexOf("01-\\'hello world\\'") > 0); + assertTrue(result.indexOf("02-\\'hello world\\'") > 0); + assertTrue(result.indexOf("03-\\'hello world\\'") > 0); + + res = */ getUrl("http://localhost:" + getPort() + "/test/bug45451b.jsp"); + String result = res.toString(); + // Warning: JSP attribute escaping != Java String escaping + assertTrue(result.indexOf("00-2") > 0); + assertTrue(result.indexOf("01-${1+1}") > 0); + assertTrue(result.indexOf("02-\\${1+1}") > 0); + assertTrue(result.indexOf("03-\\\\${1+1}") > 0); + assertTrue(result.indexOf("04-2") > 0); + assertTrue(result.indexOf("05-${1+1}") > 0); + assertTrue(result.indexOf("06-\\2") > 0); + assertTrue(result.indexOf("07-\\${1+1}") > 0); + assertTrue(result.indexOf("08-\\\\2") > 0); + + res = getUrl("http://localhost:" + getPort() + "/test/bug45451c.jsp"); + result = res.toString(); + // Warning: JSP attribute escaping != Java String escaping + assertTrue(result.indexOf("00-${1+1}") > 0); + assertTrue(result.indexOf("01-\\${1+1}") > 0); + assertTrue(result.indexOf("02-\\\\${1+1}") > 0); + assertTrue(result.indexOf("03-\\\\\\${1+1}") > 0); + assertTrue(result.indexOf("04-${1+1}") > 0); + assertTrue(result.indexOf("05-\\${1+1}") > 0); + assertTrue(result.indexOf("06-\\\\${1+1}") > 0); + assertTrue(result.indexOf("07-\\\\\\${1+1}") > 0); + assertTrue(result.indexOf("08-\\\\\\\\${1+1}") > 0); + + res = getUrl("http://localhost:" + getPort() + "/test/bug45451d.jspx"); + result = res.toString(); + // Warning: JSP attribute escaping != Java String escaping + assertTrue(result.indexOf("00-2") > 0); + assertTrue(result.indexOf("01-${1+1}") > 0); + assertTrue(result.indexOf("02-\\${1+1}") > 0); + assertTrue(result.indexOf("03-\\\\${1+1}") > 0); + assertTrue(result.indexOf("04-2") > 0); + assertTrue(result.indexOf("05-${1+1}") > 0); + assertTrue(result.indexOf("06-\\2") > 0); + assertTrue(result.indexOf("07-\\${1+1}") > 0); + assertTrue(result.indexOf("08-\\\\2") > 0); + } + + public void testBug45511() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug45511.jsp"); + + String result = res.toString(); + assertTrue(result.indexOf("00-true") > 0); + assertTrue(result.indexOf("01-false") > 0); + } + + public void testBug46596() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug46596.jsp"); + assertTrue(res.toString().indexOf("{OK}") > 0); + } + + public void testBug47413() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug47413.jsp"); + + String result = res.toString(); + assertTrue(result.indexOf("00-hello world") > 0); + assertTrue(result.indexOf("01-hello world") > 0); + assertTrue(result.indexOf("02-3.22") > 0); + assertTrue(result.indexOf("03-3.22") > 0); + assertTrue(result.indexOf("04-17") > 0); + assertTrue(result.indexOf("05-17") > 0); + assertTrue(result.indexOf("06-hello world") > 0); + assertTrue(result.indexOf("07-hello world") > 0); + assertTrue(result.indexOf("08-0.0") > 0); + assertTrue(result.indexOf("09-0.0") > 0); + assertTrue(result.indexOf("10-0") > 0); + assertTrue(result.indexOf("11-0") > 0); + } + + public void testBug48112() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug48112.jsp"); + assertTrue(res.toString().indexOf("{OK}") > 0); + } + + public void testELMisc() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/el-misc.jsp"); + String result = res.toString(); + assertTrue(result.indexOf("00-\\\\\\\"${'hello world'}") > 0); + assertTrue(result.indexOf("01-\\\\\\\"\\${'hello world'}") > 0); + assertTrue(result.indexOf("02-\\\"\\${'hello world'}") > 0); + assertTrue(result.indexOf("03-\\\"\\${'hello world'}") > 0); + assertTrue(result.indexOf("2az-04") > 0); + assertTrue(result.indexOf("05-a2z") > 0); + assertTrue(result.indexOf("06-az2") > 0); + assertTrue(result.indexOf("2az-07") > 0); + assertTrue(result.indexOf("08-a2z") > 0); + assertTrue(result.indexOf("09-az2") > 0); + } + + +} diff --git a/test/org/apache/el/TesterFunctions.java b/test/org/apache/el/TesterFunctions.java new file mode 100644 index 000000000..bb799c1b9 --- /dev/null +++ b/test/org/apache/el/TesterFunctions.java @@ -0,0 +1,24 @@ +/* + * 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.el; + +public class TesterFunctions { + public static String trim(String input) { + return input.trim(); + } +} diff --git a/test/org/apache/jasper/compiler/TestGenerator.java b/test/org/apache/jasper/compiler/TestGenerator.java new file mode 100644 index 000000000..d02db5c2a --- /dev/null +++ b/test/org/apache/jasper/compiler/TestGenerator.java @@ -0,0 +1,60 @@ +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; +import org.apache.tomcat.util.buf.ByteChunk; + +public class TestGenerator extends TomcatBaseTest { + + public void testBug45015a() 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(); + + ByteChunk res = getUrl("http://localhost:" + getPort() + + "/test/bug45015a.jsp"); + + String result = res.toString(); + // Beware of the differences between escaping in JSP attributes and + // in Java Strings + assertTrue(result.indexOf("00-hello 'world'") > 0); + assertTrue(result.indexOf("01-hello 'world") > 0); + assertTrue(result.indexOf("02-hello world'") > 0); + assertTrue(result.indexOf("03-hello world'") > 0); + assertTrue(result.indexOf("04-hello world\"") > 0); + assertTrue(result.indexOf("05-hello \"world\"") > 0); + assertTrue(result.indexOf("06-hello \"world") > 0); + assertTrue(result.indexOf("07-hello world\"") > 0); + assertTrue(result.indexOf("08-hello world'") > 0); + assertTrue(result.indexOf("09-hello world\"") > 0); + } + + public void testBug45015b() 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/bug45015b.jsp"); + } catch (IOException ioe) { + e = ioe; + } + + // Failure is expected + assertNotNull(e); + } +} diff --git a/test/org/apache/jasper/compiler/TestValidator.java b/test/org/apache/jasper/compiler/TestValidator.java new file mode 100644 index 000000000..beb9a77b2 --- /dev/null +++ b/test/org/apache/jasper/compiler/TestValidator.java @@ -0,0 +1,31 @@ +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 TestValidator extends TomcatBaseTest { + + public void testBug47331() 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/bug47331.jsp"); + } catch (IOException ioe) { + e = ioe; + } + + // Failure is expected + assertNotNull(e); + } +} diff --git a/test/webapp/WEB-INF/tags/echo-double.tag b/test/webapp/WEB-INF/tags/echo-double.tag new file mode 100644 index 000000000..c7105d59f --- /dev/null +++ b/test/webapp/WEB-INF/tags/echo-double.tag @@ -0,0 +1,3 @@ +<%@ tag %><%@ +attribute name="echo" type="java.lang.Double"%><%@ +attribute name="index" type="java.lang.String" %>

${index}-${echo}

\ No newline at end of file diff --git a/test/webapp/WEB-INF/tags/echo-long.tag b/test/webapp/WEB-INF/tags/echo-long.tag new file mode 100644 index 000000000..652faf1b9 --- /dev/null +++ b/test/webapp/WEB-INF/tags/echo-long.tag @@ -0,0 +1,3 @@ +<%@ tag %><%@ +attribute name="echo" type="java.lang.Long"%><%@ +attribute name="index" type="java.lang.String" %>

${index}-${echo}

\ No newline at end of file diff --git a/test/webapp/WEB-INF/tags/echo.tag b/test/webapp/WEB-INF/tags/echo.tag new file mode 100644 index 000000000..9c9479f3b --- /dev/null +++ b/test/webapp/WEB-INF/tags/echo.tag @@ -0,0 +1 @@ +<%@ tag %><%@ attribute name="echo" type="java.lang.String"%>

${echo}

\ No newline at end of file diff --git a/test/webapp/WEB-INF/test.tld b/test/webapp/WEB-INF/test.tld new file mode 100644 index 000000000..64f9324c4 --- /dev/null +++ b/test/webapp/WEB-INF/test.tld @@ -0,0 +1,34 @@ + + + + 1.0 + TesterFunctions + http://tomcat.apache.org/testerFunctions + + + trim + org.apache.el.TesterFunctions + + java.lang.String trim(java.lang.String) + + + \ No newline at end of file diff --git a/test/webapp/WEB-INF/web.xml b/test/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..947d4ea32 --- /dev/null +++ b/test/webapp/WEB-INF/web.xml @@ -0,0 +1,30 @@ + + + + + Tomcat Test Application + + Used as part of the Tomcat unit tests when a full web application is + required. + + \ No newline at end of file diff --git a/test/webapp/bug42565.jsp b/test/webapp/bug42565.jsp new file mode 100644 index 000000000..8aeb5392e --- /dev/null +++ b/test/webapp/bug42565.jsp @@ -0,0 +1,38 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 42565 test case + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/webapp/bug44994.jsp b/test/webapp/bug44994.jsp new file mode 100644 index 000000000..43410d004 --- /dev/null +++ b/test/webapp/bug44994.jsp @@ -0,0 +1,25 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 44994 test case + + + + + + \ No newline at end of file diff --git a/test/webapp/bug45015a.jsp b/test/webapp/bug45015a.jsp new file mode 100644 index 000000000..3d85ba424 --- /dev/null +++ b/test/webapp/bug45015a.jsp @@ -0,0 +1,32 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 45015 test case A + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/webapp/bug45015b.jsp b/test/webapp/bug45015b.jsp new file mode 100644 index 000000000..a032a1109 --- /dev/null +++ b/test/webapp/bug45015b.jsp @@ -0,0 +1,23 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 45015 test case B + + + + \ No newline at end of file diff --git a/test/webapp/bug45427.jsp b/test/webapp/bug45427.jsp new file mode 100644 index 000000000..41cd19ba8 --- /dev/null +++ b/test/webapp/bug45427.jsp @@ -0,0 +1,41 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 45427 test case + +

00-${'hello world'}

+

01-${'hello \'world'}

+

02-${'hello "world'}

+

03-${"hello world"}

+

04-${"hello 'world"}

+

05-${"hello \"world"}

+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/webapp/bug45451.jspf b/test/webapp/bug45451.jspf new file mode 100644 index 000000000..4c96bd4ca --- /dev/null +++ b/test/webapp/bug45451.jspf @@ -0,0 +1,9 @@ +

00-${1+1}

+

01-\${1+1}

+

02-\\${1+1}

+

03-\\\${1+1}

+ + + + + diff --git a/test/webapp/bug45451a.jsp b/test/webapp/bug45451a.jsp new file mode 100644 index 000000000..f3a67f4d9 --- /dev/null +++ b/test/webapp/bug45451a.jsp @@ -0,0 +1,26 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 45451 test case + + + + + + + \ No newline at end of file diff --git a/test/webapp/bug45451b.jsp b/test/webapp/bug45451b.jsp new file mode 100644 index 000000000..80b2dbed2 --- /dev/null +++ b/test/webapp/bug45451b.jsp @@ -0,0 +1,2 @@ +<%@page isELIgnored="false" %> +<%@ include file="bug45451.jspf" %> diff --git a/test/webapp/bug45451c.jsp b/test/webapp/bug45451c.jsp new file mode 100644 index 000000000..649e7ef2a --- /dev/null +++ b/test/webapp/bug45451c.jsp @@ -0,0 +1,2 @@ +<%@page isELIgnored="true" %> +<%@ include file="bug45451.jspf" %> diff --git a/test/webapp/bug45451d.jspx b/test/webapp/bug45451d.jspx new file mode 100644 index 000000000..fa1b30a81 --- /dev/null +++ b/test/webapp/bug45451d.jspx @@ -0,0 +1,19 @@ + + + + +

00-${1+1}

+

01-\${1+1}

+

02-\\${1+1}

+

03-\\\${1+1}

+ + + + + + + +
\ No newline at end of file diff --git a/test/webapp/bug45511.jsp b/test/webapp/bug45511.jsp new file mode 100644 index 000000000..6279eba72 --- /dev/null +++ b/test/webapp/bug45511.jsp @@ -0,0 +1,24 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 45511 test case + + + + + \ No newline at end of file diff --git a/test/webapp/bug46381.jsp b/test/webapp/bug46381.jsp new file mode 100644 index 000000000..629a15c43 --- /dev/null +++ b/test/webapp/bug46381.jsp @@ -0,0 +1,28 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 46381 test case + <% + pageContext.setAttribute("foo","hello"); + pageContext.setAttribute("bar","world"); + %> + + + + + \ No newline at end of file diff --git a/test/webapp/bug46596.jsp b/test/webapp/bug46596.jsp new file mode 100644 index 000000000..6da57924e --- /dev/null +++ b/test/webapp/bug46596.jsp @@ -0,0 +1,25 @@ +<%@ taglib uri="http://tomcat.apache.org/testerFunctions" prefix="fn" %> +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 46596 test case + + + + \ No newline at end of file diff --git a/test/webapp/bug47331.jsp b/test/webapp/bug47331.jsp new file mode 100644 index 000000000..a174dc3c1 --- /dev/null +++ b/test/webapp/bug47331.jsp @@ -0,0 +1,23 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 47331 test case + +

This is a #{'test'}

+ + \ No newline at end of file diff --git a/test/webapp/bug47413.jsp b/test/webapp/bug47413.jsp new file mode 100644 index 000000000..adfea077b --- /dev/null +++ b/test/webapp/bug47413.jsp @@ -0,0 +1,51 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + + Bug 47413 test case + + +

00-${values.string}

+ + + +

02-${values.double}

+ + + +

04-${values.long}

+ + + +

06-${values.string}

+ + + +

08-${values.double}

+ + + +

10-${values.long}

+ + + + + diff --git a/test/webapp/bug48112.jsp b/test/webapp/bug48112.jsp new file mode 100644 index 000000000..356e680f4 --- /dev/null +++ b/test/webapp/bug48112.jsp @@ -0,0 +1,24 @@ +<%@ taglib uri="http://tomcat.apache.org/testerFunctions" prefix="fn" %> +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 48112 test case + + + + \ No newline at end of file diff --git a/test/webapp/el-misc.jsp b/test/webapp/el-misc.jsp new file mode 100644 index 000000000..d542e3770 --- /dev/null +++ b/test/webapp/el-misc.jsp @@ -0,0 +1,32 @@ +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<%-- + 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. +--%> + + Bug 45511 test case + +

00-\\\"\${'hello world'}

+

01-\\\"\\${'hello world'}

+ + + + + + + + + + \ No newline at end of file -- 2.11.0