Author: markt
Date: Wed Mar  3 20:59:23 2010
New Revision: 918682

URL: http://svn.apache.org/viewvc?rev=918682&view=rev
Log:
Add tests for bugs 47977 and 48827

Added:
    tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java
    tomcat/trunk/test/webapp/bug47977.jspx
    tomcat/trunk/test/webapp/bug48827.jspx
Modified:
    tomcat/trunk/test/org/apache/TestAll.java

Modified: tomcat/trunk/test/org/apache/TestAll.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/TestAll.java?rev=918682&r1=918681&r2=918682&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/TestAll.java (original)
+++ tomcat/trunk/test/org/apache/TestAll.java Wed Mar  3 20:59:23 2010
@@ -39,6 +39,7 @@
 import org.apache.el.lang.TestELSupport;
 import org.apache.jasper.compiler.TestAttributeParser;
 import org.apache.jasper.compiler.TestGenerator;
+import org.apache.jasper.compiler.TestJspDocumentParser;
 import org.apache.jasper.compiler.TestParser;
 import org.apache.jasper.compiler.TestScriptingVariabler;
 import org.apache.jasper.compiler.TestValidator;
@@ -89,6 +90,7 @@
         
         // o.a.jasper
         suite.addTestSuite(TestAttributeParser.class);
+        suite.addTestSuite(TestJspDocumentParser.class);
         suite.addTestSuite(TestGenerator.class);
         suite.addTestSuite(TestParser.class);
         suite.addTestSuite(TestScriptingVariabler.class);

Added: tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java?rev=918682&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java 
(added)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java Wed 
Mar  3 20:59:23 2010
@@ -0,0 +1,69 @@
+/*
+ * 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 TestJspDocumentParser extends TomcatBaseTest {
+    
+    public void testBug47977() 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/bug47977.jspx");
+        } catch (IOException ioe) {
+            e = ioe;
+        }
+
+        // Failure is expected
+        assertNotNull(e);
+    }
+    
+    public void testBug48827() 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/bug48827.jspx");
+        } catch (IOException ioe) {
+            e = ioe;
+        }
+
+        // Should not fail
+        assertNull(e);
+    }
+}

Added: tomcat/trunk/test/webapp/bug47977.jspx
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug47977.jspx?rev=918682&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/bug47977.jspx (added)
+++ tomcat/trunk/test/webapp/bug47977.jspx Wed Mar  3 20:59:23 2010
@@ -0,0 +1,26 @@
+<!--
+  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.
+-->
+<jsp:root
+  xmlns:jsp="http://java.sun.com/JSP/Page"; version="2.2"
+  xmlns:tags="urn:jsptagdir:/WEB-INF/tags" >
+  <jsp:directive.page isELIgnored="false" />
+<html>
+  <body>
+    <tags:echo echo="00-Hello World">xxx</tags:echo>
+  </body>
+</html>
+</jsp:root>
\ No newline at end of file

Added: tomcat/trunk/test/webapp/bug48827.jspx
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp/bug48827.jspx?rev=918682&view=auto
==============================================================================
--- tomcat/trunk/test/webapp/bug48827.jspx (added)
+++ tomcat/trunk/test/webapp/bug48827.jspx Wed Mar  3 20:59:23 2010
@@ -0,0 +1,30 @@
+<!--
+  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.
+-->
+<jsp:root
+  xmlns:jsp="http://java.sun.com/JSP/Page"; version="2.2"
+  xmlns:tags="urn:jsptagdir:/WEB-INF/tags" >
+  <jsp:directive.page isELIgnored="false" />
+<html>
+  <body>
+    <tags:echo>
+      <jsp:attribute name="echo">00-Hello World</jsp:attribute>
+    </tags:echo>
+    <tags:echo echo="01-Hello World"></tags:echo>
+    <tags:echo echo="02-Hello World"> </tags:echo>
+  </body>
+</html>
+</jsp:root>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to