Home / Class/ AdaptivePoolingAllocatorTest Class — netty Architecture

AdaptivePoolingAllocatorTest Class — netty Architecture

Architecture documentation for the AdaptivePoolingAllocatorTest class in AdaptivePoolingAllocatorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  baaa4c08_3c9e_48ad_75d1_068e5be710b3["AdaptivePoolingAllocatorTest"]
  236e91a9_7725_3455_0fcf_64791e96231e["AdaptivePoolingAllocatorTest.java"]
  baaa4c08_3c9e_48ad_75d1_068e5be710b3 -->|defined in| 236e91a9_7725_3455_0fcf_64791e96231e
  6a772d26_4838_1ba9_5ca7_c040727efb83["sizeClassComputations()"]
  baaa4c08_3c9e_48ad_75d1_068e5be710b3 -->|method| 6a772d26_4838_1ba9_5ca7_c040727efb83
  56dc8769_f189_8a9e_e5c5_a9791722d135["assertSizeClassOf()"]
  baaa4c08_3c9e_48ad_75d1_068e5be710b3 -->|method| 56dc8769_f189_8a9e_e5c5_a9791722d135

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AdaptivePoolingAllocatorTest.java lines 22–42

class AdaptivePoolingAllocatorTest {
    @Test
    void sizeClassComputations() throws Exception {
        final int[] sizeClasses = AdaptivePoolingAllocator.getSizeClasses();
        for (int sizeClassIndex = 0; sizeClassIndex < sizeClasses.length; sizeClassIndex++) {
            final int previousSizeIncluded = sizeClassIndex == 0? 0 : sizeClasses[sizeClassIndex - 1] + 1;
            assertSizeClassOf(sizeClassIndex, previousSizeIncluded, sizeClasses[sizeClassIndex]);
        }
        // beyond the last size class, we return the size class array's length
        assertSizeClassOf(sizeClasses.length, sizeClasses[sizeClasses.length - 1] + 1,
                          sizeClasses[sizeClasses.length - 1] + 1);
    }

    private static void assertSizeClassOf(int expectedSizeClass, int previousSizeIncluded, int maxSizeIncluded) {
        for (int size = previousSizeIncluded; size <= maxSizeIncluded; size++) {
            int sizeToTest = size;
            assertEquals(expectedSizeClass, AdaptivePoolingAllocator.sizeClassIndexOf(size),
                         () -> "size = " + sizeToTest);
        }
    }
}

Frequently Asked Questions

What is the AdaptivePoolingAllocatorTest class?
AdaptivePoolingAllocatorTest is a class in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AdaptivePoolingAllocatorTest.java.
Where is AdaptivePoolingAllocatorTest defined?
AdaptivePoolingAllocatorTest is defined in buffer/src/test/java/io/netty/buffer/AdaptivePoolingAllocatorTest.java at line 22.

Analyze Your Own Codebase

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

Try Supermodel Free