use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testPersistentDeliveryModeConversion.
@Test
public void testPersistentDeliveryModeConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setDeliveryMode(BasicContentHeaderProperties.PERSISTENT);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected deliveryMode", MessageDeliveryMode.PERSISTENT, deliveryProperties.getDeliveryMode());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testCorrelationIdConversion.
@Test
public void testCorrelationIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String correlationId = "testCorrelationId";
basicContentHeaderProperties.setCorrelationId(AMQShortString.valueOf(correlationId));
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected correlationId", correlationId, new String(messageProperties.getCorrelationId(), 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_0_10Test method testPublishInfoRoutingKeyConversion.
@Test
public void testPublishInfoRoutingKeyConversion() {
final String testRoutingKey = "testRoutingKey";
AMQMessage message = createTestMessage(new BasicContentHeaderProperties());
message.getMessagePublishInfo().setRoutingKey(AMQShortString.valueOf(testRoutingKey));
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final DeliveryProperties deliveryProperties = convertedMessage.getStoredMessage().getMetaData().getDeliveryProperties();
assertEquals("Unexpected routing-key", testRoutingKey, deliveryProperties.getRoutingKey());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_0_10Test method testUserIdConversion.
@Test
public void testUserIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String userId = "test-userId";
basicContentHeaderProperties.setUserId(userId);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected user-id", userId, new String(messageProperties.getUserId(), 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_0_10Test method testContentTypeConversion.
@Test
public void testContentTypeConversion() {
String contentType = "test-content-type";
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setContentType(contentType);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
assertEquals("Unexpected content type", contentType, messageProperties.getContentType());
}
Aggregations