use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetDoubleFromString.
@Test
public void testGetDoubleFromString() throws Exception {
double value = RandomUtil.randomDouble();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setString(itemName, Double.toString(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 testGetStringFromBoolean.
@Test
public void testGetStringFromBoolean() throws Exception {
boolean value = RandomUtil.randomBoolean();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setBoolean(itemName, value);
Assert.assertEquals(Boolean.toString(value), message.getString(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetStringFromChar.
@Test
public void testGetStringFromChar() throws Exception {
char value = RandomUtil.randomChar();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setChar(itemName, value);
Assert.assertEquals(Character.toString(value), message.getString(itemName));
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetCharFromNull.
@Test
public void testGetCharFromNull() throws Exception {
ActiveMQMapMessage message = new ActiveMQMapMessage();
try {
message.getChar(itemName);
Assert.fail("NullPointerException");
} catch (NullPointerException e) {
}
}
use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.
the class ActiveMQMapMessageTest method testGetBytesFromBytes.
@Test
public void testGetBytesFromBytes() throws Exception {
byte[] value = RandomUtil.randomBytes();
ActiveMQMapMessage message = new ActiveMQMapMessage();
message.setBytes(itemName, value);
ActiveMQTestBase.assertEqualsByteArrays(value, message.getBytes(itemName));
}
Aggregations