use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_v0_8_to_InternalTest method testContentEncodingConversion.
public void testContentEncodingConversion() {
String contentEncoding = "my-test-encoding";
BasicContentHeaderProperties header = new BasicContentHeaderProperties();
header.setEncoding(contentEncoding);
final AMQMessage originalMessage = createTestMessage(header);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected content encoding", contentEncoding, convertedMessage.getMessageHeader().getEncoding());
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_v0_8_to_InternalTest method testHeadersConversion.
public void testHeadersConversion() {
Map<String, Object> properties = new HashMap<>();
properties.put("testProperty1", "testProperty1Value");
properties.put("intProperty", 1);
BasicContentHeaderProperties header = new BasicContentHeaderProperties();
header.setHeaders(FieldTable.convertToFieldTable(properties));
final AMQMessage originalMessage = createTestMessage(header);
final InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
final Map<String, Object> headers = convertedMessage.getMessageHeader().getHeaderMap();
assertEquals("Unexpected headers", properties, new HashMap<>(headers));
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_v0_8_to_InternalTest method testExpirationConversion.
public void testExpirationConversion() {
long ttl = 10000;
long arrivalTime = System.currentTimeMillis();
long expiryTime = arrivalTime + ttl;
BasicContentHeaderProperties header = new BasicContentHeaderProperties();
header.setExpiration(expiryTime);
final AMQMessage originalMessage = createTestMessage(header, arrivalTime);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected expiration", expiryTime, convertedMessage.getMessageHeader().getExpiration());
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_v0_8_to_InternalTest method testReplyToConversionForDirectExchangeAndRoutingKey.
public void testReplyToConversionForDirectExchangeAndRoutingKey() {
String exchangeName = "amq.direct";
String routingKey = "testRoutingKey";
final String replyTo = String.format("%s://%s//?routingkey='%s'", "direct", exchangeName, routingKey);
BasicContentHeaderProperties header = new BasicContentHeaderProperties();
header.setReplyTo(replyTo);
final AMQMessage originalMessage = createTestMessage(header);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected replyTo", exchangeName + "/" + routingKey, convertedMessage.getMessageHeader().getReplyTo());
}
use of org.apache.qpid.server.message.internal.InternalMessage in project qpid-broker-j by apache.
the class PropertyConverter_v0_8_to_InternalTest method testUserIdConversion.
public void testUserIdConversion() {
final String userId = "testUserId";
BasicContentHeaderProperties header = new BasicContentHeaderProperties();
header.setUserId(userId);
final AMQMessage originalMessage = createTestMessage(header);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected userId", userId, convertedMessage.getMessageHeader().getUserId());
}
Aggregations