237238239240241242243244245246247
public void testReadChar() { ActiveMQStreamMessage msg = new ActiveMQStreamMessage(); try { char test = 'z'; msg.writeChar(test); msg.reset(); assertTrue(msg.readChar() == test); msg.reset(); assertTrue(msg.readString().equals(new Character(test).toString())); msg.reset(); try {
239240241242243244245246247248249
try { char test = 'z'; msg.writeChar(test); msg.reset(); assertTrue(msg.readChar() == test); msg.reset(); assertTrue(msg.readString().equals(new Character(test).toString())); msg.reset(); try { msg.readBoolean(); fail("Should have thrown exception");
241242243244245246247248249250251
msg.writeChar(test); msg.reset(); assertTrue(msg.readChar() == test); msg.reset(); assertTrue(msg.readString().equals(new Character(test).toString())); msg.reset(); try { msg.readBoolean(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
247248249250251252253254255256257
try { msg.readBoolean(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readByte(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
253254255256257258259260261262263
try { msg.readByte(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readShort(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
259260261262263264265266267268269
try { msg.readShort(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readInt(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
265266267268269270271272273274275
try { msg.readInt(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readLong(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
271272273274275276277278279280281
try { msg.readLong(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readFloat(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
277278279280281282283284285286287
try { msg.readFloat(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readDouble(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }
283284285286287288289290291292293
try { msg.readDouble(); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { } msg.reset(); try { msg.readBytes(new byte[1]); fail("Should have thrown exception"); } catch (MessageFormatException mfe) { }