use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetLongFromShort.
@Test
public void testGetLongFromShort() throws Exception {
short value = RandomUtil.randomShort();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setShort(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 testGetStringFromInt.
@Test
public void testGetStringFromInt() throws Exception {
int value = RandomUtil.randomInt();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setInt(itemName, value);
Assert.assertEquals(Integer.toString(value), message.getString(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetDoubleFromDouble.
@Test
public void testGetDoubleFromDouble() throws Exception {
double value = RandomUtil.randomDouble();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setDouble(itemName, value);
Assert.assertEquals(value, message.getDouble(itemName), 0.000001);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetShortFromNull.
@Test
public void testGetShortFromNull() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
try {
message.getShort(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 testGetStringFromDouble.
@Test
public void testGetStringFromDouble() throws Exception {
double value = RandomUtil.randomByte();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setDouble(itemName, value);
Assert.assertEquals(Double.toString(value), message.getString(itemName));
}
Aggregations