public double readDouble() throws JMSException { return ((BytesMessage) message).readDouble(); }
@Override public double readDouble() throws JMSException { return message.readDouble(); }
public double readDouble() throws JMSException { return ((BytesMessage) message).readDouble(); }
/** * Read * @return The value * @exception JMSException Thrown if an error occurs */ public double readDouble() throws JMSException { if (_log.isTraceEnabled()) { _log.trace("readDouble()"); } return ((BytesMessage)_message).readDouble(); }
/** * Read * * @return The value * @throws JMSException Thrown if an error occurs */ @Override public double readDouble() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("readDouble()"); } return ((BytesMessage) message).readDouble(); }
/** * Read * * @return The value * @throws JMSException Thrown if an error occurs */ @Override public double readDouble() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("readDouble()"); } return ((BytesMessage) message).readDouble(); }
values[i] = Float.valueOf(message.readFloat()); } else if (double.class.equals(parameterType)) { values[i] = message.readDouble(); } else if (Double.class.equals(parameterType)) { values[i] = Double.valueOf(message.readDouble()); } else if (String.class.equals(parameterType)) { final int bufLen = message.readInt();
values[i] = Float.valueOf(message.readFloat()); } else if (double.class.equals(parameterType)) { values[i] = message.readDouble(); } else if (Double.class.equals(parameterType)) { values[i] = Double.valueOf(message.readDouble()); } else if (String.class.equals(parameterType)) { final int bufLen = message.readInt();
/** * Send a <code>BytesMessage</code> with 2 Java primitives in its body (a <code> * String</code> and a <code>double</code>). * <br /> * Receive it and test that the values of the primitives of the body are correct */ public void testBytesMessage_2() { try { byte[] bytes = new String("pi").getBytes(); BytesMessage message = senderSession.createBytesMessage(); message.writeBytes(bytes); message.writeDouble(3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); assertTrue("The message should be an instance of BytesMessage.\n", m instanceof BytesMessage); BytesMessage msg = (BytesMessage) m; byte[] receivedBytes = new byte[bytes.length]; msg.readBytes(receivedBytes); assertEquals(new String(bytes), new String(receivedBytes)); assertEquals(3.14159, msg.readDouble(), 0); } catch (JMSException e) { fail(e); } }
return doubleMessage.readDouble(); case FLOAT: if (!(message instanceof BytesMessage)) {
/** * Send a <code>BytesMessage</code> with 2 Java primitives in its body (a <code> * String</code> and a <code>double</code>). * <br /> * Receive it and test that the values of the primitives of the body are correct */ @Test public void testBytesMessage_2() { try { byte[] bytes = new String("pi").getBytes(); BytesMessage message = senderSession.createBytesMessage(); message.writeBytes(bytes); message.writeDouble(3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); Assert.assertTrue("The message should be an instance of BytesMessage.\n", m instanceof BytesMessage); BytesMessage msg = (BytesMessage) m; byte[] receivedBytes = new byte[bytes.length]; msg.readBytes(receivedBytes); Assert.assertEquals(new String(bytes), new String(receivedBytes)); Assert.assertEquals(3.14159, msg.readDouble(), 0); } catch (JMSException e) { fail(e); } }
@Override protected void assertEquivalent(final Message m, final int mode, final boolean redelivered) throws JMSException { super.assertEquivalent(m, mode, redelivered); BytesMessage bm = (BytesMessage) m; ProxyAssertSupport.assertEquals(true, bm.readBoolean()); ProxyAssertSupport.assertEquals((byte) 3, bm.readByte()); byte[] bytes = new byte[3]; bm.readBytes(bytes); ProxyAssertSupport.assertEquals((byte) 4, bytes[0]); ProxyAssertSupport.assertEquals((byte) 5, bytes[1]); ProxyAssertSupport.assertEquals((byte) 6, bytes[2]); ProxyAssertSupport.assertEquals((char) 7, bm.readChar()); ProxyAssertSupport.assertEquals(new Double(8.0), new Double(bm.readDouble())); ProxyAssertSupport.assertEquals(new Float(9.0), new Float(bm.readFloat())); ProxyAssertSupport.assertEquals(10, bm.readInt()); ProxyAssertSupport.assertEquals(11L, bm.readLong()); ProxyAssertSupport.assertEquals((short) 12, bm.readShort()); ProxyAssertSupport.assertEquals("this is an UTF String", bm.readUTF()); }
m.readDouble(); ProxyAssertSupport.fail(); } catch (javax.jms.MessageNotReadableException e) { ProxyAssertSupport.assertEquals(myLong, m2.readLong()); ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0); ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0); ProxyAssertSupport.assertEquals(myString, m2.readUTF()); ProxyAssertSupport.assertEquals(myLong, m2.readLong()); ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0); ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0); ProxyAssertSupport.assertEquals(myString, m2.readUTF()); m2.readDouble(); ProxyAssertSupport.fail(); } catch (MessageEOFException e) {