testThrowInExceptionCaught() — netty Function Reference
Architecture documentation for the testThrowInExceptionCaught() function in DefaultChannelPipelineTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 48a8e24e_c1b6_dcf1_84e3_ee1660109d73["testThrowInExceptionCaught()"] 666d912b_4166_a807_ed10_ba12f328a7b2["DefaultChannelPipelineTest"] 48a8e24e_c1b6_dcf1_84e3_ee1660109d73 -->|defined in| 666d912b_4166_a807_ed10_ba12f328a7b2 36fce318_f10e_2b70_4def_d189ac0af1ed["execute()"] 48a8e24e_c1b6_dcf1_84e3_ee1660109d73 -->|calls| 36fce318_f10e_2b70_4def_d189ac0af1ed 2d2a762a_b2a7_b92f_c9a9_231778acb218["run()"] 48a8e24e_c1b6_dcf1_84e3_ee1660109d73 -->|calls| 2d2a762a_b2a7_b92f_c9a9_231778acb218 a12a2410_e438_f512_b8d3_96d804c10f97["channelReadComplete()"] 48a8e24e_c1b6_dcf1_84e3_ee1660109d73 -->|calls| a12a2410_e438_f512_b8d3_96d804c10f97 0734e696_bf2a_45af_707c_9731756d1f7d["close()"] 48a8e24e_c1b6_dcf1_84e3_ee1660109d73 -->|calls| 0734e696_bf2a_45af_707c_9731756d1f7d 8c52b958_e400_144f_b4f2_e60153ac0d1a["exceptionCaught()"] 48a8e24e_c1b6_dcf1_84e3_ee1660109d73 -->|calls| 8c52b958_e400_144f_b4f2_e60153ac0d1a style 48a8e24e_c1b6_dcf1_84e3_ee1660109d73 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java lines 355–392
@Test
@Timeout(value = 3000, unit = TimeUnit.MILLISECONDS)
public void testThrowInExceptionCaught() throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
final AtomicInteger counter = new AtomicInteger();
Channel channel = new LocalChannel();
try {
group.register(channel).syncUninterruptibly();
channel.pipeline().addLast(new ChannelInboundHandlerAdapter() {
class TestException extends Exception { }
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
throw new TestException();
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (cause instanceof TestException) {
ctx.executor().execute(new Runnable() {
@Override
public void run() {
latch.countDown();
}
});
}
counter.incrementAndGet();
throw new Exception();
}
});
channel.pipeline().fireChannelReadComplete();
latch.await();
assertEquals(1, counter.get());
} finally {
channel.close().syncUninterruptibly();
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testThrowInExceptionCaught() do?
testThrowInExceptionCaught() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java.
Where is testThrowInExceptionCaught() defined?
testThrowInExceptionCaught() is defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java at line 355.
What does testThrowInExceptionCaught() call?
testThrowInExceptionCaught() calls 5 function(s): channelReadComplete, close, exceptionCaught, execute, run.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free