use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetLongFromInvalidType.
@Test
public void testGetLongFromInvalidType() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setFloat(itemName, RandomUtil.randomFloat());
try {
message.getLong(itemName);
Assert.fail("MessageFormatException");
} catch (MessageFormatException e) {
}
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testClearBody.
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@Test
public void testClearBody() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setBoolean(itemName, true);
Assert.assertTrue(message.itemExists(itemName));
message.clearBody();
Assert.assertFalse(message.itemExists(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testCheckItemNameIsEmpty.
@Test
public void testCheckItemNameIsEmpty() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
try {
message.setBoolean("", true);
Assert.fail("item name can not be empty");
} catch (IllegalArgumentException e) {
}
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetLongFromInt.
@Test
public void testGetLongFromInt() throws Exception {
int value = RandomUtil.randomInt();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setInt(itemName, value);
Assert.assertEquals(value, message.getLong(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetBooleanFromInvalidType.
@Test
public void testGetBooleanFromInvalidType() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setFloat(itemName, RandomUtil.randomFloat());
try {
message.getBoolean(itemName);
Assert.fail("MessageFormatException");
} catch (MessageFormatException e) {
}
}
Aggregations