Search in sources :

Example 36 with ActiveMQMapMessage

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

the class ActiveMQMapMessageTest method testGetCharFromChar.

@Test
public void testGetCharFromChar() throws Exception {
    char value = RandomUtil.randomChar();
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    message.setChar(itemName, value);
    Assert.assertEquals(value, message.getChar(itemName));
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Example 37 with ActiveMQMapMessage

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

the class ActiveMQMapMessageTest method testGetShortFromShort.

@Test
public void testGetShortFromShort() throws Exception {
    short value = RandomUtil.randomShort();
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    message.setShort(itemName, value);
    Assert.assertEquals(value, message.getShort(itemName));
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Example 38 with ActiveMQMapMessage

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

the class ActiveMQMapMessageTest method testGetByteFromByte.

@Test
public void testGetByteFromByte() throws Exception {
    byte value = RandomUtil.randomByte();
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    message.setByte(itemName, value);
    Assert.assertEquals(value, message.getByte(itemName));
}
Also used : ActiveMQMapMessage(org.apache.activemq.artemis.jms.client.ActiveMQMapMessage) Test(org.junit.Test)

Example 39 with ActiveMQMapMessage

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

the class ActiveMQMapMessageTest method testGetFloatFromNull.

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

Example 40 with ActiveMQMapMessage

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

the class ActiveMQMapMessageTest method testGetBytesFromInvalidType.

@Test
public void testGetBytesFromInvalidType() throws Exception {
    ActiveMQMapMessage message = new ActiveMQMapMessage();
    message.setChar(itemName, RandomUtil.randomChar());
    try {
        message.getBytes(itemName);
        Assert.fail("MessageFormatException");
    } catch (MessageFormatException e) {
    }
}
Also used : MessageFormatException(javax.jms.MessageFormatException) 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