Search in sources :

Example 51 with ActiveMQMapMessage

use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.

the class ActiveMQMapMessageTest method testGetBytesFromNull.

@Test
public void testGetBytesFromNull() throws Exception {
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    Assert.assertNull(message.getBytes(itemName));
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Example 52 with ActiveMQMapMessage

use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.

the class ActiveMQMapMessageTest method testGetStringFromLong.

@Test
public void testGetStringFromLong() throws Exception {
    long value = RandomUtil.randomLong();
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    message.setLong(itemName, value);
    Assert.assertEquals(Long.toString(value), message.getString(itemName));
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Example 53 with ActiveMQMapMessage

use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.

the class ActiveMQMapMessageTest method testGetDoubleFromNull.

@Test
public void testGetDoubleFromNull() throws Exception {
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    try {
        message.getDouble(itemName);
        Assert.fail("NullPointerException");
    } catch (NullPointerException e) {
    }
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Example 54 with ActiveMQMapMessage

use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.

the class ActiveMQMapMessageTest method testGetLongFromLong.

@Test
public void testGetLongFromLong() throws Exception {
    long value = RandomUtil.randomLong();
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    message.setLong(itemName, value);
    Assert.assertEquals(value, message.getLong(itemName));
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Example 55 with ActiveMQMapMessage

use of org.apache.activemq.artemis.jms.client.ActiveMQMapMessage in project activemq-artemis by apache.

the class ActiveMQMapMessageTest method testGetStringFromString.

@Test
public void testGetStringFromString() throws Exception {
    String value = RandomUtil.randomString();
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    message.setString(itemName, value);
    Assert.assertEquals(value, message.getString(itemName));
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Aggregations

ActiveMQMapMessage (org.apache.activemq.artemis.jms.client.ActiveMQMapMessage)58 Test (org.junit.Test)57 MessageFormatException (javax.jms.MessageFormatException)9 MapMessage (javax.jms.MapMessage)1 ClientMessage (org.apache.activemq.artemis.api.core.client.ClientMessage)1 ClientSession (org.apache.activemq.artemis.api.core.client.ClientSession)1 ClientMessageImpl (org.apache.activemq.artemis.core.client.impl.ClientMessageImpl)1