assertEquals("Message payload size is incorrect", size, text.length());
}
public void testCreateMessageProviderAndSendMessage() throws Exception
{
final CreateMessageProviderCommand messageProviderCommand = new CreateMessageProviderCommand();
messageProviderCommand.setProviderName("test1");
Map<String, PropertyValue> messageProperties = new HashMap<String, PropertyValue>();
messageProperties.put("test", new SimplePropertyValue("testValue"));
messageProperties.put("priority", new SimplePropertyValue(new Integer(9)));
messageProviderCommand.setMessageProperties(messageProperties);
_delegate.createMessageProvider(messageProviderCommand);
final CreateProducerCommand producerCommand = new CreateProducerCommand();
producerCommand.setNumberOfMessages(1);
producerCommand.setDeliveryMode(DeliveryMode.PERSISTENT);
producerCommand.setPriority(6);
producerCommand.setParticipantName("test");
producerCommand.setMessageSize(10);
producerCommand.setSessionName("testSession");
producerCommand.setDestinationName(getTestQueueName());
producerCommand.setMessageProviderName(messageProviderCommand.getProviderName());
Session session = _connection.createSession(true, Session.SESSION_TRANSACTED);
_delegate.addConnection("name-does-not-matter", _connection);
_delegate.addSession(producerCommand.getSessionName(), session);
_delegate.createProducer(producerCommand);