use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testContentEncodingConversion.
public void testContentEncodingConversion() {
String contentEncoding = "my-test-encoding";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setContentEncoding(contentEncoding);
MessageTransferMessage message = createTestMessage(new DeliveryProperties(), messageProperties, new byte[] { (byte) 1 }, 0);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected content encoding", contentEncoding, properties.getContentEncoding().toString());
}
use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test 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 Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Header header = convertedMessage.getHeaderSection().getValue();
assertEquals("Unexpected TTL", ttl, header.getTtl().longValue());
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertNull("Unexpected expiration", properties.getAbsoluteExpiryTime());
}
use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testPriorityConversion.
public void testPriorityConversion() {
final byte priority = 5;
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setPriority(MessageDeliveryPriority.get(priority));
MessageTransferMessage message = createTestMessage(deliveryProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Header header = convertedMessage.getHeaderSection().getValue();
assertEquals("Unexpected priority", priority, header.getPriority().byteValue());
}
use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testTimestampConversion.
public void testTimestampConversion() {
final DeliveryProperties deliveryProperties = new DeliveryProperties();
final long timestamp = System.currentTimeMillis() - 1000;
deliveryProperties.setTimestamp(timestamp);
MessageTransferMessage message = createTestMessage(deliveryProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected creation timestamp", timestamp, properties.getCreationTime().getTime());
}
use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testArrivalTimeConversion.
public void testArrivalTimeConversion() {
final long timestamp = System.currentTimeMillis() - 1000;
MessageTransferMessage message = createTestMessage(new DeliveryProperties(), new MessageProperties(), null, timestamp);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected creation timestamp", timestamp, properties.getCreationTime().getTime());
}
Aggregations