use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadCharFromChar.
@Test
public void testReadCharFromChar() throws Exception {
char value = RandomUtil.randomChar();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeChar(value);
message.reset();
Assert.assertEquals(value, message.readChar());
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadObjectFromShort.
@Test
public void testReadObjectFromShort() throws Exception {
short value = RandomUtil.randomShort();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeShort(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 testReadBooleanFromBoolean.
@Test
public void testReadBooleanFromBoolean() throws Exception {
boolean value = RandomUtil.randomBoolean();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeBoolean(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 MessageHeaderTest method testCopyOnForeignStreamMessage.
@Test
public void testCopyOnForeignStreamMessage() throws JMSException {
ClientMessage clientMessage = new ClientMessageImpl(ActiveMQTextMessage.TYPE, true, 0, System.currentTimeMillis(), (byte) 4, 1000);
ClientSession session = new FakeSession(clientMessage);
StreamMessage foreignStreamMessage = new SimpleJMSStreamMessage();
foreignStreamMessage.writeByte((byte) 1);
foreignStreamMessage.writeByte((byte) 2);
foreignStreamMessage.writeByte((byte) 3);
ActiveMQStreamMessage copy = new ActiveMQStreamMessage(foreignStreamMessage, session);
MessageHeaderTestBase.ensureEquivalent(foreignStreamMessage, copy);
}
use of org.apache.activemq.artemis.jms.client.ActiveMQStreamMessage in project activemq-artemis by apache.
the class ActiveMQStreamMessageTest method testReadStringFromLong.
@Test
public void testReadStringFromLong() throws Exception {
long value = RandomUtil.randomLong();
ActiveMQStreamMessage message = new ActiveMQStreamMessage();
message.writeLong(value);
message.reset();
Assert.assertEquals(Long.toString(value), message.readString());
}
Aggregations