Home / Function/ testIncorrectLength() — netty Function Reference

testIncorrectLength() — netty Function Reference

Architecture documentation for the testIncorrectLength() function in SslHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  cd5bf795_a283_0546_f1d8_6eb225481663["testIncorrectLength()"]
  adaf7dc7_94e2_152f_ffdb_453fdaa4f25e["SslHandlerTest"]
  cd5bf795_a283_0546_f1d8_6eb225481663 -->|defined in| adaf7dc7_94e2_152f_ffdb_453fdaa4f25e
  style cd5bf795_a283_0546_f1d8_6eb225481663 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java lines 1678–1701

    @Test
    public void testIncorrectLength() throws SSLException {
        final SelfSignedCertificate cert = CachedSelfSignedCertificate.getCachedCertificate();
        final EmbeddedChannel channel = new EmbeddedChannel();
        channel.pipeline().addLast(
                SslContextBuilder.forServer(cert.key(), cert.cert())
                        .sslProvider(SslProvider.JDK)
                        .build()
                        .newHandler(channel.alloc()));
        final ByteBuf buf = channel.alloc().buffer(5);
        buf.writeByte(0x0);
        buf.writeByte(0x1);
        buf.writeByte(0xfe);
        buf.writeByte(0x87);
        buf.writeByte(0x2);
        DecoderException e = assertThrows(DecoderException.class, new Executable() {
            @Override
            public void execute() {
                channel.writeInbound(buf);
            }
        });
        assertInstanceOf(NotSslRecordException.class, e.getCause());
        assertTrue(channel.finishAndReleaseAll());
    }

Domain

Subdomains

Frequently Asked Questions

What does testIncorrectLength() do?
testIncorrectLength() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java.
Where is testIncorrectLength() defined?
testIncorrectLength() is defined in handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java at line 1678.

Analyze Your Own Codebase

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

Try Supermodel Free