Home / Function/ testWriteOneOutbound() — netty Function Reference

testWriteOneOutbound() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f1b7ba5e_bd17_e61e_e2e3_524bbe1a06d1["testWriteOneOutbound()"]
  300cabef_b042_697f_5623_37ce249f504d["EmbeddedChannelTest"]
  f1b7ba5e_bd17_e61e_e2e3_524bbe1a06d1 -->|defined in| 300cabef_b042_697f_5623_37ce249f504d
  4fc8a753_5665_2ca5_69db_dc1006272b05["close()"]
  f1b7ba5e_bd17_e61e_e2e3_524bbe1a06d1 -->|calls| 4fc8a753_5665_2ca5_69db_dc1006272b05
  style f1b7ba5e_bd17_e61e_e2e3_524bbe1a06d1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java lines 494–523

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

        EmbeddedChannel channel = new EmbeddedChannel(new ChannelOutboundHandlerAdapter() {
            @Override
            public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
                ctx.write(msg, promise);
                latch.countDown();
            }

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

        // This shouldn't trigger a #flush()
        channel.writeOneOutbound("Hello, Netty!");

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

        channel.close().syncUninterruptibly();

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

Domain

Subdomains

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free