use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties 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.protocol.v0_8.transport.BasicContentHeaderProperties 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.protocol.v0_8.transport.BasicContentHeaderProperties 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());
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_v0_8_to_InternalTest method testApplicationIdConversion.
public void testApplicationIdConversion() {
final String applicationId = "appId";
BasicContentHeaderProperties header = new BasicContentHeaderProperties();
header.setAppId(applicationId);
final AMQMessage originalMessage = createTestMessage(header);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected applicationId", applicationId, convertedMessage.getMessageHeader().getAppId());
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_v0_8_to_InternalTest method testDeliveryModePersistentConversion.
public void testDeliveryModePersistentConversion() {
BasicContentHeaderProperties header = new BasicContentHeaderProperties();
header.setDeliveryMode(BasicContentHeaderProperties.PERSISTENT);
final AMQMessage originalMessage = createTestMessage(header);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertTrue("Unexpected persistence of message", convertedMessage.isPersistent());
assertTrue("Unexpected persistence of meta data", convertedMessage.getStoredMessage().getMetaData().isPersistent());
}
Aggregations