use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test 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 AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
String expectedReplyTo = String.format("direct:////?routingkey='%s'", routingKey);
assertEquals("Unexpected reply-to", expectedReplyTo, properties.getReplyTo().toString());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testContentTypeConversion.
public void testContentTypeConversion() {
String contentType = "test-content-type";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setContentType(contentType);
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected content type", contentType, properties.getContentType().toString());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testUserIdConversionWhenNotUtf8.
public void testUserIdConversionWhenNotUtf8() {
final byte[] userId = new byte[] { (byte) 0xc3, 0x28 };
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setUserId(userId);
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertTrue("Unexpected user-id", Arrays.equals(userId, properties.getUserId().getBytes()));
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testCorrelationIdConversionWhenNotString.
public void testCorrelationIdConversionWhenNotString() {
final byte[] correlationId = new byte[] { (byte) 0xc3, 0x28 };
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setCorrelationId(correlationId);
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertTrue("Unexpected correlationId", Arrays.equals(correlationId, properties.getCorrelationId().getBytes()));
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testArrivalTimeConversion.
public void testArrivalTimeConversion() {
final long timestamp = System.currentTimeMillis() - 1000;
MessageTransferMessage message = createTestMessage(new DeliveryProperties(), new MessageProperties(), null, timestamp);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected creation timestamp", timestamp, properties.getTimestamp());
}
Aggregations