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

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

      
    
Rootfs path

      
    
Size
2615 (2.6 KB)
MD5
56309784c72fb484c18beca11b6e2604
SHA1
7fa52811845af908abe27028a48425dbb64f968d
SHA256
3c74f03cfa676808a8577bd232f922f3abd1575555d2103385f6d35619006d73
SHA512

      
    
SHA1_git
a9f784f4d06941a6df77b0a0e64ba0b567d0dc9b
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestHttp2Section_6_3.java | 2.6 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; /** * Unit tests for Section 6.3 of <a href="https://tools.ietf.org/html/rfc7540">RFC 7540</a>. <br> * The order of tests in this class is aligned with the order of the requirements in the RFC. */ public class TestHttp2Section_6_3 extends Http2TestBase { @Test public void testPriorityFrameOnStreamZero() throws Exception { // HTTP2 upgrade http2Connect(); sendPriority(0, 1, 15); handleGoAwayResponse(1); } @Test public void testPriorityFrameBetweenHeaderFrames() throws Exception { // HTTP2 upgrade http2Connect(); // Part 1 byte[] frameHeader = new byte[9]; ByteBuffer headersPayload = ByteBuffer.allocate(128); buildSimpleGetRequestPart1(frameHeader, headersPayload, 3); writeFrame(frameHeader, headersPayload); sendPriority(5, 3, 15); handleGoAwayResponse(1, Http2Error.COMPRESSION_ERROR); } @Test public void testPriorityFrameWrongLength() throws Exception { // HTTP2 upgrade http2Connect(); byte[] priorityFrame = new byte[10]; // length ByteUtil.setThreeBytes(priorityFrame, 0, 1); // type priorityFrame[3] = FrameType.PRIORITY.getIdByte(); // No flags // Stream ID ByteUtil.set31Bits(priorityFrame, 5, 3); // Payload - left as zero os.write(priorityFrame); os.flush(); // Read reset frame parser.readFrame(); Assert.assertEquals("3-RST-[" + Http2Error.FRAME_SIZE_ERROR.getCode() + "] ", output.getTrace()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
41.61
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
https://tools.ietf.org/html/rfc7540 25 25