use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadLongFromString.
@Test
public void testReadLongFromString() throws Exception {
long value = RandomUtil.randomLong();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeString(Long.toString(value));
message.reset();
Assert.assertEquals(value, message.readLong());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadLongFromLong.
@Test
public void testReadLongFromLong() throws Exception {
long value = RandomUtil.randomLong();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeLong(value);
message.reset();
Assert.assertEquals(value, message.readLong());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadBytesFromBytes_2.
@Test
public void testReadBytesFromBytes_2() throws Exception {
byte[] value = RandomUtil.randomBytes(512);
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeBytes(value, 0, 256);
message.reset();
byte[] v = new byte[256];
message.readBytes(v);
ActiveMQTestBase.assertEqualsByteArrays(256, value, v);
}
Aggregations