use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testCorrelationIdConversionWhenLengthExceeds255.
public void testCorrelationIdConversionWhenLengthExceeds255() {
final String correlationId = generateLongString();
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setCorrelationId(correlationId.getBytes());
MessageTransferMessage message = createTestMessage(messageProperties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("expected exception not thrown");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testJmsTypeConversionWhenLengthExceeds255.
public void testJmsTypeConversionWhenLengthExceeds255() {
final String type = generateLongString();
final Map<String, Object> headers = Collections.singletonMap("x-jms-type", type);
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setApplicationHeaders(headers);
MessageTransferMessage message = createTestMessage(messageProperties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("Exception is not thrown");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testReplyToConversionWhenExchangeSpecified.
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());
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testTimestampConversion.
public void testTimestampConversion() {
final DeliveryProperties deliveryProperties = new DeliveryProperties();
final long timestamp = System.currentTimeMillis() - 1000;
deliveryProperties.setTimestamp(timestamp);
MessageTransferMessage message = createTestMessage(deliveryProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected creation timestamp", timestamp, properties.getTimestamp());
}
use of org.apache.qpid.server.protocol.v0_10.MessageTransferMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testCorrelationIdConversion.
public void testCorrelationIdConversion() {
final String correlationId = "testCorrelationId";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setCorrelationId(correlationId.getBytes());
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected correlationId", correlationId, properties.getCorrelationId().toString());
}
Aggregations