Java Code Examples for org.springframework.jms.support.JmsMessageHeaderAccessor

The following examples show how to use org.springframework.jms.support.JmsMessageHeaderAccessor. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
public void resolveJmsMessageHeaderAccessor() throws JMSException {
	MessagingMessageListenerAdapter listener = createDefaultInstance(JmsMessageHeaderAccessor.class);

	Session session = mock(Session.class);
	StubTextMessage message = createSimpleJmsTextMessage("my payload");
	message.setBooleanProperty("customBoolean", true);
	message.setJMSPriority(9);
	listener.onMessage(message, session);
	assertDefaultListenerMethodInvocation();
}
 
Example 2
@Test
public void resolveJmsMessageHeaderAccessor() throws JMSException {
	MessagingMessageListenerAdapter listener = createDefaultInstance(JmsMessageHeaderAccessor.class);

	Session session = mock(Session.class);
	StubTextMessage message = createSimpleJmsTextMessage("my payload");
	message.setBooleanProperty("customBoolean", true);
	message.setJMSPriority(9);
	listener.onMessage(message, session);
	assertDefaultListenerMethodInvocation();
}
 
Example 3
@Test
public void resolveJmsMessageHeaderAccessor() throws JMSException {
	MessagingMessageListenerAdapter listener = createDefaultInstance(JmsMessageHeaderAccessor.class);

	Session session = mock(Session.class);
	StubTextMessage message = createSimpleJmsTextMessage("my payload");
	message.setBooleanProperty("customBoolean", true);
	message.setJMSPriority(9);
	listener.onMessage(message, session);
	assertDefaultListenerMethodInvocation();
}
 
Example 4
public void resolveJmsMessageHeaderAccessor(JmsMessageHeaderAccessor headers) {
	this.invocations.put("resolveJmsMessageHeaderAccessor", true);
	assertNotNull("MessageHeaders not injected", headers);
	assertEquals("Missing JMS message priority header", Integer.valueOf(9), headers.getPriority());
	assertEquals("Missing custom header", true, headers.getHeader("customBoolean"));
}
 
Example 5
public void resolveJmsMessageHeaderAccessor(JmsMessageHeaderAccessor headers) {
	this.invocations.put("resolveJmsMessageHeaderAccessor", true);
	assertNotNull("MessageHeaders not injected", headers);
	assertEquals("Missing JMS message priority header", Integer.valueOf(9), headers.getPriority());
	assertEquals("Missing custom header", true, headers.getHeader("customBoolean"));
}
 
Example 6
public void resolveJmsMessageHeaderAccessor(JmsMessageHeaderAccessor headers) {
	invocations.put("resolveJmsMessageHeaderAccessor", true);
	assertNotNull("MessageHeaders not injected", headers);
	assertEquals("Missing JMS message priority header", Integer.valueOf(9), headers.getPriority());
	assertEquals("Missing custom header", true, headers.getHeader("customBoolean"));
}