use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testCheckItemNameIsNull.
@Test
public void testCheckItemNameIsNull() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
try {
message.setBoolean(null, true);
Assert.fail("item name can not be null");
} catch (IllegalArgumentException e) {
}
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetShortFromInvalidType.
@Test
public void testGetShortFromInvalidType() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setFloat(itemName, RandomUtil.randomFloat());
try {
message.getShort(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 testGetByteFromString.
@Test
public void testGetByteFromString() throws Exception {
byte value = RandomUtil.randomByte();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setString(itemName, Byte.toString(value));
Assert.assertEquals(value, message.getByte(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetIntFromString.
@Test
public void testGetIntFromString() throws Exception {
int value = RandomUtil.randomInt();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setString(itemName, Integer.toString(value));
Assert.assertEquals(value, message.getInt(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetBooleanFromString.
@Test
public void testGetBooleanFromString() throws Exception {
boolean value = true;
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setString(itemName, Boolean.toString(value));
Assert.assertEquals(value, message.getBoolean(itemName));
}
Aggregations