use of com.nokia.dempsy.container.mocks.ContainerTestMessage in project Dempsy by Dempsy.
the class TestMpContainer method testMtInvokeOutput.
@Test
public void testMtInvokeOutput() throws Exception {
final int numInstances = 20;
final int concurrency = 5;
container.setConcurrency(concurrency);
for (int i = 0; i < numInstances; i++) inputQueue.put(serializer.serialize(new ContainerTestMessage("foo" + i)));
for (int i = 0; i < numInstances; i++) assertNotNull(outputQueue.poll(baseTimeoutMillis, TimeUnit.MILLISECONDS));
assertEquals("number of MP instances", numInstances, container.getProcessorCount());
assertTrue("queue is empty", outputQueue.isEmpty());
container.outputPass();
for (int i = 0; i < numInstances; i++) assertNotNull(serializer.deserialize((byte[]) outputQueue.poll(1000, TimeUnit.MILLISECONDS)));
assertEquals("no more messages in queue", 0, outputQueue.size());
}
Aggregations