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

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

      
    
Rootfs path

      
    
Size
3142 (3.1 KB)
MD5
f0352f7077e7fb1ce24d1a07f975b534
SHA1
b0ff0f3a8d8e42c103621386cb1f07d5526609c4
SHA256
8d492b6859b8e83f3763c42059909286fa0d9e2c596687d5de94b1f8aac46f1d
SHA512

      
    
SHA1_git
b63a1ec8b6c64d9238afee83402dd579a2d0908b
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestHttp2Timeouts.java | 3.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 org.junit.Assert; import org.junit.Before; import org.junit.Test; public class TestHttp2Timeouts extends Http2TestBase { @Override @Before public void http2Connect() throws Exception { super.http2Connect(); } /* * Simple request won't fill buffer so timeout will occur in Tomcat internal code during response completion. */ @Test public void testClientWithEmptyWindow() throws Exception { sendSettings(0, false, new SettingValue(Setting.INITIAL_WINDOW_SIZE.getId(), 0)); sendSimpleGetRequest(3); // Settings parser.readFrame(); // Headers parser.readFrame(); output.clearTrace(); parser.readFrame(); Assert.assertEquals("3-RST-[11] ", output.getTrace()); } /* * Large request will fill buffer so timeout will occur in application code during response write (when Tomcat * commits the response and flushes the buffer as a result of the buffer filling). */ @Test public void testClientWithEmptyWindowLargeResponse() throws Exception { sendSettings(0, false, new SettingValue(Setting.INITIAL_WINDOW_SIZE.getId(), 0)); sendLargeGetRequest(3); // Settings parser.readFrame(); // Headers parser.readFrame(); output.clearTrace(); parser.readFrame(); Assert.assertEquals("3-RST-[11] ", output.getTrace()); } /* * Timeout with app reading request body directly. */ @Test public void testClientPostsNoBody() throws Exception { sendSimplePostRequest(3, null, false); // Headers parser.readFrame(); output.clearTrace(); parser.readFrame(); Assert.assertEquals("3-RST-[11] ", output.getTrace()); } /* * Timeout with app processing parameters. */ @Test public void testClientPostsNoParameters() throws Exception { sendParameterPostRequest(3, null, null, 10, false); // Headers parser.readFrame(); output.clearTrace(); parser.readFrame(); Assert.assertEquals("3-RST-[11] ", output.getTrace()); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
36.17
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