359360361362363364365366367368369
public void testReadLong() { ActiveMQStreamMessage msg = new ActiveMQStreamMessage(); try { long test = 4l; msg.writeLong(test); msg.reset(); assertTrue(msg.readLong() == test); msg.reset(); assertTrue(msg.readString().equals(new Long(test).toString())); msg.reset(); try {
361362363364365366367368369370371
try { long test = 4l; msg.writeLong(test); msg.reset(); assertTrue(msg.readLong() == test); msg.reset(); assertTrue(msg.readString().equals(new Long(test).toString())); msg.reset(); try { msg.readBoolean(); fail("Should have thrown exception");
363364365366367368369370371372373
msg.writeLong(test); msg.reset(); assertTrue(msg.readLong() == test); msg.reset(); assertTrue(msg.readString().equals(new Long(test).toString())); msg.reset(); try { msg.readBoolean(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
369370371372373374375376377378379
try { msg.readBoolean(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readByte(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
375376377378379380381382383384385
try { msg.readByte(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readShort(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
381382383384385386387388389390391
try { msg.readShort(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readInt(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
387388389390391392393394395396397
try { msg.readInt(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readFloat(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
393394395396397398399400401402403
try { msg.readFloat(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readDouble(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
399400401402403404405406407408409
try { msg.readDouble(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readChar(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
405406407408409410411412413414415
try { msg.readChar(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readBytes(new byte[1]); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }