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 testExpirationConversion.
public void testExpirationConversion() {
long timestamp = System.currentTimeMillis();
int ttl = 100000;
final long expiration = timestamp + ttl;
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setExpiration(expiration);
MessageTransferMessage message = createTestMessage(deliveryProperties, new MessageProperties(), null, timestamp);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected expiration", expiration, 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 testExchangeConversion.
public void testExchangeConversion() {
final String testExchange = "testExchange";
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setExchange(testExchange);
MessageTransferMessage message = createTestMessage(deliveryProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected to", testExchange, convertedMessage.getTo());
}
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 testArrivalTimeConversion.
public void testArrivalTimeConversion() {
final long timestamp = System.currentTimeMillis() - 1000;
MessageTransferMessage message = createTestMessage(new DeliveryProperties(), new MessageProperties(), null, timestamp);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected creation timestamp", timestamp, convertedMessage.getMessageHeader().getTimestamp());
}
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 testTimestampConversion.
public void testTimestampConversion() {
final DeliveryProperties deliveryProperties = new DeliveryProperties();
final long timestamp = System.currentTimeMillis() - 1000;
deliveryProperties.setTimestamp(timestamp);
MessageTransferMessage message = createTestMessage(deliveryProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected creation timestamp", timestamp, convertedMessage.getMessageHeader().getTimestamp());
}
use of org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties in project qpid-broker-j by apache.
the class PropertyConverter_Internal_to_v0_10Test method testToConversionWhenGlobalAddressIsKnown.
public void testToConversionWhenGlobalAddressIsKnown() throws IOException {
final String queueName = "testQueue";
final String prefix = "/testPrefix";
final String globalAddress = prefix + "/" + queueName;
InternalMessage message = createTestMessage(globalAddress);
final Queue<?> queue = mock(Queue.class);
when(queue.getName()).thenReturn(queueName);
when(_addressSpace.getLocalAddress(globalAddress)).thenReturn(queueName);
when(_addressSpace.getAttainedMessageDestination(queueName)).thenReturn(queue);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _addressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected exchange", "", deliveryProperties.getExchange());
assertEquals("Unexpected routing key", queueName, deliveryProperties.getRoutingKey());
}
Aggregations