use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadObjectFromInt.
@Test
public void testReadObjectFromInt() throws Exception {
int value = RandomUtil.randomInt();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeInt(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 testReadObjectFromByte.
@Test
public void testReadObjectFromByte() throws Exception {
byte value = RandomUtil.randomByte();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeByte(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 testReadStringFromDouble.
@Test
public void testReadStringFromDouble() throws Exception {
double value = RandomUtil.randomDouble();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeDouble(value);
message.reset();
Assert.assertEquals(Double.toString(value), message.readString());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method doReadTypeFromEmptyMessage.
// Private -------------------------------------------------------
private void doReadTypeFromEmptyMessage(final TypeReader reader) throws Exception {
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.reset();
try {
reader.readType(message);
Assert.fail("MessageEOFException");
} catch (MessageEOFException e) {
}
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadStringFromBoolean.
@Test
public void testReadStringFromBoolean() throws Exception {
boolean value = RandomUtil.randomBoolean();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeBoolean(value);
message.reset();
Assert.assertEquals(Boolean.toString(value), message.readString());
}
Aggregations