testLifeCycleAwareness() — netty Function Reference
Architecture documentation for the testLifeCycleAwareness() function in DefaultChannelPipelineTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 947cc9a8_edbb_fa65_8230_7ec40336d22b["testLifeCycleAwareness()"] 666d912b_4166_a807_ed10_ba12f328a7b2["DefaultChannelPipelineTest"] 947cc9a8_edbb_fa65_8230_7ec40336d22b -->|defined in| 666d912b_4166_a807_ed10_ba12f328a7b2 1d577730_98cf_e645_a0bd_8e177a3273f3["setUp()"] 947cc9a8_edbb_fa65_8230_7ec40336d22b -->|calls| 1d577730_98cf_e645_a0bd_8e177a3273f3 41eab696_55d4_75d1_b6f9_8d86ed3b3552["LifeCycleAwareTestHandler()"] 947cc9a8_edbb_fa65_8230_7ec40336d22b -->|calls| 41eab696_55d4_75d1_b6f9_8d86ed3b3552 36fce318_f10e_2b70_4def_d189ac0af1ed["execute()"] 947cc9a8_edbb_fa65_8230_7ec40336d22b -->|calls| 36fce318_f10e_2b70_4def_d189ac0af1ed 2d2a762a_b2a7_b92f_c9a9_231778acb218["run()"] 947cc9a8_edbb_fa65_8230_7ec40336d22b -->|calls| 2d2a762a_b2a7_b92f_c9a9_231778acb218 a64561de_3c3b_0ae5_f2de_108a7532122a["validate()"] 947cc9a8_edbb_fa65_8230_7ec40336d22b -->|calls| a64561de_3c3b_0ae5_f2de_108a7532122a style 947cc9a8_edbb_fa65_8230_7ec40336d22b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java lines 683–731
@Test
@Timeout(value = 10000, unit = TimeUnit.MILLISECONDS)
public void testLifeCycleAwareness() throws Exception {
setUp();
ChannelPipeline p = self.pipeline();
final List<LifeCycleAwareTestHandler> handlers = new ArrayList<LifeCycleAwareTestHandler>();
final int COUNT = 20;
final CountDownLatch addLatch = new CountDownLatch(COUNT);
for (int i = 0; i < COUNT; i++) {
final LifeCycleAwareTestHandler handler = new LifeCycleAwareTestHandler("handler-" + i);
// Add handler.
p.addFirst(handler.name, handler);
self.eventLoop().execute(new Runnable() {
@Override
public void run() {
// Validate handler life-cycle methods called.
handler.validate(true, false);
// Store handler into the list.
handlers.add(handler);
addLatch.countDown();
}
});
}
addLatch.await();
// Change the order of remove operations over all handlers in the pipeline.
Collections.shuffle(handlers);
final CountDownLatch removeLatch = new CountDownLatch(COUNT);
for (final LifeCycleAwareTestHandler handler : handlers) {
assertSame(handler, p.remove(handler.name));
self.eventLoop().execute(new Runnable() {
@Override
public void run() {
// Validate handler life-cycle methods called.
handler.validate(true, true);
removeLatch.countDown();
}
});
}
removeLatch.await();
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testLifeCycleAwareness() do?
testLifeCycleAwareness() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java.
Where is testLifeCycleAwareness() defined?
testLifeCycleAwareness() is defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java at line 683.
What does testLifeCycleAwareness() call?
testLifeCycleAwareness() calls 5 function(s): LifeCycleAwareTestHandler, execute, run, setUp, validate.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free