use of org.apache.activemq.artemis.core.client.impl.ClientMessageImpl in project activemq-artemis by apache.
the class MessageHeaderTest method testCopyOnForeignBytesMessage.
@Test
public void testCopyOnForeignBytesMessage() throws JMSException {
ClientMessage clientMessage = new ClientMessageImpl(ActiveMQTextMessage.TYPE, true, 0, System.currentTimeMillis(), (byte) 4, 1000);
ClientSession session = new FakeSession(clientMessage);
BytesMessage foreignBytesMessage = new SimpleJMSBytesMessage();
for (int i = 0; i < 20; i++) {
foreignBytesMessage.writeByte((byte) i);
}
ActiveMQBytesMessage copy = new ActiveMQBytesMessage(foreignBytesMessage, session);
foreignBytesMessage.reset();
copy.reset();
MessageHeaderTestBase.ensureEquivalent(foreignBytesMessage, copy);
}
use of org.apache.activemq.artemis.core.client.impl.ClientMessageImpl in project activemq-artemis by apache.
the class ConversionTest method testCoreToJMSConversion.
@Test
public void testCoreToJMSConversion() {
ICoreMessage clientMessage = new ClientMessageImpl();
clientMessage.setDurable(true).setPriority((byte) 9).setExpiration(123456);
Map<String, Object> messageMap = clientMessage.toMap();
Map<String, Object> jmsMap = ActiveMQMessage.coreMaptoJMSMap(messageMap);
Object priority = jmsMap.get("JMSPriority");
assertTrue(priority instanceof Integer);
assertEquals(9, priority);
}
Aggregations