use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetDoubleFromFloat.
@Test
public void testGetDoubleFromFloat() throws Exception {
float value = RandomUtil.randomFloat();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setFloat(itemName, value);
Assert.assertEquals(Float.valueOf(value).doubleValue(), message.getDouble(itemName), 0.000001);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetBooleanFromBoolean.
@Test
public void testGetBooleanFromBoolean() throws Exception {
boolean value = true;
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setBoolean(itemName, value);
Assert.assertEquals(value, message.getBoolean(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetShortFromByte.
@Test
public void testGetShortFromByte() throws Exception {
byte value = RandomUtil.randomByte();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setByte(itemName, value);
Assert.assertEquals(value, message.getShort(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetShortFromString.
@Test
public void testGetShortFromString() throws Exception {
short value = RandomUtil.randomShort();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setString(itemName, Short.toString(value));
Assert.assertEquals(value, message.getShort(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetFloatFromInvalidType.
@Test
public void testGetFloatFromInvalidType() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setChar(itemName, RandomUtil.randomChar());
try {
message.getFloat(itemName);
Assert.fail("MessageFormatException");
} catch (MessageFormatException e) {
}
}
Aggregations