ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/jasper/servlet/TestJasperInitializer.java

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

      
    
Rootfs path

      
    
Size
2543 (2.5 KB)
MD5
eecac4c470bcf58d4ff0cd39616ddc19
SHA1
2cd300dfd5c66fe0481291e77a61dda598207a5d
SHA256
283e11bc389cb372b23c50a2c80ee03d463e2b2d24585987d36e4ca3c1d1d536
SHA512

      
    
SHA1_git
0c2351fb8997f844c30e26ab79af5176dd125196
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestJasperInitializer.java | 2.5 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.servlet; import java.util.Collections; import java.util.concurrent.atomic.AtomicInteger; import jakarta.servlet.descriptor.JspConfigDescriptor; import jakarta.servlet.jsp.JspFactory; import org.junit.Assert; import org.junit.Test; import org.apache.jasper.Constants; import org.apache.jasper.runtime.JspFactoryImpl; import org.apache.tomcat.unittest.TesterServletContext; public class TestJasperInitializer { @Test public void testPoolSize() throws Exception { final AtomicInteger actualPoolSize = new AtomicInteger(-1); final JspFactoryImpl defaultFactory = new JspFactoryImpl() { @Override public void setPoolSize(int poolSize) { actualPoolSize.set(poolSize); super.setPoolSize(poolSize); } }; JspFactory.setDefaultFactory(defaultFactory); new JasperInitializer().onStartup(Collections.emptySet(), new TesterServletContext(){ @Override public void setAttribute(String name, Object object) { // ignore } @Override public JspConfigDescriptor getJspConfigDescriptor() { return null; } @Override public String getInitParameter(String name) { if (Constants.JSP_FACTORY_POOL_SIZE_INIT_PARAM.equals(name)) { return "3"; } return super.getInitParameter(name); } }); // Default value is 8 in JasperInitializer but we have overridden it Assert.assertEquals(3, actualPoolSize.get()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
45.25
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