testRegistrationAfterShutdown2() — netty Function Reference
Architecture documentation for the testRegistrationAfterShutdown2() function in SingleThreadEventLoopTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 44ddac65_fb81_534c_7516_e4ac94dec7ac["testRegistrationAfterShutdown2()"] 42a05bb6_77d1_5163_f1de_dc06e1ae82b0["SingleThreadEventLoopTest"] 44ddac65_fb81_534c_7516_e4ac94dec7ac -->|defined in| 42a05bb6_77d1_5163_f1de_dc06e1ae82b0 style 44ddac65_fb81_534c_7516_e4ac94dec7ac fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java lines 401–434
@Test
@Timeout(value = 10000, unit = TimeUnit.MILLISECONDS)
@SuppressWarnings("deprecation")
public void testRegistrationAfterShutdown2() throws Exception {
loopA.shutdown();
final CountDownLatch latch = new CountDownLatch(1);
Channel ch = new LocalChannel();
ChannelPromise promise = ch.newPromise();
promise.addListener(future -> latch.countDown());
// Disable logging temporarily.
Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
List<Appender<ILoggingEvent>> appenders = new ArrayList<Appender<ILoggingEvent>>();
for (Iterator<Appender<ILoggingEvent>> i = root.iteratorForAppenders(); i.hasNext();) {
Appender<ILoggingEvent> a = i.next();
appenders.add(a);
root.detachAppender(a);
}
try {
ChannelFuture f = loopA.register(promise);
f.awaitUninterruptibly();
assertFalse(f.isSuccess());
assertInstanceOf(RejectedExecutionException.class, f.cause());
// Ensure the listener was notified.
assertFalse(latch.await(1, TimeUnit.SECONDS));
assertFalse(ch.isOpen());
} finally {
for (Appender<ILoggingEvent> a: appenders) {
root.addAppender(a);
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testRegistrationAfterShutdown2() do?
testRegistrationAfterShutdown2() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java.
Where is testRegistrationAfterShutdown2() defined?
testRegistrationAfterShutdown2() is defined in transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java at line 401.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free