use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadStringFromChar.
@Test
public void testReadStringFromChar() throws Exception {
char value = RandomUtil.randomChar();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeChar(value);
message.reset();
Assert.assertEquals(Character.toString(value), message.readString());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadStringFromByte.
@Test
public void testReadStringFromByte() throws Exception {
byte value = RandomUtil.randomByte();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeByte(value);
message.reset();
Assert.assertEquals(Byte.toString(value), message.readString());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadObjectFromBytes.
@Test
public void testReadObjectFromBytes() throws Exception {
byte[] value = RandomUtil.randomBytes();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeBytes(value);
message.reset();
byte[] v = (byte[]) message.readObject();
ActiveMQTestBase.assertEqualsByteArrays(value, v);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method doWriteObjectWithType.
private void doWriteObjectWithType(final Object value, final TypeReader reader) throws Exception {
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeObject(value);
message.reset();
Object v = reader.readType(message);
if (value instanceof byte[]) {
ActiveMQTestBase.assertEqualsByteArrays((byte[]) value, (byte[]) v);
} else {
Assert.assertEquals(value, v);
}
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testGetType.
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
@Test
public void testGetType() throws Exception {
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
Assert.assertEquals(ActiveMQStreamMessage.TYPE, message.getType());
}
Aggregations