Search in sources :

Example 11 with MapToAmqpMapConverter

use of org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.MapToAmqpMapConverter in project qpid-broker-j by apache.

the class MessageConverter_0_8_to_InternalTest method testConvertAmqpMapMessageBody.

public void testConvertAmqpMapMessageBody() throws Exception {
    final Map<String, Object> expected = Collections.singletonMap("key", "value");
    final byte[] messageBytes = new MapToAmqpMapConverter().toMimeContent(expected);
    doTestMapMessage(messageBytes, "amqp/map", expected);
}
Also used : MapToAmqpMapConverter(org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.MapToAmqpMapConverter)

Example 12 with MapToAmqpMapConverter

use of org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.MapToAmqpMapConverter in project qpid-broker-j by apache.

the class MessageConverter_Internal_to_0_8Test method testMapMessageWithMimeTypeWithNonJmsContent.

public void testMapMessageWithMimeTypeWithNonJmsContent() throws Exception {
    HashMap<Object, Object> content = new HashMap<>();
    content.put("key", Collections.singletonMap("foo", "bar"));
    final String mimeType = "foo/bar";
    final MapToAmqpMapConverter mapToAmqpMapConverter = new MapToAmqpMapConverter();
    final byte[] expectedContent = mapToAmqpMapConverter.toMimeContent(content);
    doTest(content, mimeType, expectedContent, mapToAmqpMapConverter.getMimeType());
}
Also used : MapToAmqpMapConverter(org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.MapToAmqpMapConverter) HashMap(java.util.HashMap)

Aggregations

MapToAmqpMapConverter (org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.MapToAmqpMapConverter)12 QpidByteBuffer (org.apache.qpid.server.bytebuffer.QpidByteBuffer)4 NamedAddressSpace (org.apache.qpid.server.model.NamedAddressSpace)4 Message_1_0 (org.apache.qpid.server.protocol.v1_0.Message_1_0)4 Binary (org.apache.qpid.server.protocol.v1_0.type.Binary)4 ApplicationProperties (org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties)4 Data (org.apache.qpid.server.protocol.v1_0.type.messaging.Data)4 Properties (org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)4 HashMap (java.util.HashMap)2 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)2 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)2