Home / Function/ testOverflowWhileAddingComponent() — netty Function Reference

testOverflowWhileAddingComponent() — netty Function Reference

Architecture documentation for the testOverflowWhileAddingComponent() function in AbstractCompositeByteBufTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  84a29c60_77c1_a8fa_11af_74c1881e3f89["testOverflowWhileAddingComponent()"]
  47bc0a20_e243_89ff_132b_99ac6b23835f["AbstractCompositeByteBufTest"]
  84a29c60_77c1_a8fa_11af_74c1881e3f89 -->|defined in| 47bc0a20_e243_89ff_132b_99ac6b23835f
  style 84a29c60_77c1_a8fa_11af_74c1881e3f89 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java lines 1652–1672

    @Test
    public void testOverflowWhileAddingComponent() {
        int capacity = 1024 * 1024; // 1MB
        final ByteBuf buffer = Unpooled.buffer(capacity).writeZero(capacity);
        final CompositeByteBuf compositeByteBuf = compositeBuffer(Integer.MAX_VALUE);

        try {
            assertThrows(IllegalArgumentException.class, new Executable() {
                @Override
                public void execute() {
                    for (int i = 0; i >= 0; i += buffer.readableBytes()) {
                        ByteBuf duplicate = buffer.duplicate();
                        compositeByteBuf.addComponent(duplicate);
                        duplicate.retain();
                    }
                }
            });
        } finally {
            compositeByteBuf.release();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testOverflowWhileAddingComponent() do?
testOverflowWhileAddingComponent() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java.
Where is testOverflowWhileAddingComponent() defined?
testOverflowWhileAddingComponent() is defined in buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java at line 1652.

Analyze Your Own Codebase

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

Try Supermodel Free