use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testContentTypeJavaObjectStreamConversion.
public void testContentTypeJavaObjectStreamConversion() {
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setContentType("application/java-object-stream");
MessageTransferMessage message = createTestMessage(messageProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected content type", "application/x-java-serialized-object", 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_1_0Test method testHeaderWithMapValueConversionFails.
public void testHeaderWithMapValueConversionFails() {
Map<String, Object> headers = Collections.singletonMap("mapHeader", Collections.emptyMap());
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setApplicationHeaders(headers);
MessageTransferMessage message = createTestMessage(messageProperties);
try {
_messageConverter.convert(message, _namedAddressSpace);
fail("Exception is expected");
} catch (MessageConversionException e) {
// pass
}
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testArrivalTimeConversion.
public void testArrivalTimeConversion() {
final long timestamp = System.currentTimeMillis() - 1000;
MessageTransferMessage message = createTestMessage(new DeliveryProperties(), new MessageProperties(), null, timestamp);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected creation timestamp", timestamp, properties.getCreationTime().getTime());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testMessageIdConversion.
public void testMessageIdConversion() {
UUID messageId = UUID.randomUUID();
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setMessageId(messageId);
MessageTransferMessage message = createTestMessage(messageProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected messageId", messageId, properties.getMessageId());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_1_0Test method testUserIdConversion.
public void testUserIdConversion() {
final String userId = "test-userId";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setUserId(userId.getBytes());
MessageTransferMessage message = createTestMessage(messageProperties);
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));
}
Aggregations