use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetLongFromNull.
@Test
public void testGetLongFromNull() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
try {
message.getLong(itemName);
Assert.fail("NumberFormatException");
} catch (NumberFormatException e) {
}
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetLongFromString.
@Test
public void testGetLongFromString() throws Exception {
long value = RandomUtil.randomLong();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setString(itemName, Long.toString(value));
Assert.assertEquals(value, message.getLong(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class MessageHeaderTest method testCopyOnForeignMapMessage.
@Test
public void testCopyOnForeignMapMessage() throws JMSException {
ClientMessage clientMessage = new ClientMessageImpl(ActiveMQTextMessage.TYPE, true, 0, System.currentTimeMillis(), (byte) 4, 1000);
ClientSession session = new FakeSession(clientMessage);
MapMessage foreignMapMessage = new SimpleJMSMapMessage();
foreignMapMessage.setInt("int", 1);
foreignMapMessage.setString("string", "test");
ActiveMQMapMessage copy = new ActiveMQMapMessage(foreignMapMessage, session);
MessageHeaderTestBase.ensureEquivalent(foreignMapMessage, copy);
}
Aggregations