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 testPublishInfoExchangeConversion.
public void testPublishInfoExchangeConversion() {
final String testExchange = "testExchange";
AMQMessage message = createTestMessage(new BasicContentHeaderProperties());
message.getMessagePublishInfo().setExchange(AMQShortString.valueOf(testExchange));
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected exchange", testExchange, deliveryProperties.getExchange());
}
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 testNonPersistentDeliveryModeConversion.
public void testNonPersistentDeliveryModeConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setDeliveryMode(BasicContentHeaderProperties.NON_PERSISTENT);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected deliveryMode", MessageDeliveryMode.NON_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_8_to_0_10Test method testPublishInfoMandatoryFalseConversion.
public void testPublishInfoMandatoryFalseConversion() {
final boolean mandatory = false;
AMQMessage message = createTestMessage(new BasicContentHeaderProperties());
message.getMessagePublishInfo().setMandatory(mandatory);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected discard-unroutable flag", !mandatory, deliveryProperties.getDiscardUnroutable());
}
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 testContentEncodingConversion.
public void testContentEncodingConversion() {
String contentEncoding = "my-test-encoding";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setContentEncoding(contentEncoding);
MessageTransferMessage message = createTestMessage(new DeliveryProperties(), messageProperties, new byte[] { (byte) 1 }, 0);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected content encoding", contentEncoding, convertedMessage.getMessageHeader().getEncoding());
}
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 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());
}
Aggregations