Home / Function/ testChannelProcessingOrder() — netty Function Reference

testChannelProcessingOrder() — netty Function Reference

Architecture documentation for the testChannelProcessingOrder() function in FixedChannelPoolTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6e9c2af9_fc01_e612_597e_133e4ed850e9["testChannelProcessingOrder()"]
  92761f16_3144_6791_29c9_00f65a091a8f["FixedChannelPoolTest"]
  6e9c2af9_fc01_e612_597e_133e4ed850e9 -->|defined in| 92761f16_3144_6791_29c9_00f65a091a8f
  style 6e9c2af9_fc01_e612_597e_133e4ed850e9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/pool/FixedChannelPoolTest.java lines 366–406

    @ParameterizedTest
    @ValueSource(booleans = { true, false })
    public void testChannelProcessingOrder(boolean lastInFirstOutOrdering) {
        Tuple t = bootstrap();

        // Start server
        Channel sc = t.sb.bind(t.address).syncUninterruptibly().channel();

        FixedChannelPool pool = new FixedChannelPool(t.cb, new TestChannelPoolHandler(),
                ChannelHealthChecker.ACTIVE, AcquireTimeoutAction.NEW, 500, 1,
                Integer.MAX_VALUE, false, lastInFirstOutOrdering);

        // create
        int totalChannels = 5;
        List<Channel> channels = new ArrayList<>();
        for (int i = 0; i < totalChannels; i++) {
            Channel channel = pool.acquire().syncUninterruptibly().getNow();
            channels.add(channel);
        }
        for (int i = 0; i < totalChannels; i++) {
            pool.release(channels.get(i)).syncUninterruptibly().getNow();
        }

        // test logic
        for (int i = 0; i < totalChannels; i++) {
            Channel channel = pool.acquire().syncUninterruptibly().getNow();
            if (lastInFirstOutOrdering) {
                assertSame(channel, channels.get(totalChannels - 1 - i));
            } else {
                assertSame(channel, channels.get(i));
            }
        }

        // close all
        for (int i = 0; i < totalChannels; i++) {
            channels.get(i).close().syncUninterruptibly();
            pool.release(channels.get(i)).syncUninterruptibly();
        }
        sc.close().syncUninterruptibly();
        pool.close();
    }

Domain

Subdomains

Frequently Asked Questions

What does testChannelProcessingOrder() do?
testChannelProcessingOrder() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/pool/FixedChannelPoolTest.java.
Where is testChannelProcessingOrder() defined?
testChannelProcessingOrder() is defined in transport/src/test/java/io/netty/channel/pool/FixedChannelPoolTest.java at line 366.

Analyze Your Own Codebase

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

Try Supermodel Free