Search in sources :

Example 66 with BasicContentHeaderProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)

Example 67 with BasicContentHeaderProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)

Example 68 with BasicContentHeaderProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)

Example 69 with BasicContentHeaderProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)

Example 70 with BasicContentHeaderProperties

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());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)

Aggregations

BasicContentHeaderProperties (org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)151 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)115 AMQShortString (org.apache.qpid.server.protocol.v0_8.AMQShortString)74 Message_1_0 (org.apache.qpid.server.protocol.v1_0.Message_1_0)59 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)52 Properties (org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)48 MessageProperties (org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)39 ApplicationProperties (org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties)31 DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)21 Matchers.anyString (org.mockito.Matchers.anyString)20 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)18 HashMap (java.util.HashMap)16 ContentHeaderBody (org.apache.qpid.server.protocol.v0_8.transport.ContentHeaderBody)16 Header (org.apache.qpid.server.protocol.v1_0.type.messaging.Header)12 MessagePublishInfo (org.apache.qpid.server.protocol.v0_8.transport.MessagePublishInfo)9 Binary (org.apache.qpid.server.protocol.v1_0.type.Binary)8 ReplyTo (org.apache.qpid.server.protocol.v0_10.transport.ReplyTo)7 Date (java.util.Date)6 UUID (java.util.UUID)6 MessageConversionException (org.apache.qpid.server.protocol.converter.MessageConversionException)6