Home / Class/ DelegatingSslContextTest Class — netty Architecture

DelegatingSslContextTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  1ba83f0f_2d70_1280_f32f_d5a21ef377aa["DelegatingSslContextTest"]
  6c276176_525d_6a7d_2f57_abfc9a605fe8["DelegatingSslContextTest.java"]
  1ba83f0f_2d70_1280_f32f_d5a21ef377aa -->|defined in| 6c276176_525d_6a7d_2f57_abfc9a605fe8
  2c088f6c_08f8_ea98_b407_53e8da74cd0f["testInitEngineOnNewEngine()"]
  1ba83f0f_2d70_1280_f32f_d5a21ef377aa -->|method| 2c088f6c_08f8_ea98_b407_53e8da74cd0f
  110d35c8_76c8_5fb1_53ec_d4fbf83382ab["testInitEngineOnNewSslHandler()"]
  1ba83f0f_2d70_1280_f32f_d5a21ef377aa -->|method| 110d35c8_76c8_5fb1_53ec_d4fbf83382ab
  aa2410ce_cebb_30f1_7bf2_1833112d0358["SslContext()"]
  1ba83f0f_2d70_1280_f32f_d5a21ef377aa -->|method| aa2410ce_cebb_30f1_7bf2_1833112d0358

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/DelegatingSslContextTest.java lines 27–60

public class DelegatingSslContextTest {
    private static final String[] EXPECTED_PROTOCOLS = { SslProtocols.TLS_v1_1 };

    @Test
    public void testInitEngineOnNewEngine() throws Exception {
        SslContext delegating = newDelegatingSslContext();

        SSLEngine engine = delegating.newEngine(UnpooledByteBufAllocator.DEFAULT);
        assertArrayEquals(EXPECTED_PROTOCOLS, engine.getEnabledProtocols());

        engine = delegating.newEngine(UnpooledByteBufAllocator.DEFAULT, "localhost", 9090);
        assertArrayEquals(EXPECTED_PROTOCOLS, engine.getEnabledProtocols());
    }

    @Test
    public void testInitEngineOnNewSslHandler() throws Exception {
        SslContext delegating = newDelegatingSslContext();

        SslHandler handler = delegating.newHandler(UnpooledByteBufAllocator.DEFAULT);
        assertArrayEquals(EXPECTED_PROTOCOLS, handler.engine().getEnabledProtocols());

        handler = delegating.newHandler(UnpooledByteBufAllocator.DEFAULT, "localhost", 9090);
        assertArrayEquals(EXPECTED_PROTOCOLS, handler.engine().getEnabledProtocols());
    }

    private static SslContext newDelegatingSslContext() throws Exception {
        return new DelegatingSslContext(new JdkSslContext(SSLContext.getDefault(), false, ClientAuth.NONE)) {
            @Override
            protected void initEngine(SSLEngine engine) {
                engine.setEnabledProtocols(EXPECTED_PROTOCOLS);
            }
        };
    }
}

Frequently Asked Questions

What is the DelegatingSslContextTest class?
DelegatingSslContextTest is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/DelegatingSslContextTest.java.
Where is DelegatingSslContextTest defined?
DelegatingSslContextTest is defined in handler/src/test/java/io/netty/handler/ssl/DelegatingSslContextTest.java at line 27.

Analyze Your Own Codebase

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

Try Supermodel Free