Search in sources :

Example 1 with ListToAmqpListConverter

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

the class MessageConverter_0_8_to_1_0Test method testConvertAmqpListMessageBody.

@Test
public void testConvertAmqpListMessageBody() throws Exception {
    final List<Object> expected = Lists.newArrayList("apple", 43, 31.42D);
    final byte[] messageBytes = new ListToAmqpListConverter().toMimeContent(expected);
    final String mimeType = "amqp/list";
    doTestStreamMessage(messageBytes, mimeType, expected, JmsMessageTypeAnnotation.STREAM_MESSAGE.getType());
}
Also used : ListToAmqpListConverter(org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.ListToAmqpListConverter) Test(org.junit.Test)

Example 2 with ListToAmqpListConverter

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

the class MessageConverter_Internal_to_0_8Test method testListMessageWithoutMimeTypeWithNonJmsContent.

@Test
public void testListMessageWithoutMimeTypeWithNonJmsContent() throws Exception {
    ArrayList<?> content = Lists.newArrayList("testItem", 37.5, 42, Lists.newArrayList());
    final ListToAmqpListConverter listToAmqpListConverter = new ListToAmqpListConverter();
    final byte[] expectedContent = listToAmqpListConverter.toMimeContent(content);
    doTest(content, null, expectedContent, listToAmqpListConverter.getMimeType());
}
Also used : ListToAmqpListConverter(org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.ListToAmqpListConverter) Test(org.junit.Test)

Example 3 with ListToAmqpListConverter

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

the class MessageConverter_0_8_to_InternalTest method testConvertAmqpListMessageBody.

@Test
public void testConvertAmqpListMessageBody() throws Exception {
    final List<Object> expected = Lists.newArrayList("apple", 43, 31.42D);
    final byte[] messageBytes = new ListToAmqpListConverter().toMimeContent(expected);
    doTestStreamMessage(messageBytes, "amqp/list", expected);
}
Also used : ListToAmqpListConverter(org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.ListToAmqpListConverter) Test(org.junit.Test)

Example 4 with ListToAmqpListConverter

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

the class MessageConverter_0_10_to_1_0Test method testConvertAmqpListMessageBody.

@Test
public void testConvertAmqpListMessageBody() throws Exception {
    final List<Object> expected = Lists.newArrayList("apple", 43, 31.42D);
    final byte[] messageBytes = new ListToAmqpListConverter().toMimeContent(expected);
    final String mimeType = "amqp/list";
    doTestStreamMessage(messageBytes, mimeType, expected, JmsMessageTypeAnnotation.STREAM_MESSAGE.getType());
}
Also used : ListToAmqpListConverter(org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.ListToAmqpListConverter) Test(org.junit.Test)

Example 5 with ListToAmqpListConverter

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

the class MessageConverter_0_10_to_1_0Test method testConvertAmqpListMessageBodyWithNonJmsContent.

@Test
public void testConvertAmqpListMessageBodyWithNonJmsContent() throws Exception {
    final List<Object> expected = Lists.newArrayList("apple", 43, 31.42D, Lists.newArrayList("nonJMSList"));
    final byte[] messageBytes = new ListToAmqpListConverter().toMimeContent(expected);
    final String mimeType = "amqp/list";
    doTestStreamMessage(messageBytes, mimeType, expected, null);
}
Also used : ListToAmqpListConverter(org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.ListToAmqpListConverter) Test(org.junit.Test)

Aggregations

ListToAmqpListConverter (org.apache.qpid.server.protocol.v0_10.transport.mimecontentconverter.ListToAmqpListConverter)12 Test (org.junit.Test)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 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)2 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)2