Home / Function/ testMaterialCached() — netty Function Reference

testMaterialCached() — netty Function Reference

Architecture documentation for the testMaterialCached() function in OpenSslCachingKeyMaterialProviderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  422c61b4_856d_a1ce_8147_e5946604b807["testMaterialCached()"]
  980a53ac_14e5_8a7b_c0f5_e0c63448f46b["OpenSslCachingKeyMaterialProviderTest"]
  422c61b4_856d_a1ce_8147_e5946604b807 -->|defined in| 980a53ac_14e5_8a7b_c0f5_e0c63448f46b
  style 422c61b4_856d_a1ce_8147_e5946604b807 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/OpenSslCachingKeyMaterialProviderTest.java lines 48–73

    @Test
    public void testMaterialCached() throws Exception {
        OpenSslKeyMaterialProvider provider = newMaterialProvider(newKeyManagerFactory(), PASSWORD);

        OpenSslKeyMaterial material = provider.chooseKeyMaterial(UnpooledByteBufAllocator.DEFAULT, EXISTING_ALIAS);
        assertNotNull(material);
        assertNotEquals(0, material.certificateChainAddress());
        assertNotEquals(0, material.privateKeyAddress());
        assertEquals(2, material.refCnt());

        OpenSslKeyMaterial material2 = provider.chooseKeyMaterial(UnpooledByteBufAllocator.DEFAULT, EXISTING_ALIAS);
        assertNotNull(material2);
        assertEquals(material.certificateChainAddress(), material2.certificateChainAddress());
        assertEquals(material.privateKeyAddress(), material2.privateKeyAddress());
        assertEquals(3, material.refCnt());
        assertEquals(3, material2.refCnt());

        assertFalse(material.release());
        assertFalse(material2.release());

        // After this the material should have been released.
        provider.destroy();

        assertEquals(0, material.refCnt());
        assertEquals(0, material2.refCnt());
    }

Domain

Subdomains

Frequently Asked Questions

What does testMaterialCached() do?
testMaterialCached() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/OpenSslCachingKeyMaterialProviderTest.java.
Where is testMaterialCached() defined?
testMaterialCached() is defined in handler/src/test/java/io/netty/handler/ssl/OpenSslCachingKeyMaterialProviderTest.java at line 48.

Analyze Your Own Codebase

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

Try Supermodel Free