ActiveMQProducerResource extends AbstractActiveMQClientResource { public void sendMessage(ClientMessage message) { try { producer.send(message); } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Failed to send message to %s", producer.getAddress().toString()), amqEx); } } protected  ActiveMQProducerResource(String url, String username, String password); protected  ActiveMQProducerResource(String url); protected  ActiveMQProducerResource(ServerLocator serverLocator, String username, String password); protected  ActiveMQProducerResource(ServerLocator serverLocator);  ActiveMQProducerResource(String url, String address, String username, String password);  ActiveMQProducerResource(String url, String address);  ActiveMQProducerResource(String url, SimpleString address, String username, String password);  ActiveMQProducerResource(String url, SimpleString address);  ActiveMQProducerResource(ServerLocator serverLocator, String address, String username, String password);  ActiveMQProducerResource(ServerLocator serverLocator, String address);  ActiveMQProducerResource(ServerLocator serverLocator, SimpleString address, String username, String password);  ActiveMQProducerResource(ServerLocator serverLocator, SimpleString address); boolean isUseDurableMessage(); void setUseDurableMessage(boolean useDurableMessage); ClientMessage createMessage(); ClientMessage createMessage(byte[] body); ClientMessage createMessage(String body); ClientMessage createMessage(Map<String, Object> properties); ClientMessage createMessage(byte[] body, Map<String, Object> properties); ClientMessage createMessage(String body, Map<String, Object> properties); void sendMessage(ClientMessage message); ClientMessage sendMessage(byte[] body); ClientMessage sendMessage(String body); ClientMessage sendMessage(Map<String, Object> properties); ClientMessage sendMessage(byte[] body, Map<String, Object> properties); ClientMessage sendMessage(String body, Map<String, Object> properties);  }
@Test public void testSendBytes() throws Exception { sent = producer.sendMessage(TEST_BODY.getBytes()); }
@Test public void testSendString() throws Exception { sent = producer.sendMessage(TEST_BODY); }
@Test public void testSendBytesAndProperties() throws Exception { sent = producer.sendMessage(TEST_BODY.getBytes(), TEST_PROPERTIES); }
@Test public void testSendStringAndProperties() throws Exception { sent = producer.sendMessage(TEST_BODY, TEST_PROPERTIES); }