This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 7e65db4  Remove the debug code. Add explicit mapping for jsp-file 
defined servlet
7e65db4 is described below

commit 7e65db453b8a7740de48343c12a8a91db96ad79b
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Aug 17 15:32:10 2020 +0100

    Remove the debug code. Add explicit mapping for jsp-file defined servlet
---
 .../compiler/TestParserNoStrictWhitespace.java     | 31 ++--------------------
 test/webapp/WEB-INF/web.xml                        |  4 +++
 2 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java 
b/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java
index e8f05c9..3101dcc 100644
--- a/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java
+++ b/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java
@@ -14,18 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.jasper.compiler;
 
-import java.io.File;
-
-import jakarta.servlet.ServletContext;
-
 import org.junit.Assert;
 import org.junit.Test;
 
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.core.StandardWrapper;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.tomcat.util.buf.ByteChunk;
 
@@ -40,34 +33,14 @@ public class TestParserNoStrictWhitespace extends 
TomcatBaseTest {
     public void testBug49297NoSpaceNotStrict() throws Exception {
         getTomcatInstanceTestWebapp(false, true);
 
-        // Github / Travis / s390x debug code
-        StandardContext ctxt = (StandardContext) 
getTomcatInstance().getHost().findChild("/test");
-        StandardWrapper w = (StandardWrapper) 
ctxt.findChild("bug49297NoSpace");
-        System.out.println("JSP strict whitespace: [" +  
w.getInitParameter("strictWhitespace") + "]");
-
-        File tmpJsp = new File("test/webapp/bug49nnn/bug49297NoSpace.jsp");
-        System.out.println(".jsp [" + tmpJsp.lastModified() + "]");
-
-        File tmp = (File) 
ctxt.getServletContext().getAttribute(ServletContext.TEMPDIR);
-        File tmpJava = new File(tmp, 
"org/apache/jsp/bug49nnn/bug49297NoSpace_jsp.java");
-        File tmpClass = new File(tmp, 
"org/apache/jsp/bug49nnn/bug49297NoSpace_jsp.class");
-        System.out.println("before request  .java [" + tmpJava.lastModified() 
+ "]");
-        System.out.println("before request .class [" + tmpClass.lastModified() 
+ "]");
-        // debug code end
-
         ByteChunk res = new ByteChunk();
-        int sc = getUrl("http://localhost:"; + getPort() +
-                "/test/bug49nnn/bug49297NoSpace.jsp", res, null);
-
-        // Github / Travis / s390x debug code
-        System.out.println("after request  .java [" + tmpJava.lastModified() + 
"]");
-        System.out.println("after request .class [" + tmpClass.lastModified() 
+ "]");
-        // debug code end
+        int sc = getUrl("http://localhost:"; + getPort() + 
"/test/bug49nnn/bug49297NoSpace.jsp", res, null);
 
         Assert.assertEquals(200, sc);
         assertEcho(res.toString(), "Hello World");
     }
 
+
     /** Assertion for text printed by tags:echo */
     private static void assertEcho(String result, String expected) {
         Assert.assertTrue(result.indexOf("<p>" + expected + "</p>") > 0);
diff --git a/test/webapp/WEB-INF/web.xml b/test/webapp/WEB-INF/web.xml
index d5a3c95..3706586 100644
--- a/test/webapp/WEB-INF/web.xml
+++ b/test/webapp/WEB-INF/web.xml
@@ -74,6 +74,10 @@
         <param-value>false</param-value>
       </init-param>
   </servlet>
+  <servlet-mapping>
+    <servlet-name>bug49297NoSpace</servlet-name>
+    <url-pattern>/bug49nnn/bug49297NoSpace.jsp</url-pattern>
+  </servlet-mapping>
   <servlet>
     <servlet-name>Bug49922Forward</servlet-name>
     <servlet-class>


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

Reply via email to