use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testApplicationIdConversion.
public void testApplicationIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String applicationId = "testApplicationId";
basicContentHeaderProperties.setAppId(applicationId);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected applicationId", applicationId, new String(messageProperties.getAppId(), UTF_8));
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties 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.transport.MessageProperties 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.transport.MessageProperties 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());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testTtlTakesPrecedenceOverExpiration.
public void testTtlTakesPrecedenceOverExpiration() {
long timestamp = System.currentTimeMillis();
int ttl = 100000;
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setTtl(ttl);
deliveryProperties.setExpiration(timestamp + ttl + 10000);
MessageTransferMessage message = createTestMessage(deliveryProperties, new MessageProperties(), null, timestamp);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected expiration", timestamp + ttl, convertedMessage.getMessageHeader().getExpiration());
}
Aggregations