Search in sources :

Example 56 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_0_8Test method testDiscardUnroutableFalseConversion.

public void testDiscardUnroutableFalseConversion() {
    final boolean discardUnroutable = false;
    final DeliveryProperties deliveryProperties = new DeliveryProperties();
    deliveryProperties.setDiscardUnroutable(discardUnroutable);
    MessageTransferMessage message = createTestMessage(deliveryProperties);
    final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    MessagePublishInfo messagePublishInfo = convertedMessage.getMessagePublishInfo();
    assertEquals("Unexpected mandatory flag", !discardUnroutable, messagePublishInfo.isMandatory());
}
Also used : MessagePublishInfo(org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo) MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 57 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_0_8Test method testImmediateFalseConversion.

public void testImmediateFalseConversion() {
    final boolean immediate = false;
    final DeliveryProperties deliveryProperties = new DeliveryProperties();
    deliveryProperties.setImmediate(immediate);
    MessageTransferMessage message = createTestMessage(deliveryProperties);
    final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    MessagePublishInfo messagePublishInfo = convertedMessage.getMessagePublishInfo();
    assertEquals("Unexpected immediate flag", immediate, messagePublishInfo.isImmediate());
}
Also used : MessagePublishInfo(org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo) MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 58 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_0_8Test method testPersistentDeliveryModeConversion.

public void testPersistentDeliveryModeConversion() {
    MessageDeliveryMode deliveryMode = MessageDeliveryMode.PERSISTENT;
    final DeliveryProperties deliveryProperties = new DeliveryProperties();
    deliveryProperties.setDeliveryMode(deliveryMode);
    MessageTransferMessage message = createTestMessage(deliveryProperties);
    final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
    assertEquals("Unexpected deliveryMode", deliveryMode.getValue(), properties.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) MessageDeliveryMode(org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 59 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_0_8Test method testExchangeConversion.

public void testExchangeConversion() {
    final String testExchange = "testExchange";
    final DeliveryProperties deliveryProperties = new DeliveryProperties();
    deliveryProperties.setExchange(testExchange);
    MessageTransferMessage message = createTestMessage(deliveryProperties);
    final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    MessagePublishInfo messagePublishInfo = convertedMessage.getMessagePublishInfo();
    assertEquals("Unexpected exchange", testExchange, messagePublishInfo.getExchange().toString());
}
Also used : MessagePublishInfo(org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo) MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 60 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_0_8Test 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 AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
    assertEquals("Unexpected expiration", expiration, properties.getExpiration());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) 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)

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