Home / Function/ testSetCapacity() — netty Function Reference

testSetCapacity() — netty Function Reference

Architecture documentation for the testSetCapacity() function in HpackDynamicTableTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f158b45d_bbe9_2008_5c3f_adf4e839d688["testSetCapacity()"]
  66c73598_e36b_e60b_26d1_60dc29c9b823["HpackDynamicTableTest"]
  f158b45d_bbe9_2008_5c3f_adf4e839d688 -->|defined in| 66c73598_e36b_e60b_26d1_60dc29c9b823
  style f158b45d_bbe9_2008_5c3f_adf4e839d688 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDynamicTableTest.java lines 95–117

    @Test
    public void testSetCapacity() {
        HpackHeaderField entry1 = new HpackHeaderField(FOO, BAR);
        HpackHeaderField entry2 = new HpackHeaderField(HELLO, WORLD);
        final int size1 = entry1.size();
        final int size2 = entry2.size();
        HpackDynamicTable table = new HpackDynamicTable(size1 + size2);
        table.add(entry1);
        table.add(entry2);
        assertEquals(2, table.length());
        assertEquals(size1 + size2, table.size());
        table.setCapacity(((long) size1 + size2) * 2); //larger capacity
        assertEquals(2, table.length());
        assertEquals(size1 + size2, table.size());
        table.setCapacity(size2); //smaller capacity
        //entry1 will be removed
        assertEquals(1, table.length());
        assertEquals(size2, table.size());
        assertEquals(entry2, table.getEntry(1));
        table.setCapacity(0); //clear all
        assertEquals(0, table.length());
        assertEquals(0, table.size());
    }

Domain

Subdomains

Frequently Asked Questions

What does testSetCapacity() do?
testSetCapacity() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDynamicTableTest.java.
Where is testSetCapacity() defined?
testSetCapacity() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDynamicTableTest.java at line 95.

Analyze Your Own Codebase

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

Try Supermodel Free