use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testTypeConversion.
@Test
public void testTypeConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String type = "test-type";
basicContentHeaderProperties.setType(String.valueOf(type));
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected subject", type, properties.getSubject());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testPersistentDeliveryModeConversion.
@Test
public void testPersistentDeliveryModeConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setDeliveryMode(BasicContentHeaderProperties.PERSISTENT);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Header header = convertedMessage.getHeaderSection().getValue();
assertTrue("Unexpected durable header", header.getDurable());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testUserIdConversion.
@Test
public void testUserIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String userId = "test-userId";
basicContentHeaderProperties.setUserId(userId);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected user-id", userId, new String(properties.getUserId().getArray(), UTF_8));
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testReplyToConversionWhenBindingURLFormatIsUsed2.
@Test
public void testReplyToConversionWhenBindingURLFormatIsUsed2() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String replyTo = "direct://amq.direct//queue_name";
basicContentHeaderProperties.setReplyTo(replyTo);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected reply-to", "amq.direct/queue_name", properties.getReplyTo());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testReplyToConversionWhenExchangeSpecified.
@Test
public void testReplyToConversionWhenExchangeSpecified() {
final String exchangeName = "amq.direct";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setReplyTo(new ReplyTo(exchangeName, null));
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
String expectedReplyTo = String.format("direct://%s//", exchangeName);
assertEquals("Unexpected reply-to", expectedReplyTo, properties.getReplyTo().toString());
}
Aggregations