use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testApplicationIdConversion.
public void testApplicationIdConversion() {
String applicationId = "testAppId";
MessageProperties messageProperties = new MessageProperties();
messageProperties.setAppId(applicationId.getBytes(UTF_8));
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected application id", applicationId, properties.getAppId().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_0_8Test method testContentEncodingConversion.
public void testContentEncodingConversion() {
String contentEncoding = "my-test-encoding";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setContentEncoding(contentEncoding);
MessageTransferMessage message = createTestMessage(new DeliveryProperties(), messageProperties, new byte[] { (byte) 1 }, 0);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected content encoding", contentEncoding, properties.getEncoding().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_0_8Test method testApplicationIdConversionWhenLengthExceeds255.
public void testApplicationIdConversionWhenLengthExceeds255() {
String appId = generateLongString();
MessageProperties messageProperties = new MessageProperties();
messageProperties.setAppId(appId.getBytes(UTF_8));
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertNull("Unexpected application id", properties.getAppId());
}
use of org.apache.qpid.server.protocol.v0_10.transport.MessageProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_10_to_0_8Test method testUserIdConversion.
public void testUserIdConversion() {
final String userId = "test-userId";
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setUserId(userId.getBytes());
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected user-id", userId, properties.getUserId().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_0_8Test method testUserIdConversionExceeds255.
public void testUserIdConversionExceeds255() {
final String userId = generateLongString();
final MessageProperties messageProperties = new MessageProperties();
messageProperties.setUserId(userId.getBytes());
MessageTransferMessage message = createTestMessage(messageProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties properties = convertedMessage.getContentHeaderBody().getProperties();
assertNull("Unexpected user-id", properties.getUserId());
}
Aggregations