use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties 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.transport.DeliveryProperties 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.DeliveryProperties 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());
}
use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testPriorityConversion.
public void testPriorityConversion() {
final byte priority = 7;
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setPriority(MessageDeliveryPriority.get(priority));
MessageTransferMessage message = createTestMessage(deliveryProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected priority", priority, convertedMessage.getMessageHeader().getPriority());
}
use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testInitialRoutingAddressConversion.
public void testInitialRoutingAddressConversion() {
final String testExchange = "testExchange";
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setExchange(testExchange);
final String testRoutingKey = "testRoutingKey";
deliveryProperties.setRoutingKey(testRoutingKey);
MessageTransferMessage message = createTestMessage(deliveryProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected initial routing address", testRoutingKey, convertedMessage.getInitialRoutingAddress());
}
Aggregations