201202203204205206207208209210211
StreamMessage message = session.createStreamMessage(); message.writeString(text); message.writeInt(i); message.writeDouble(d); message.reset(); AbstractJmsTransformer trans = createObject(JMSMessageToObject.class); Object transformedObject = trans.transform(message); assertTrue("Transformed object should be a List", transformedObject instanceof List);
367368369370371372373374375376377
} } else if (message instanceof StreamMessage) { StreamMessage sMsg = (StreamMessage) message; sMsg.reset(); ByteArrayOutputStream baos = new ByteArrayOutputStream(4096); byte[] buffer = new byte[4096]; int len;
15451546154715481549155015511552155315541555
} catch (javax.jms.MessageNotWriteableException e) { } m2.reset(); // check we go back to the beginning ProxyAssertSupport.assertEquals(myBool, m2.readBoolean()); ProxyAssertSupport.assertEquals(myByte, m2.readByte()); ProxyAssertSupport.assertEquals(myShort, m2.readShort());
15721573157415751576157715781579158015811582
{ } m2.writeBoolean(myBool); m2.reset(); ProxyAssertSupport.assertEquals(myBool, m2.readBoolean()); try { m2.readBoolean();
14481449145014511452145314541455145614571458
fail(); } catch (javax.jms.MessageNotWriteableException e) { } m2.reset(); // check we go back to the beginning assertEquals(myBool, m2.readBoolean()); assertEquals(myByte, m2.readByte()); assertEquals(myShort, m2.readShort());
14741475147614771478147914801481148214831484
{ } m2.writeBoolean(myBool); m2.reset(); assertEquals(myBool, m2.readBoolean()); try { m2.readBoolean();
103104105106107108109110111112113
{ super.assertEquivalent(m, mode, redelivery); StreamMessage sm = (StreamMessage)m; sm.reset(); assertEquals(true, sm.readBoolean()); assertEquals((byte)3, sm.readByte()); byte[] bytes = new byte[3]; sm.readBytes(bytes);
146147148149150151152153154155156
msg.setObject(objMsg.getObject()); msg.storeContent(); activeMessage = msg; } else if (message instanceof StreamMessage) { StreamMessage streamMessage = (StreamMessage)message; streamMessage.reset(); ActiveMQStreamMessage msg = new ActiveMQStreamMessage(); msg.setConnection(connection); Object obj = null; try {