public void runSizeTest(int size) throws Exception
{
CreateProducerCommand command = new CreateProducerCommand();
command.setMessageSize(size);
MessageProvider messageProvider = new MessageProvider(null);
Message message = messageProvider.nextMessage(_session, command);
assertNotNull("Message is not generated", message);
assertTrue("Wrong message type", message instanceof TextMessage);
TextMessage textMessage = (TextMessage)message;
String text = textMessage.getText();
assertNotNull("Message payload is not generated", text);