Search in sources :

Example 26 with DeliveryProperties

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());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 27 with DeliveryProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)

Example 28 with DeliveryProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)

Example 29 with DeliveryProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)

Example 30 with DeliveryProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)

Aggregations

DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)81 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)54 MessageProperties (org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)39 Message_1_0 (org.apache.qpid.server.protocol.v1_0.Message_1_0)27 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)25 BasicContentHeaderProperties (org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)21 Properties (org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)20 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)17 Header (org.apache.qpid.server.protocol.v1_0.type.messaging.Header)16 Matchers.anyString (org.mockito.Matchers.anyString)16 AMQShortString (org.apache.qpid.server.protocol.v0_8.AMQShortString)14 ApplicationProperties (org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties)14 Header (org.apache.qpid.server.protocol.v0_10.transport.Header)10 MessagePublishInfo (org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo)7 Date (java.util.Date)5 MessageAnnotations (org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations)5 MessageMetaData_0_10 (org.apache.qpid.server.protocol.v0_10.MessageMetaData_0_10)4 MessageDeliveryMode (org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode)4 DeliveryAnnotations (org.apache.qpid.server.protocol.v1_0.type.messaging.DeliveryAnnotations)4 Method (org.apache.qpid.server.protocol.v0_10.transport.Method)3