Search in sources :

Example 21 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadLongFromShort.

@Test
public void testReadLongFromShort() throws Exception {
    short value = RandomUtil.randomShort();
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    message.writeShort(value);
    message.reset();
    Assert.assertEquals(value, message.readLong());
}
Also used : ActiveMQStreamMessage(org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage) Test(org.junit.Test)

Example 22 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadStringFromNullString.

@Test
public void testReadStringFromNullString() throws Exception {
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    message.writeString(null);
    message.reset();
    Assert.assertNull(message.readString());
}
Also used : ActiveMQStreamMessage(org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage) Test(org.junit.Test)

Example 23 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadDoubleFromDouble.

@Test
public void testReadDoubleFromDouble() throws Exception {
    double value = RandomUtil.randomDouble();
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    message.writeDouble(value);
    message.reset();
    Assert.assertEquals(value, message.readDouble(), 0.000001);
}
Also used : ActiveMQStreamMessage(org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage) Test(org.junit.Test)

Example 24 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadShortFromShort.

@Test
public void testReadShortFromShort() throws Exception {
    short value = RandomUtil.randomShort();
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    message.writeShort(value);
    message.reset();
    Assert.assertEquals(value, message.readShort());
}
Also used : ActiveMQStreamMessage(org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage) Test(org.junit.Test)

Example 25 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadShortFromByte.

@Test
public void testReadShortFromByte() throws Exception {
    byte value = RandomUtil.randomByte();
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    message.writeByte(value);
    message.reset();
    Assert.assertEquals(value, message.readShort());
}
Also used : ActiveMQStreamMessage(org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage) Test(org.junit.Test)

Aggregations

ActiveMQStreamMessage (org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage)53 Test (org.junit.Test)50 MessageFormatException (javax.jms.MessageFormatException)2 MessageEOFException (javax.jms.MessageEOFException)1 StreamMessage (javax.jms.StreamMessage)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