assertEquals(3, bytes[1]);
}
public void testWriteObject() throws Exception
{
JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
bm.writeObject(new Boolean(true));
bm.writeObject(new Boolean(false));
bm.writeObject(new Byte((byte)2));
bm.writeObject(new byte[]{1,2,3,4});
bm.writeObject(new Character('g'));
bm.writeObject(new Short((short) 29));
bm.writeObject(new Integer(101));
bm.writeObject(new Long(50003222L));
bm.writeObject("Foobar");
bm.writeObject(new Float(1.7f));
bm.writeObject(new Double(8.7d));
bm.reset();
assertTrue(bm.readBoolean());
assertTrue(!bm.readBoolean());
assertEquals((byte)2, bm.readByte());
byte[] bytes = new byte[4];
bm.readBytes(bytes);
assertEquals('g', bm.readChar());
assertEquals((short) 29, bm.readShort());
assertEquals(101, bm.readInt());
assertEquals(50003222L, bm.readLong());
assertEquals("Foobar", bm.readUTF());
assertEquals(1.7f, bm.readFloat());
assertEquals(8.7d, bm.readDouble());
}