use of org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSObjectMessage in project activemq-artemis by apache.
the class JMSMappingOutboundTransformerTest method testConvertCompressedObjectMessageToAmqpMessageWithDataBody.
@Test
public void testConvertCompressedObjectMessageToAmqpMessageWithDataBody() throws Exception {
ServerJMSObjectMessage outbound = createObjectMessage(TEST_OBJECT_VALUE, true);
outbound.encode();
Message amqp = AMQPConverter.getInstance().fromCore(outbound.getInnerMessage()).getProtonMessage();
assertNotNull(amqp.getBody());
assertTrue(amqp.getBody() instanceof Data);
assertFalse(0 == ((Data) amqp.getBody()).getValue().getLength());
Object value = deserialize(((Data) amqp.getBody()).getValue().getArray());
assertNotNull(value);
assertTrue(value instanceof UUID);
}
use of org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSObjectMessage in project activemq-artemis by apache.
the class JMSMappingOutboundTransformerTest method testConvertCompressedObjectMessageToAmqpMessageWithAmqpValueBody.
@Test
public void testConvertCompressedObjectMessageToAmqpMessageWithAmqpValueBody() throws Exception {
ServerJMSObjectMessage outbound = createObjectMessage(TEST_OBJECT_VALUE, true);
outbound.encode();
Message amqp = AMQPConverter.getInstance().fromCore(outbound.getInnerMessage()).getProtonMessage();
assertNotNull(amqp.getBody());
assertTrue(amqp.getBody() instanceof Data);
assertTrue(((Data) amqp.getBody()).getValue() instanceof Binary);
assertFalse(0 == ((Binary) ((Data) amqp.getBody()).getValue()).getLength());
Object value = deserialize((((Data) amqp.getBody()).getValue()).getArray());
assertNotNull(value);
assertTrue(value instanceof UUID);
}
use of org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSObjectMessage in project activemq-artemis by apache.
the class JMSMappingOutboundTransformerTest method testConvertCompressedObjectMessageToAmqpMessageUnknownEncodingGetsDataSection.
@Test
public void testConvertCompressedObjectMessageToAmqpMessageUnknownEncodingGetsDataSection() throws Exception {
ServerJMSObjectMessage outbound = createObjectMessage(TEST_OBJECT_VALUE, true);
outbound.encode();
Message amqp = AMQPConverter.getInstance().fromCore(outbound.getInnerMessage()).getProtonMessage();
assertNotNull(amqp.getBody());
assertTrue(amqp.getBody() instanceof Data);
assertFalse(0 == ((Data) amqp.getBody()).getValue().getLength());
Object value = deserialize(((Data) amqp.getBody()).getValue().getArray());
assertNotNull(value);
assertTrue(value instanceof UUID);
}
use of org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSObjectMessage in project activemq-artemis by apache.
the class JMSMappingOutboundTransformerTest method testConvertEmptyObjectMessageToAmqpMessageUnknownEncodingGetsDataSection.
@Test
public void testConvertEmptyObjectMessageToAmqpMessageUnknownEncodingGetsDataSection() throws Exception {
ServerJMSObjectMessage outbound = createObjectMessage();
outbound.encode();
Message amqp = AMQPConverter.getInstance().fromCore(outbound.getInnerMessage()).getProtonMessage();
assertNotNull(amqp.getBody());
assertTrue(amqp.getBody() instanceof Data);
assertEquals(5, ((Data) amqp.getBody()).getValue().getLength());
}
use of org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSObjectMessage in project activemq-artemis by apache.
the class JMSMappingOutboundTransformerTest method testConvertObjectMessageToAmqpMessageWithDataBody.
@Test
public void testConvertObjectMessageToAmqpMessageWithDataBody() throws Exception {
ServerJMSObjectMessage outbound = createObjectMessage(TEST_OBJECT_VALUE);
outbound.encode();
Message amqp = AMQPConverter.getInstance().fromCore(outbound.getInnerMessage()).getProtonMessage();
assertNotNull(amqp.getBody());
assertTrue(amqp.getBody() instanceof Data);
assertFalse(0 == ((Data) amqp.getBody()).getValue().getLength());
Object value = deserialize(((Data) amqp.getBody()).getValue().getArray());
assertNotNull(value);
assertTrue(value instanceof UUID);
}
Aggregations