use of com.nokia.dempsy.messagetransport.tcp.TcpReceiver in project Dempsy by Dempsy.
the class TestDempsy method testTcpTransportExecutorConfigurationThroughApplication.
@Test
public void testTcpTransportExecutorConfigurationThroughApplication() throws Throwable {
ClassPathXmlApplicationContext actx = null;
DefaultDempsyExecutor executor = null;
try {
actx = new ClassPathXmlApplicationContext("testDempsy/Dempsy-IndividualClusterStart.xml", "testDempsy/Transport-TcpNoBatchingActx.xml", "testDempsy/ClusterInfo-LocalActx.xml", "testDempsy/Serializer-KryoActx.xml", "testDempsy/SimpleMultistageApplicationWithExecutorActx.xml");
actx.registerShutdownHook();
Dempsy dempsy = (Dempsy) actx.getBean("dempsy");
for (Dempsy.Application.Cluster cluster : dempsy.applications.get(0).appClusters) {
// get the receiver from the node
TcpReceiver r = (TcpReceiver) cluster.getNodes().get(0).receiver;
executor = (DefaultDempsyExecutor) TcpReceiverAccess.getExecutor(r);
assertEquals(123456, executor.getMaxNumberOfQueuedLimitedTasks());
assertTrue(executor.isRunning());
}
} finally {
try {
actx.stop();
} catch (Throwable th) {
}
try {
actx.destroy();
} catch (Throwable th) {
}
}
assertNotNull(executor);
assertTrue(!executor.isRunning());
}
Aggregations