use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testWriteObjectWithNull.
@Test
public void testWriteObjectWithNull() throws Exception {
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeObject(null);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadObjectFromLong.
@Test
public void testReadObjectFromLong() throws Exception {
long value = RandomUtil.randomLong();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeLong(value);
message.reset();
Assert.assertEquals(value, message.readObject());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadBytesFromBytes.
@Test
public void testReadBytesFromBytes() throws Exception {
byte[] value = RandomUtil.randomBytes();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeBytes(value);
message.reset();
byte[] v = new byte[value.length];
message.readBytes(v);
ActiveMQTestBase.assertEqualsByteArrays(value, v);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadObjectFromDouble.
@Test
public void testReadObjectFromDouble() throws Exception {
double value = RandomUtil.randomDouble();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeDouble(value);
message.reset();
Assert.assertEquals(value, message.readObject());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method doReadTypeFromInvalidType.
private void doReadTypeFromInvalidType(final Object invalidValue, final TypeReader reader) throws Exception {
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeObject(invalidValue);
message.reset();
try {
reader.readType(message);
Assert.fail("MessageFormatException");
} catch (MessageFormatException e) {
}
}
Aggregations