git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1362091 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-07-16 15:27:54 +00:00
parent cb27f9148d
commit 8aadc4b9ec
2 changed files with 36 additions and 1 deletions

View File

@ -208,7 +208,10 @@ public class StompWireFormat implements WireFormat {
ByteSequence nameSeq = stream.toByteSequence();
String name = new String(nameSeq.getData(), nameSeq.getOffset(), nameSeq.getLength(), "UTF-8");
String value = decodeHeader(headerLine);
headers.put(name, value);
if (!headers.containsKey(name)) {
headers.put(name, value);
}
} catch (Exception e) {
throw new ProtocolException("Unable to parser header line [" + line + "]", true);
}

View File

@ -621,6 +621,38 @@ public class Stomp11Test extends CombinationTestSupport {
assertEquals("JMSXGroupID", "abc", message.getStringProperty("JMSXGroupID"));
ActiveMQTextMessage amqMessage = (ActiveMQTextMessage)message;
assertEquals("GroupID", "abc", amqMessage.getGroupID());
frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
}
public void testSendMessageWithRepeatedEntries() throws Exception {
MessageConsumer consumer = session.createConsumer(queue);
String frame = "CONNECT\n" + "login:system\n" + "passcode:manager\n" +
"accept-version:1.1" + "\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
frame = stompConnection.receiveFrame();
assertTrue(frame.startsWith("CONNECTED"));
frame = "SEND\n" +
"value:newest" + "\n" +
"value:older" + "\n" +
"value:oldest" + "\n" +
"destination:/queue/" + getQueueName() +
"\n\n" + "Hello World" + Stomp.NULL;
stompConnection.sendFrame(frame);
TextMessage message = (TextMessage)consumer.receive(2500);
assertNotNull(message);
assertEquals("Hello World", message.getText());
assertEquals("newest", message.getStringProperty("value"));
frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
}
public void testSubscribeWithMessageSentWithEncodedProperties() throws Exception {