use of org.apache.qpid.server.protocol.v0_10.transport.ReplyTo in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testReplyToConversionWhenBindingURLFormatIsUsed2.
public void testReplyToConversionWhenBindingURLFormatIsUsed2() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String replyTo = "direct://amq.direct//queue_name";
basicContentHeaderProperties.setReplyTo(replyTo);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected reply-to exchange", "amq.direct", messageProperties.getReplyTo().getExchange());
assertEquals("Unexpected reply-to routing-key", "queue_name", messageProperties.getReplyTo().getRoutingKey());
}
use of org.apache.qpid.server.protocol.v0_10.transport.ReplyTo in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testReplyToConversionWhenRoutingKeySpecified.
public void testReplyToConversionWhenRoutingKeySpecified() {
final String routingKey = "test_routing_key";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setReplyTo(new ReplyTo(null, routingKey));
MessageTransferMessage message = createTestMessage(messageProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected reply-to", routingKey, convertedMessage.getMessageHeader().getReplyTo());
}
use of org.apache.qpid.server.protocol.v0_10.transport.ReplyTo in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testReplyToConversionWhenExchangeAndRoutingKeyAreNull.
public void testReplyToConversionWhenExchangeAndRoutingKeyAreNull() {
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setReplyTo(new ReplyTo(null, null));
MessageTransferMessage message = createTestMessage(messageProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertNull("Unexpected reply-to", convertedMessage.getMessageHeader().getReplyTo());
}
use of org.apache.qpid.server.protocol.v0_10.transport.ReplyTo in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testReplyToConversionWhenExchangeAndRoutingKeySpecified.
public void testReplyToConversionWhenExchangeAndRoutingKeySpecified() {
final String exchangeName = "amq.direct";
final String routingKey = "test_routing_key";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setReplyTo(new ReplyTo(exchangeName, routingKey));
MessageTransferMessage message = createTestMessage(messageProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
String expectedReplyTo = String.format("%s/%s", exchangeName, routingKey);
assertEquals("Unexpected reply-to", expectedReplyTo, convertedMessage.getMessageHeader().getReplyTo());
}
use of org.apache.qpid.server.protocol.v0_10.transport.ReplyTo in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testReplyToConversionWhenExchangeIsEmptyStringAndRoutingKeySpecified.
public void testReplyToConversionWhenExchangeIsEmptyStringAndRoutingKeySpecified() {
final String routingKey = "test_routing_key";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setReplyTo(new ReplyTo("", routingKey));
MessageTransferMessage message = createTestMessage(messageProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected reply-to", routingKey, convertedMessage.getMessageHeader().getReplyTo());
}
Aggregations