102103104105106107108109110111112
} public void testWriteInt() throws Exception { JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage(); bm.writeInt(10); bm.reset(); int val = bm.readInt(); assertTrue(val == 10); }
366367368369370371372373374375376
public void testEOFInt() throws Exception { try { JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage(); bm.writeInt(99); bm.reset(); bm.readInt(); // should throw bm.readInt(); fail("expected exception did not occur");
538539540541542543544545546547548
} public void testIntConversions() throws Exception { JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage(); bm.writeInt(167); bm.reset(); assertEquals(167, bm.readLong()); bm.reset(); assertEquals("167", bm.readString()); bm.reset();
367368369370371372373374375376377
539540541542543544545546547548549
6465666768697071727374
public void testResetMakesReadble() throws Exception { try { JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage(); bm.writeInt(10); bm.reset(); bm.writeInt(12); fail("expected exception did not occur"); } catch (MessageNotWriteableException m)
6667686970717273747576
try { JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage(); bm.writeInt(10); bm.reset(); bm.writeInt(12); fail("expected exception did not occur"); } catch (MessageNotWriteableException m) { // ok
8283848586878889909192
} public void testClearBodyMakesWritable() throws Exception { JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage(); bm.writeInt(10); bm.reset(); bm.clearBody(); bm.writeInt(10); }
8586878889909192939495
{ JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage(); bm.writeInt(10); bm.reset(); bm.clearBody(); bm.writeInt(10); } public void testWriteBoolean() throws Exception { JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
103104105106107108109110111112113