use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testJmsTypeConversion.
public void testJmsTypeConversion() {
final String type = "test-type";
final Map<String, Object> headers = Collections.singletonMap("x-jms-type", type);
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setApplicationHeaders(headers);
MessageTransferMessage message = createTestMessage(messageProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected subject", type, convertedMessage.getMessageHeader().getType());
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testApplicationIdConversion.
public void testApplicationIdConversion() {
String applicationId = "testAppId";
MessageProperties messageProperties = new MessageProperties();
messageProperties.setAppId(applicationId.getBytes(UTF_8));
MessageTransferMessage message = createTestMessage(messageProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected app-id", applicationId, convertedMessage.getMessageHeader().getAppId());
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testInitialRoutingAddressConversion.
public void testInitialRoutingAddressConversion() {
final String testExchange = "testExchange";
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setExchange(testExchange);
final String testRoutingKey = "testRoutingKey";
deliveryProperties.setRoutingKey(testRoutingKey);
MessageTransferMessage message = createTestMessage(deliveryProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertEquals("Unexpected initial routing address", testRoutingKey, convertedMessage.getInitialRoutingAddress());
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_InternalTest method testPersistentDeliveryModeConversion.
public void testPersistentDeliveryModeConversion() {
MessageDeliveryMode deliveryMode = MessageDeliveryMode.PERSISTENT;
final DeliveryProperties deliveryProperties = new DeliveryProperties();
deliveryProperties.setDeliveryMode(deliveryMode);
MessageTransferMessage message = createTestMessage(deliveryProperties);
final InternalMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
assertTrue("Unexpected persistence", convertedMessage.isPersistent());
assertTrue("Unexpected persistence of meta data", convertedMessage.getStoredMessage().getMetaData().isPersistent());
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_Internal_to_v0_10Test method testToConversionWhenRoutingKeyLengthExceeds255.
public void testToConversionWhenRoutingKeyLengthExceeds255() throws Exception {
final String testExchange = "testExchange";
final String testRoutingKey = generateLongString();
String to = testExchange + "/" + testRoutingKey;
InternalMessage message = createTestMessage(to);
try {
_messageConverter.convert(message, _addressSpace);
fail("Exception is not thrown");
} catch (MessageConversionException e) {
// pass
}
}
Aggregations