454455456457458459460461462463464
public void testEOFShort() throws Exception { try { JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage(); bm.writeShort((short)4); bm.reset(); bm.readShort(); // should throw bm.readShort(); fail("expected exception did not occur");
476477478479480481482483484485486
public void testEOFUnsignedShort() throws Exception { try { JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage(); bm.writeShort((short)4); bm.reset(); bm.readUnsignedShort(); // should throw bm.readUnsignedShort(); fail("expected exception did not occur");
209210211212213214215216217218219
} public void testReadUnsignedShort() throws Exception { JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage(); bm.writeShort((byte) 9); bm.reset(); int result = bm.readUnsignedShort(); assertEquals(9, result); }
191192193194195196197198199200201
@Test(expected=MessageEOFException.class) public void testEOFShort() throws Exception { JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage(); bm.writeShort((short)4); bm.reset(); bm.readShort(); // should throw bm.readShort(); }
202203204205206207208209210211212
@Test(expected=MessageEOFException.class) public void testEOFUnsignedShort() throws Exception { JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage(); bm.writeShort((short)4); bm.reset(); bm.readUnsignedShort(); // should throw bm.readUnsignedShort(); }
453454455456457458459460461462463
475476477478479480481482483484485
208209210211212213214215216217218