use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_10Test method testMessageIdUnsignedLongConversion.
public void testMessageIdUnsignedLongConversion() {
final UnsignedLong messageId = UnsignedLong.valueOf(-1);
Properties properties = new Properties();
properties.setMessageId(messageId);
Message_1_0 message = createTestMessage(properties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected messageId", UUID.nameUUIDFromBytes(longToBytes(messageId.longValue())), messageProperties.getMessageId());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_10Test method testSubjectDoesNoReplaceApplicationPropertyXJMSType.
public void testSubjectDoesNoReplaceApplicationPropertyXJMSType() {
final String subject = "testSubject";
Properties properties = new Properties();
properties.setSubject(subject);
final String jmsType = "testJmsType";
Map<String, Object> applicationPropertiesMap = Collections.singletonMap("x-jms-type", jmsType);
ApplicationProperties applicationProperties = new ApplicationProperties(applicationPropertiesMap);
Message_1_0 message = createTestMessage(new Header(), new DeliveryAnnotations(Collections.emptyMap()), new MessageAnnotations(Collections.emptyMap()), properties, applicationProperties, 0, null);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
final Map<String, Object> headers = messageProperties.getApplicationHeaders();
assertEquals("Unexpected qpid.subject is missing from headers", subject, headers.get("qpid.subject"));
assertEquals("Unexpected type", jmsType, headers.get("x-jms-type"));
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected routing-key", subject, deliveryProperties.getRoutingKey());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_10Test method testMessageIdByteArrayConversion.
public void testMessageIdByteArrayConversion() {
final byte[] messageId = "testMessageId".getBytes(UTF_8);
Properties properties = new Properties();
properties.setMessageId(messageId);
Message_1_0 message = createTestMessage(properties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected messageId", UUID.nameUUIDFromBytes(messageId), messageProperties.getMessageId());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_10Test method testGroupSequenceConversion.
public void testGroupSequenceConversion() {
int testGroupSequence = 1;
Properties properties = new Properties();
properties.setGroupSequence(UnsignedInteger.valueOf(testGroupSequence));
Message_1_0 message = createTestMessage(properties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
final Map<String, Object> applicationHeaders = messageProperties.getApplicationHeaders();
assertEquals("Unexpected group-id", testGroupSequence, applicationHeaders.get("JMSXGroupSeq"));
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_10Test method testMessageIdUuidAsStringConversion.
public void testMessageIdUuidAsStringConversion() {
final UUID messageId = UUID.randomUUID();
Properties properties = new Properties();
properties.setMessageId(messageId.toString());
Message_1_0 message = createTestMessage(properties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected messageId", messageId, messageProperties.getMessageId());
}
Aggregations