Search in sources :

Example 46 with BasicContentHeaderProperties

use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testCorrelationIdConversion.

public void testCorrelationIdConversion() {
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    final String correlationId = "testCorrelationId";
    basicContentHeaderProperties.setCorrelationId(AMQShortString.valueOf(correlationId));
    AMQMessage message = createTestMessage(basicContentHeaderProperties);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
    assertEquals("Unexpected correlationId", correlationId, new String(messageProperties.getCorrelationId(), UTF_8));
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 47 with BasicContentHeaderProperties

use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testReplyToConversionWhenBindingURLFormatIsUsed4.

public void testReplyToConversionWhenBindingURLFormatIsUsed4() {
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    final String replyTo = "direct:////?routingkey='test_routing_key'";
    basicContentHeaderProperties.setReplyTo(replyTo);
    AMQMessage message = createTestMessage(basicContentHeaderProperties);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
    assertNull("Unexpected reply-to exchange", messageProperties.getReplyTo().getExchange());
    assertEquals("Unexpected reply-to routing-key", "test_routing_key", messageProperties.getReplyTo().getRoutingKey());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 48 with BasicContentHeaderProperties

use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testContentEncodingConversion.

public void testContentEncodingConversion() {
    String contentEncoding = "my-test-encoding";
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    basicContentHeaderProperties.setEncoding(contentEncoding);
    AMQMessage message = createTestMessage(basicContentHeaderProperties, new byte[] { (byte) 1 }, 0);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
    assertEquals("Unexpected content encoding", contentEncoding, messageProperties.getContentEncoding());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 49 with BasicContentHeaderProperties

use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testApplicationIdConversion.

public void testApplicationIdConversion() {
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    final String applicationId = "testApplicationId";
    basicContentHeaderProperties.setAppId(applicationId);
    AMQMessage message = createTestMessage(basicContentHeaderProperties);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
    assertEquals("Unexpected applicationId", applicationId, new String(messageProperties.getAppId(), UTF_8));
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) AMQShortString(org.apache.qpid.server.protocol.v0_8.AMQShortString) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 50 with BasicContentHeaderProperties

use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.

the class PropertyConverter_0_8_to_0_10Test method testUuidMessageIdConversion.

public void testUuidMessageIdConversion() {
    BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
    final UUID messageId = UUID.randomUUID();
    basicContentHeaderProperties.setMessageId(messageId.toString());
    AMQMessage message = createTestMessage(basicContentHeaderProperties);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
    assertEquals("Unexpected messageId", messageId, messageProperties.getMessageId());
}
Also used : MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) UUID(java.util.UUID) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

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