Home / Function/ test_KeepAlive() — netty Function Reference

test_KeepAlive() — netty Function Reference

Architecture documentation for the test_KeepAlive() function in HttpServerKeepAliveHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  69511d36_cbb6_3cd3_c5dc_7eab8f1533db["test_KeepAlive()"]
  be1dd72c_0689_de7f_2cae_50d18d342f5c["HttpServerKeepAliveHandlerTest"]
  69511d36_cbb6_3cd3_c5dc_7eab8f1533db -->|defined in| be1dd72c_0689_de7f_2cae_50d18d342f5c
  4a65f9df_769d_214b_e196_3b450aa1375b["setupMessageLength()"]
  69511d36_cbb6_3cd3_c5dc_7eab8f1533db -->|calls| 4a65f9df_769d_214b_e196_3b450aa1375b
  style 69511d36_cbb6_3cd3_c5dc_7eab8f1533db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpServerKeepAliveHandlerTest.java lines 76–101

    @ParameterizedTest
    @MethodSource("keepAliveProvider")
    public void test_KeepAlive(boolean isKeepAliveResponseExpected, HttpVersion httpVersion,
                               HttpResponseStatus responseStatus,
                               String sendKeepAlive, int setSelfDefinedMessageLength,
                               AsciiString setResponseConnection) throws Exception {
        FullHttpRequest request = new DefaultFullHttpRequest(httpVersion, HttpMethod.GET, "/v1/foo/bar");
        setKeepAlive(request, REQUEST_KEEP_ALIVE.equals(sendKeepAlive));
        HttpResponse response = new DefaultFullHttpResponse(httpVersion, responseStatus);
        if (setResponseConnection != null) {
            response.headers().set(HttpHeaderNames.CONNECTION, setResponseConnection);
        }
        setupMessageLength(response, setSelfDefinedMessageLength);

        assertTrue(channel.writeInbound(request));
        Object requestForwarded = channel.readInbound();
        assertEquals(request, requestForwarded);
        ReferenceCountUtil.release(requestForwarded);
        channel.writeAndFlush(response);
        HttpResponse writtenResponse = channel.readOutbound();

        assertEquals(isKeepAliveResponseExpected, channel.isOpen(), "channel.isOpen");
        assertEquals(isKeepAliveResponseExpected, isKeepAlive(writtenResponse), "response keep-alive");
        ReferenceCountUtil.release(writtenResponse);
        assertFalse(channel.finishAndReleaseAll());
    }

Domain

Subdomains

Frequently Asked Questions

What does test_KeepAlive() do?
test_KeepAlive() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpServerKeepAliveHandlerTest.java.
Where is test_KeepAlive() defined?
test_KeepAlive() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpServerKeepAliveHandlerTest.java at line 76.
What does test_KeepAlive() call?
test_KeepAlive() calls 1 function(s): setupMessageLength.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free