Home / Class/ QuicChannelConnectTest Class — netty Architecture

QuicChannelConnectTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  1e1bc485_1969_4537_ef9b_f28971b2f663["QuicChannelConnectTest"]
  adfc3cc1_280f_9a8f_79b5_d4330fd798bd["QuicChannelConnectTest.java"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|defined in| adfc3cc1_280f_9a8f_79b5_d4330fd798bd
  e6bfbc8d_0670_3c4f_1514_4e3e947982d5["testConnectAndQLog()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| e6bfbc8d_0670_3c4f_1514_4e3e947982d5
  424558b6_f0ce_b090_4624_476469454a57["testConnectAndQLogDir()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| 424558b6_f0ce_b090_4624_476469454a57
  92194a28_1ade_17eb_5f02_fdef14ac04b3["testQLog()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| 92194a28_1ade_17eb_5f02_fdef14ac04b3
  2334fa86_a183_0679_0322_244d610f9e19["testKeylogEnabled()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| 2334fa86_a183_0679_0322_244d610f9e19
  77ff85d9_67a7_19f3_e3c7_b8e3f2067ddb["testKeylogDisabled()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| 77ff85d9_67a7_19f3_e3c7_b8e3f2067ddb
  fc69cfda_c8d4_a95d_2160_bb4971618026["testCustomKeylog()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| fc69cfda_c8d4_a95d_2160_bb4971618026
  ac3aa79a_6415_f0d1_357d_e27d3d9712c4["testKeylog()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| ac3aa79a_6415_f0d1_357d_e27d3d9712c4
  ef0f7c2b_b2d8_6fde_6951_0102da03bf87["testAddressValidation()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| ef0f7c2b_b2d8_6fde_6951_0102da03bf87
  bf4101db_1115_4366_dce7_661bc3f953b3["testConnectWithCustomIdLength()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| bf4101db_1115_4366_dce7_661bc3f953b3
  7025d259_f867_a958_bb46_cdcbf717b5d7["testConnectWithCustomIdLengthOfZero()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| 7025d259_f867_a958_bb46_cdcbf717b5d7
  4a44b4cc_9598_a77c_5e89_b75da8fb4fcd["testConnectWithDroppedPackets()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| 4a44b4cc_9598_a77c_5e89_b75da8fb4fcd
  4e96f5cd_d213_a781_87d5_e5c9e72fcdc5["testConnectWithNoDroppedPacketsAndRandomConnectionIdGenerator()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| 4e96f5cd_d213_a781_87d5_e5c9e72fcdc5
  d849f0f1_d890_5d28_3925_d8c10965156b["testConnectWithDroppedPacketsAndRandomConnectionIdGenerator()"]
  1e1bc485_1969_4537_ef9b_f28971b2f663 -->|method| d849f0f1_d890_5d28_3925_d8c10965156b

Relationship Graph

Source Code

codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelConnectTest.java lines 97–1985

public class QuicChannelConnectTest extends AbstractQuicTest {

    @ParameterizedTest
    @MethodSource("newSslTaskExecutors")
    @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS)
    public void testConnectAndQLog(Executor executor) throws Throwable {
        Path path = Files.createTempFile("qlog", ".quic");
        assertTrue(path.toFile().delete());
        testQLog(executor, path, p -> {
            try {
                // Some log should have been written at some point.
                while (Files.readAllLines(p).isEmpty()) {
                    Thread.sleep(100);
                }
            } catch (Exception e) {
                throw new AssertionError(e);
            }
        });
    }

    @ParameterizedTest
    @MethodSource("newSslTaskExecutors")
    @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS)
    public void testConnectAndQLogDir(Executor executor) throws Throwable {
        Path path = Files.createTempDirectory("qlogdir-");
        testQLog(executor, path, p -> {
            try {
                for (;;) {
                    File[] files = path.toFile().listFiles();
                    if (files != null && files.length == 1) {
                        if (!Files.readAllLines(files[0].toPath()).isEmpty()) {
                            return;
                        }
                    }
                    Thread.sleep(100);
                }
            } catch (Exception e) {
                throw new AssertionError(e);
            }
        });
    }

    private void testQLog(Executor executor, Path path, Consumer<Path> consumer) throws Throwable {
        QuicChannelValidationHandler serverValidationHandler = new QuicChannelValidationHandler();
        QuicChannelValidationHandler clientValidationHandler = new QuicChannelValidationHandler();
        Channel server = QuicTestUtils.newServer(executor, serverValidationHandler,
                new ChannelInboundHandlerAdapter());
        InetSocketAddress address = (InetSocketAddress) server.localAddress();
        Channel channel = QuicTestUtils.newClient(executor);
        try {
            QuicChannel quicChannel = QuicTestUtils.newQuicChannelBootstrap(channel)
                    .handler(clientValidationHandler)
                    .option(QuicChannelOption.QLOG,
                            new QLogConfiguration(path.toString(), "testTitle", "test"))
                    .streamHandler(new ChannelInboundHandlerAdapter())
                    .remoteAddress(address)
                    .connect()
                    .get();
            QuicStreamChannel stream = quicChannel.createStream(QuicStreamType.BIDIRECTIONAL,
                    new ChannelInboundHandlerAdapter()).get();

            stream.writeAndFlush(Unpooled.directBuffer().writeZero(10)).sync();
            stream.close().sync();
            quicChannel.close().sync();
            quicChannel.closeFuture().sync();
            consumer.accept(path);

            serverValidationHandler.assertState();
            clientValidationHandler.assertState();
        } finally {
            server.close().sync();
            // Close the parent Datagram channel as well.
            channel.close().sync();

            shutdown(executor);
        }
    }

    @ParameterizedTest
    @MethodSource("newSslTaskExecutors")
    public void testKeylogEnabled(Executor executor) throws Throwable {

Frequently Asked Questions

What is the QuicChannelConnectTest class?
QuicChannelConnectTest is a class in the netty codebase, defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelConnectTest.java.
Where is QuicChannelConnectTest defined?
QuicChannelConnectTest is defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelConnectTest.java at line 97.

Analyze Your Own Codebase

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

Try Supermodel Free