recv.getStringProperty("String").equals("31415926535897932384626433832795"));
}
public void testBytesMessage() throws Exception
{
log.info("+++ testBytesMessage");
BytesMessage sent = session.createBytesMessage();
sent.writeBoolean(true);
sent.writeByte((byte) 1);
byte[] testBytes = "Bytes".getBytes();
sent.writeBytes(testBytes);
sent.writeChar('c');
sent.writeShort((short) 31415);
sent.writeInt(314159);
sent.writeLong(3141592653589793238L);
sent.writeDouble(3.1415926535897932384626433832795);
sent.writeFloat(3.141f);
sent.writeObject("31415926535897932384626433832795");
sent.writeUTF("31415926535897932384626433832795");
BytesMessage recv = (BytesMessage) sendRecMsg(sent);
log.debug("recv: "+recv);
assertTrue("Boolean == true", recv.readBoolean() == true);
assertTrue("Byte == 1", recv.readByte() == 1);
byte[] bytes = new byte[testBytes.length];
recv.readBytes(bytes);
assertTrue("Bytes == Bytes[]",
Arrays.equals(bytes, testBytes));
assertTrue("Char == c", recv.readChar() == 'c');
assertTrue("Short == 314159", recv.readShort() == 31415);
assertTrue("Int == 314159", recv.readInt() == 314159);
assertTrue("Long == 3141592653589793238L",
recv.readLong() == 3141592653589793238L);
assertTrue("Double == 3.1415926535897932384626433832795",
recv.readDouble() == 3.1415926535897932384626433832795);
assertTrue("Float == true", recv.readFloat() == 3.141f);
assertTrue("Object == 31415926535897932384626433832795",
recv.readUTF().equals("31415926535897932384626433832795"));
assertTrue("String == 31415926535897932384626433832795",
recv.readUTF().equals("31415926535897932384626433832795"));
}