use of javax.jms.Destination in project spring-framework by spring-projects.
the class JmsMessagingTemplateTests method convertDestinationResolutionExceptionOnReceive.
@Test
public void convertDestinationResolutionExceptionOnReceive() {
Destination destination = new Destination() {
};
willThrow(DestinationResolutionException.class).given(jmsTemplate).receive(destination);
thrown.expect(org.springframework.messaging.core.DestinationResolutionException.class);
messagingTemplate.receive(destination);
}
use of javax.jms.Destination in project spring-framework by spring-projects.
the class JmsMessagingTemplateTests method receive.
@Test
public void receive() {
Destination destination = new Destination() {
};
javax.jms.Message jmsMessage = createJmsTextMessage();
given(jmsTemplate.receive(destination)).willReturn(jmsMessage);
Message<?> message = messagingTemplate.receive(destination);
verify(jmsTemplate).receive(destination);
assertTextMessage(message);
}
use of javax.jms.Destination in project spring-framework by spring-projects.
the class JmsMessagingTemplateTests method convertSendAndReceivePayload.
@Test
public void convertSendAndReceivePayload() throws JMSException {
Destination destination = new Destination() {
};
javax.jms.Message replyJmsMessage = createJmsTextMessage("My reply");
given(jmsTemplate.sendAndReceive(eq(destination), any())).willReturn(replyJmsMessage);
String reply = messagingTemplate.convertSendAndReceive(destination, "my Payload", String.class);
verify(jmsTemplate, times(1)).sendAndReceive(eq(destination), any());
assertEquals("My reply", reply);
}
use of javax.jms.Destination in project spring-framework by spring-projects.
the class JmsMessagingTemplateTests method sendDefaultDestination.
@Test
public void sendDefaultDestination() {
Destination destination = new Destination() {
};
messagingTemplate.setDefaultDestination(destination);
Message<String> message = createTextMessage();
messagingTemplate.send(message);
verify(jmsTemplate).send(eq(destination), messageCreator.capture());
assertTextMessage(messageCreator.getValue());
}
use of javax.jms.Destination in project spring-framework by spring-projects.
the class JmsMessagingTemplateTests method receiveAndConvert.
@Test
public void receiveAndConvert() {
Destination destination = new Destination() {
};
javax.jms.Message jmsMessage = createJmsTextMessage("my Payload");
given(jmsTemplate.receive(destination)).willReturn(jmsMessage);
String payload = messagingTemplate.receiveAndConvert(destination, String.class);
assertEquals("my Payload", payload);
verify(jmsTemplate).receive(destination);
}
Aggregations