@Override
public void onMessage(Message message)
{
try
{
Command command = JmsMessageAdaptor.messageToCommand(message);
LOGGER.debug("Test client received " + command);
commandList.add(command);
producer.send(JmsMessageAdaptor.commandToMessage(_session, new Response(CLIENT1, command.getType())));
}
catch(Exception e)
{
listenerException.set(e);
}
}
});
_controller.runAllTests();
assertCommandType(CommandType.CREATE_CONNECTION, commandList);
assertCommandType(CommandType.START_TEST, commandList);
assertCommandType(CommandType.TEAR_DOWN_TEST, commandList);
_controller.stopAllRegisteredClients();
assertCommandType(CommandType.STOP_CLIENT, commandList);
assertNull("Unexpected exception occured", listenerException.get());
Command command = commandList.poll(1l, TimeUnit.SECONDS);
assertNull("Unexpected command is received", command);
}