Home / Function/ testTrim() — netty Function Reference

testTrim() — netty Function Reference

Architecture documentation for the testTrim() function in PooledByteBufAllocatorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c01568bc_ea31_779e_c501_ed06454af98b["testTrim()"]
  f8855572_2abf_1bf6_a32b_5cf6d1cf4947["PooledByteBufAllocatorTest"]
  c01568bc_ea31_779e_c501_ed06454af98b -->|defined in| f8855572_2abf_1bf6_a32b_5cf6d1cf4947
  style c01568bc_ea31_779e_c501_ed06454af98b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java lines 87–100

    @Test
    public void testTrim() {
        PooledByteBufAllocator allocator = newAllocator(true);

        // Should return false as we never allocated from this thread yet.
        assertFalse(allocator.trimCurrentThreadCache());

        ByteBuf directBuffer = allocator.directBuffer();

        assertTrue(directBuffer.release());

        // Should return true now a cache exists for the calling thread.
        assertTrue(allocator.trimCurrentThreadCache());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free