Search in sources :

Example 1 with MessageDeliveryMode

use of org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode in project qpid-broker-j by apache.

the class PropertyConverter_0_10_to_InternalTest method testPersistentDeliveryModeConversion.

public void testPersistentDeliveryModeConversion() {
    MessageDeliveryMode deliveryMode = MessageDeliveryMode.PERSISTENT;
    final DeliveryProperties deliveryProperties = new DeliveryProperties();
    deliveryProperties.setDeliveryMode(deliveryMode);
    MessageTransferMessage message = createTestMessage(deliveryProperties);
    final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    assertTrue("Unexpected persistence", convertedMessage.isPersistent());
    assertTrue("Unexpected persistence of meta data", convertedMessage.getStoredMessage().getMetaData().isPersistent());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) MessageDeliveryMode(org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode)

Example 2 with MessageDeliveryMode

use of org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode 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 3 with MessageDeliveryMode

use of org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode in project qpid-broker-j by apache.

the class PropertyConverter_0_10_to_0_8Test method testNonPersistentDeliveryModeConversion.

public void testNonPersistentDeliveryModeConversion() {
    MessageDeliveryMode deliveryMode = MessageDeliveryMode.NON_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 4 with MessageDeliveryMode

use of org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode in project qpid-broker-j by apache.

the class PropertyConverter_0_10_to_InternalTest method testNonPersistentDeliveryModeConversion.

public void testNonPersistentDeliveryModeConversion() {
    MessageDeliveryMode deliveryMode = MessageDeliveryMode.NON_PERSISTENT;
    final DeliveryProperties deliveryProperties = new DeliveryProperties();
    deliveryProperties.setDeliveryMode(deliveryMode);
    MessageTransferMessage message = createTestMessage(deliveryProperties);
    final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    assertFalse("Unexpected persistence", convertedMessage.isPersistent());
    assertFalse("Unexpected persistence of meta data", convertedMessage.getStoredMessage().getMetaData().isPersistent());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) MessageDeliveryMode(org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode)

Aggregations

DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)4 MessageDeliveryMode (org.apache.qpid.server.protocol.v0_10.transport.MessageDeliveryMode)4 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)2 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)2 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)2 BasicContentHeaderProperties (org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)2