Home / Function/ testMultipleUpgradeRequestsFail() — netty Function Reference

testMultipleUpgradeRequestsFail() — netty Function Reference

Architecture documentation for the testMultipleUpgradeRequestsFail() function in HttpClientUpgradeHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f74ae65e_72cb_3a55_bcaa_0518274f02fd["testMultipleUpgradeRequestsFail()"]
  64e7cef3_ca61_31ce_7834_0d1da2dc4960["HttpClientUpgradeHandlerTest"]
  f74ae65e_72cb_3a55_bcaa_0518274f02fd -->|defined in| 64e7cef3_ca61_31ce_7834_0d1da2dc4960
  style f74ae65e_72cb_3a55_bcaa_0518274f02fd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpClientUpgradeHandlerTest.java lines 220–243

    @Test
    public void testMultipleUpgradeRequestsFail() {
        HttpClientUpgradeHandler.SourceCodec sourceCodec = new FakeSourceCodec();
        HttpClientUpgradeHandler.UpgradeCodec upgradeCodec = new FakeUpgradeCodec();
        HttpClientUpgradeHandler handler = new HttpClientUpgradeHandler(sourceCodec, upgradeCodec, 1024);
        final EmbeddedChannel channel = new EmbeddedChannel();
        channel.pipeline().addFirst("upgrade", handler);

        assertTrue(
                channel.writeOutbound(new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "netty.io")));
        FullHttpRequest request = channel.readOutbound();
        assertTrue(request.release());

        final FullHttpRequest secondReq = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "netty.io");
        assertThrows(IllegalStateException.class, new Executable() {
                    @Override
                    public void execute() throws Throwable {
                        channel.writeOutbound(secondReq);
                    }
                });

        assertEquals(0, secondReq.refCnt());
        assertFalse(channel.finish());
    }

Domain

Subdomains

Frequently Asked Questions

What does testMultipleUpgradeRequestsFail() do?
testMultipleUpgradeRequestsFail() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpClientUpgradeHandlerTest.java.
Where is testMultipleUpgradeRequestsFail() defined?
testMultipleUpgradeRequestsFail() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpClientUpgradeHandlerTest.java at line 220.

Analyze Your Own Codebase

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

Try Supermodel Free