Search in sources :

Example 1 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadStringFromFloat.

@Test
public void testReadStringFromFloat() throws Exception {
    float value = RandomUtil.randomFloat();
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    message.writeFloat(value);
    message.reset();
    Assert.assertEquals(Float.toString(value), message.readString());
}
Also used : ActiveMQStreamMessage(org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage) Test(org.junit.Test)

Example 2 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadIntFromByte.

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

Example 3 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadByteFromByte.

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

Example 4 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadShortFromString.

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

Example 5 with ActiveMQStreamMessage

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

the class ActiveMQStreamMessageTest method testReadIntFromShort.

@Test
public void testReadIntFromShort() throws Exception {
    short value = RandomUtil.randomShort();
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    message.writeShort(value);
    message.reset();
    Assert.assertEquals(value, message.readInt());
}
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