added test case and fix for JMSType header

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@382086 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-01 17:19:28 +00:00
parent b5bba09207
commit 2f6054959a
2 changed files with 8 additions and 0 deletions

View File

@ -100,6 +100,10 @@ class Send implements StompCommand {
if (priority != null) { if (priority != null) {
msg.setJMSPriority(asInt(priority)); msg.setJMSPriority(asInt(priority));
} }
Object type = headers.remove(Stomp.Headers.Send.TYPE);
if (type != null) {
msg.setJMSType((String) type);
}
msg.setJMSReplyTo(DestinationNamer.convert((String) headers.remove(Stomp.Headers.Send.REPLY_TO))); msg.setJMSReplyTo(DestinationNamer.convert((String) headers.remove(Stomp.Headers.Send.REPLY_TO)));

View File

@ -204,6 +204,8 @@ public class StompTest extends CombinationTestSupport {
frame = frame =
"SEND\n" + "SEND\n" +
"correlation-id:c123\n" + "correlation-id:c123\n" +
"priority:3\n" +
"type:t345\n" +
"JMSXGroupID:abc\n" + "JMSXGroupID:abc\n" +
"foo:abc\n" + "foo:abc\n" +
"bar:123\n" + "bar:123\n" +
@ -217,6 +219,8 @@ public class StompTest extends CombinationTestSupport {
assertNotNull(message); assertNotNull(message);
assertEquals("Hello World", message.getText()); assertEquals("Hello World", message.getText());
assertEquals("JMSCorrelationID", "c123", message.getJMSCorrelationID()); assertEquals("JMSCorrelationID", "c123", message.getJMSCorrelationID());
assertEquals("getJMSType", "t345", message.getJMSType());
assertEquals("getJMSPriority", 3, message.getJMSPriority());
assertEquals("foo", "abc", message.getStringProperty("foo")); assertEquals("foo", "abc", message.getStringProperty("foo"));
assertEquals("bar", "123", message.getStringProperty("bar")); assertEquals("bar", "123", message.getStringProperty("bar"));