ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/catalina/startup/TestHostConfigAutomaticDeploymentContextClassName.java

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

      
    
Rootfs path

      
    
Size
2242 (2.2 KB)
MD5
27d0e1a545f34dc3f76341512c5abde8
SHA1
dbafa04695569f0b9da8d8bbc28e8488da68174f
SHA256
1ee99392f9437b9d4263161f09e16e66d3e966af21b45e350a47054b0b37b3e4
SHA512

      
    
SHA1_git
dc932405ba8551c1aabd10f68f8ee556d4db21ca
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestHostConfigAutomaticDeploymentContextClassName.java | 2.2 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.catalina.startup; import java.io.File; import java.nio.file.Files; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsInstanceOf.instanceOf; import org.junit.Test; import org.apache.catalina.Context; import org.apache.catalina.Host; import org.apache.catalina.core.StandardHost; /** * The purpose of this class is to test the automatic deployment features of the * {@link HostConfig} implementation. */ public class TestHostConfigAutomaticDeploymentContextClassName extends HostConfigAutomaticDeploymentBaseTest { @Test public void testSetContextClassName() throws Exception { Tomcat tomcat = getTomcatInstance(); Host host = tomcat.getHost(); if (host instanceof StandardHost) { StandardHost standardHost = (StandardHost) host; standardHost.setContextClass(TesterContext.class.getName()); } // Copy the WAR file File war = new File(host.getAppBaseFile(), APP_NAME.getBaseName() + ".war"); Files.copy(WAR_XML_SOURCE.toPath(), war.toPath()); // Deploy the copied war tomcat.start(); host.backgroundProcess(); // Check the Context class Context ctxt = (Context) host.findChild(APP_NAME.getName()); assertThat(ctxt, instanceOf(TesterContext.class)); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
46.48
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