use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testUuidMessageIdConversion.
public void testUuidMessageIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final UUID messageId = UUID.randomUUID();
basicContentHeaderProperties.setMessageId(messageId.toString());
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected messageId", messageId, messageProperties.getMessageId());
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testTimestampConversion.
public void testTimestampConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final long timestamp = System.currentTimeMillis() - 10000;
basicContentHeaderProperties.setTimestamp(timestamp);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected timestamp", timestamp, deliveryProperties.getTimestamp());
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testContentLengthConversion.
public void testContentLengthConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final byte[] content = { (byte) 1, (byte) 2 };
AMQMessage message = createTestMessage(basicContentHeaderProperties, content, 0);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected content-length", content.length, messageProperties.getContentLength());
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testPersistentDeliveryModeConversion.
public void testPersistentDeliveryModeConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setDeliveryMode(BasicContentHeaderProperties.PERSISTENT);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected deliveryMode", MessageDeliveryMode.PERSISTENT, deliveryProperties.getDeliveryMode());
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testTtlConversion.
public void testTtlConversion() {
long timestamp = System.currentTimeMillis();
int ttl = 100000;
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setTtl(ttl);
MessageTransferMessage message = createTestMessage(deliveryProperties, new MessageProperties(), null, timestamp);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected expiration", timestamp + ttl, convertedMessage.getMessageHeader().getExpiration());
}
Aggregations