Search in sources :

Example 31 with MessageAnnotations

use of org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations in project qpid-broker-j by apache.

the class MessageConverter_1_0_to_v0_8Test method testNoBodyWithUnknownMessageAnnotation.

public void testNoBodyWithUnknownMessageAnnotation() throws Exception {
    Message_1_0 sourceMessage = createTestMessage(new MessageAnnotations(Collections.singletonMap(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), null);
    final AMQMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class));
    assertEquals("Unexpected mime type", null, convertedMessage.getMessageHeader().getMimeType());
    assertEquals("Unexpected content size", 0, convertedMessage.getMessageMetaData().getContentSize());
}
Also used : MessageAnnotations(org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations) NamedAddressSpace(org.apache.qpid.server.model.NamedAddressSpace) Message_1_0(org.apache.qpid.server.protocol.v1_0.Message_1_0) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 32 with MessageAnnotations

use of org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations in project qpid-broker-j by apache.

the class MessageConverter_v1_0_to_InternalTest method testNoBodyWithUnknownMessageAnnotationWithContentType.

public void testNoBodyWithUnknownMessageAnnotationWithContentType() throws Exception {
    final String mimeType = "foo/bar";
    Properties properties = new Properties();
    properties.setContentType(Symbol.valueOf(mimeType));
    Message_1_0 sourceMessage = createTestMessage(properties, new MessageAnnotations(Collections.singletonMap(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), null);
    final InternalMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class));
    assertEquals("Unexpected mime type", mimeType, convertedMessage.getMessageHeader().getMimeType());
    assertEquals("Unexpected content", null, convertedMessage.getMessageBody());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) MessageAnnotations(org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations) NamedAddressSpace(org.apache.qpid.server.model.NamedAddressSpace) ApplicationProperties(org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties) Properties(org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)

Aggregations

MessageAnnotations (org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotations)22 Message_1_0 (org.apache.qpid.server.protocol.v1_0.Message_1_0)19 ApplicationProperties (org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties)15 Properties (org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)15 Header (org.apache.qpid.server.protocol.v1_0.type.messaging.Header)12 NamedAddressSpace (org.apache.qpid.server.model.NamedAddressSpace)10 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)10 DeliveryAnnotations (org.apache.qpid.server.protocol.v1_0.type.messaging.DeliveryAnnotations)10 DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)8 MessageProperties (org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)8 Binary (org.apache.qpid.server.protocol.v1_0.type.Binary)8 Date (java.util.Date)7 QpidByteBuffer (org.apache.qpid.server.bytebuffer.QpidByteBuffer)7 Footer (org.apache.qpid.server.protocol.v1_0.type.messaging.Footer)7 MessageMetaData_1_0 (org.apache.qpid.server.protocol.v1_0.MessageMetaData_1_0)6 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)5 Data (org.apache.qpid.server.protocol.v1_0.type.messaging.Data)5 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)4 Symbol (org.apache.qpid.server.protocol.v1_0.type.Symbol)4 DataSection (org.apache.qpid.server.protocol.v1_0.type.messaging.DataSection)4