481482483484485486487488489490491
public void testReadDouble() { ActiveMQStreamMessage msg = new ActiveMQStreamMessage(); try { double test = 4.4d; msg.writeDouble(test); msg.reset(); assertTrue(msg.readDouble() == test); msg.reset(); assertTrue(msg.readString().equals(new Double(test).toString())); msg.reset(); try {
483484485486487488489490491492493
try { double test = 4.4d; msg.writeDouble(test); msg.reset(); assertTrue(msg.readDouble() == test); msg.reset(); assertTrue(msg.readString().equals(new Double(test).toString())); msg.reset(); try { msg.readBoolean(); fail("Should have thrown exception");
485486487488489490491492493494495
msg.writeDouble(test); msg.reset(); assertTrue(msg.readDouble() == test); msg.reset(); assertTrue(msg.readString().equals(new Double(test).toString())); msg.reset(); try { msg.readBoolean(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
491492493494495496497498499500501
try { msg.readBoolean(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readByte(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
497498499500501502503504505506507
try { msg.readByte(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readShort(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
503504505506507508509510511512513
try { msg.readShort(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readInt(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
509510511512513514515516517518519
try { msg.readInt(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readLong(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
515516517518519520521522523524525
try { msg.readLong(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readFloat(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
521522523524525526527528529530531
try { msg.readFloat(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readChar(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
527528529530531532533534535536537
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) { }