ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/coyote/http2/TestHttpServlet.java

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

      
    
Rootfs path

      
    
Size
2164 (2.1 KB)
MD5
4288bcd62d9814443fab8096a55656ba
SHA1
4cc00a922b1edc197d853610da663e728f15ed54
SHA256
07a57f61854e8e68529ce01364590e3eab84c7a6f02cb2f1d354be5914feb0a3
SHA512

      
    
SHA1_git
f9ee84157349b7a33c4106b3e17c92f50d9960a7
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestHttpServlet.java | 2.1 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.coyote.http2; import java.nio.ByteBuffer; import org.junit.Assert; import org.junit.Test; /* * Implement here rather than jakarta.servlet.http.TestHttpServlet because it * needs access to package private classes. */ public class TestHttpServlet extends Http2TestBase { @Test public void testUnimplementedMethodHttp2() throws Exception { http2Connect(); // Build a POST request for a Servlet that does not implement POST byte[] headersFrameHeader = new byte[9]; ByteBuffer headersPayload = ByteBuffer.allocate(128); byte[] dataFrameHeader = new byte[9]; ByteBuffer dataPayload = ByteBuffer.allocate(0); buildPostRequest(headersFrameHeader, headersPayload, false, null, -1, "/empty", dataFrameHeader, dataPayload, null, false, 3); // Write the headers writeFrame(headersFrameHeader, headersPayload); // Body writeFrame(dataFrameHeader, dataPayload); parser.readFrame(); parser.readFrame(); String trace = output.getTrace(); String[] lines = trace.split(" "); // Check the response code Assert.assertEquals("3-HeadersStart", lines[0]); Assert.assertEquals("3-Header-[:status]-[405]", lines[1]); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
48.77
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