use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testSetObjectFromBoolean.
@Test
public void testSetObjectFromBoolean() throws Exception {
boolean value = RandomUtil.randomBoolean();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setObject(itemName, value);
Assert.assertEquals(value, message.getObject(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetStringFromFloat.
@Test
public void testGetStringFromFloat() throws Exception {
float value = RandomUtil.randomFloat();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setFloat(itemName, value);
Assert.assertEquals(Float.toString(value), message.getString(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetCharFromInvalidType.
@Test
public void testGetCharFromInvalidType() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setFloat(itemName, RandomUtil.randomFloat());
try {
message.getChar(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 testGetFloatFromFloat.
@Test
public void testGetFloatFromFloat() throws Exception {
float value = RandomUtil.randomFloat();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setFloat(itemName, value);
Assert.assertEquals(value, message.getFloat(itemName), 0.000001);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetStringFromByte.
@Test
public void testGetStringFromByte() throws Exception {
byte value = RandomUtil.randomByte();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setByte(itemName, value);
Assert.assertEquals(Byte.toString(value), message.getString(itemName));
}
Aggregations