Home / Function/ testWriteOneInbound() — netty Function Reference

testWriteOneInbound() — netty Function Reference

Architecture documentation for the testWriteOneInbound() function in EmbeddedChannelTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9f637746_d5ad_e229_0244_c01abe4b4e0d["testWriteOneInbound()"]
  300cabef_b042_697f_5623_37ce249f504d["EmbeddedChannelTest"]
  9f637746_d5ad_e229_0244_c01abe4b4e0d -->|defined in| 300cabef_b042_697f_5623_37ce249f504d
  17f7b672_524d_b9ed_a14b_29a7376a7ef2["release()"]
  9f637746_d5ad_e229_0244_c01abe4b4e0d -->|calls| 17f7b672_524d_b9ed_a14b_29a7376a7ef2
  4fc8a753_5665_2ca5_69db_dc1006272b05["close()"]
  9f637746_d5ad_e229_0244_c01abe4b4e0d -->|calls| 4fc8a753_5665_2ca5_69db_dc1006272b05
  style 9f637746_d5ad_e229_0244_c01abe4b4e0d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java lines 446–475

    @Test
    public void testWriteOneInbound() throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        final AtomicInteger flushCount = new AtomicInteger(0);

        EmbeddedChannel channel = new EmbeddedChannel(new ChannelInboundHandlerAdapter() {
            @Override
            public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                ReferenceCountUtil.release(msg);
                latch.countDown();
            }

            @Override
            public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
                flushCount.incrementAndGet();
            }
        });

        channel.writeOneInbound("Hello, Netty!");

        if (!latch.await(1L, TimeUnit.SECONDS)) {
            fail("Nobody called #channelRead() in time.");
        }

        channel.close().syncUninterruptibly();

        // There was no #flushInbound() call so nobody should have called
        // #channelReadComplete()
        assertEquals(0, flushCount.get());
    }

Domain

Subdomains

Frequently Asked Questions

What does testWriteOneInbound() do?
testWriteOneInbound() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java.
Where is testWriteOneInbound() defined?
testWriteOneInbound() is defined in transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java at line 446.
What does testWriteOneInbound() call?
testWriteOneInbound() calls 2 function(s): close, release.

Analyze Your Own Codebase

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

Try Supermodel Free