use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadStringFromShort.
@Test
public void testReadStringFromShort() throws Exception {
short value = RandomUtil.randomShort();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeShort(value);
message.reset();
Assert.assertEquals(Short.toString(value), message.readString());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadIntFromString.
@Test
public void testReadIntFromString() throws Exception {
int value = RandomUtil.randomInt();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeString(Integer.toString(value));
message.reset();
Assert.assertEquals(value, message.readInt());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadBooleanFromString.
@Test
public void testReadBooleanFromString() throws Exception {
boolean value = RandomUtil.randomBoolean();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeString(Boolean.toString(value));
message.reset();
Assert.assertEquals(value, message.readBoolean());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadByteFromString.
@Test
public void testReadByteFromString() throws Exception {
byte value = RandomUtil.randomByte();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeString(Byte.toString(value));
message.reset();
Assert.assertEquals(value, message.readByte());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadDoubleFromFloat.
@Test
public void testReadDoubleFromFloat() throws Exception {
float value = RandomUtil.randomFloat();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeFloat(value);
message.reset();
Assert.assertEquals(Float.valueOf(value).doubleValue(), message.readDouble(), 0.000001);
}
Aggregations