ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/jasper/runtime/TestJspContextWrapper.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/jasper/runtime/TestJspContextWrapper.java
Status
scanned
Type
file
Name
TestJspContextWrapper.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
3098 (3.0 KB)
MD5
f18ee29c3360e64785c8bef64d3c4900
SHA1
11db1c84fe90fdd78f891fd9838ee8b87f261cc2
SHA256
cc3ffe9288ac4a9f792daf1b107bf03b73ddaff63e9e23960f7d28286ed81e38
SHA512

      
    
SHA1_git
fdbc7b8c7eb30893a3ce82dbe6acb65468212ade
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestJspContextWrapper.java | 3.0 KB |

/* * 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.runtime; import java.math.RoundingMode; import java.util.Collections; import jakarta.servlet.DispatcherType; import jakarta.servlet.http.HttpServletResponse; import org.junit.Assert; import org.junit.Test; import org.apache.catalina.startup.TomcatBaseTest; import org.apache.tomcat.util.buf.ByteChunk; public class TestJspContextWrapper extends TomcatBaseTest { @Test public void testELTagFilePageContext() throws Exception { getTomcatInstanceTestWebapp(true, true); ByteChunk out = new ByteChunk(); int rc = getUrl("http://localhost:" + getPort() + "/test/bug5nnnn/bug58178.jsp", out, null); Assert.assertEquals(HttpServletResponse.SC_OK, rc); String result = out.toString(); Assert.assertTrue(result, result.contains("PASS")); } @Test public void testELTagFileImports() throws Exception { getTomcatInstanceTestWebapp(false, true); ByteChunk out = new ByteChunk(); int rc = getUrl("http://localhost:" + getPort() + "/test/bug5nnnn/bug58178b.jsp", out, null); Assert.assertEquals(HttpServletResponse.SC_OK, rc); String result = out.toString(); Assert.assertTrue(result, result.contains("00-" + DispatcherType.ASYNC)); // No obvious status fields for jakarta.servlet.http // Could hack something with HttpUtils... // No obvious status fields for jakarta.servlet.jsp // Wild card (package) import Assert.assertTrue(result, result.contains("01-" + RoundingMode.HALF_UP)); // Class import Assert.assertTrue(result, result.contains("02-" + Collections.EMPTY_LIST.size())); } @Test public void testELTagFileELContextListener() throws Exception { getTomcatInstanceTestWebapp(false, true); ByteChunk out = new ByteChunk(); int rc = getUrl("http://localhost:" + getPort() + "/test/bug5nnnn/bug58178c.jsp", out, null); Assert.assertEquals(HttpServletResponse.SC_OK, rc); String result = out.toString(); Assert.assertTrue(result, result.contains("JSP count: 1")); Assert.assertTrue(result, result.contains("Tag count: 1")); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
34.39
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9