use of javax.jms.Session in project spring-framework by spring-projects.
the class MethodJmsListenerEndpointTests method resolveConvertedPayload.
@Test
public void resolveConvertedPayload() throws JMSException {
MessagingMessageListenerAdapter listener = createDefaultInstance(Integer.class);
Session session = mock(Session.class);
listener.onMessage(createSimpleJmsTextMessage("33"), session);
assertDefaultListenerMethodInvocation();
}
use of javax.jms.Session in project spring-framework by spring-projects.
the class MethodJmsListenerEndpointTests method resolveMessageAndSession.
@Test
public void resolveMessageAndSession() throws JMSException {
MessagingMessageListenerAdapter listener = createDefaultInstance(javax.jms.Message.class, Session.class);
Session session = mock(Session.class);
listener.onMessage(createSimpleJmsTextMessage("test"), session);
assertDefaultListenerMethodInvocation();
}
use of javax.jms.Session in project spring-framework by spring-projects.
the class DynamicDestinationResolverTests method resolveWithPointToPointQueueSession.
@Test
public void resolveWithPointToPointQueueSession() throws Exception {
Queue expectedDestination = new StubQueue();
Session session = mock(QueueSession.class);
given(session.createQueue(DESTINATION_NAME)).willReturn(expectedDestination);
testResolveDestination(session, expectedDestination, false);
}
use of javax.jms.Session in project spring-framework by spring-projects.
the class DynamicDestinationResolverTests method resolveWithPointToPointVanillaSession.
@Test
public void resolveWithPointToPointVanillaSession() throws Exception {
Queue expectedDestination = new StubQueue();
Session session = mock(Session.class);
given(session.createQueue(DESTINATION_NAME)).willReturn(expectedDestination);
testResolveDestination(session, expectedDestination, false);
}
use of javax.jms.Session in project spring-framework by spring-projects.
the class JndiDestinationResolverTests method testDoesNotUseCacheIfCachingIsTurnedOff.
@Test
public void testDoesNotUseCacheIfCachingIsTurnedOff() throws Exception {
Session session = mock(Session.class);
CountingCannedJndiDestinationResolver resolver = new CountingCannedJndiDestinationResolver();
resolver.setCache(false);
Destination destination = resolver.resolveDestinationName(session, DESTINATION_NAME, true);
assertNotNull(destination);
assertSame(DESTINATION, destination);
assertEquals(1, resolver.getCallCount());
destination = resolver.resolveDestinationName(session, DESTINATION_NAME, true);
assertNotNull(destination);
assertSame(DESTINATION, destination);
assertEquals(2, resolver.getCallCount());
}
Aggregations