Home / Function/ testBoundEnforced() — netty Function Reference

testBoundEnforced() — netty Function Reference

Architecture documentation for the testBoundEnforced() function in BoundedInputStreamTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a387d0fb_a207_d742_466b_5c9195391c51["testBoundEnforced()"]
  ab2c52d1_4dad_2c5a_94ad_a0909a9613d1["BoundedInputStreamTest"]
  a387d0fb_a207_d742_466b_5c9195391c51 -->|defined in| ab2c52d1_4dad_2c5a_94ad_a0909a9613d1
  style a387d0fb_a207_d742_466b_5c9195391c51 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/internal/BoundedInputStreamTest.java lines 33–49

    @RepeatedTest(50)
    void testBoundEnforced() throws IOException {
        final byte[] bytes = new byte[64];
        ThreadLocalRandom.current().nextBytes(bytes);
        try (BoundedInputStream reader = new BoundedInputStream(new ByteArrayInputStream(bytes), bytes.length - 1)) {
            assertEquals(bytes[0], (byte) reader.read());

            assertThrows(IOException.class, () -> {
                int max = bytes.length;
                do {
                    int result = reader.read(new byte[max], 0, max);
                    assertThat(result).isNotEqualTo(-1);
                    max -= result;
                } while (max > 0);
            });
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testBoundEnforced() do?
testBoundEnforced() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/internal/BoundedInputStreamTest.java.
Where is testBoundEnforced() defined?
testBoundEnforced() is defined in common/src/test/java/io/netty/util/internal/BoundedInputStreamTest.java at line 33.

Analyze Your Own Codebase

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

Try Supermodel Free