Examples of readFloat()


Examples of org.apache.qpid.client.message.JMSStreamMessage.readFloat()

        assertEquals('g', bm.readChar());
        assertEquals((short) 29, bm.readShort());
        assertEquals(101, bm.readInt());
        assertEquals(50003222L, bm.readLong());
        assertEquals("Foobar", bm.readString());
        assertEquals(1.7f, bm.readFloat());
        assertEquals(8.7d, bm.readDouble());
    }

    public void testWriteObjectRejectsNonPrimitives() throws Exception
    {
View Full Code Here

Examples of org.apache.qpid.proton.TestDecoder.readFloat()

        assertEquals(-42, d.readShort().intValue());
        assertEquals(12345, d.readUnsignedInteger().intValue());
        assertEquals(-12345, d.readInteger().intValue());
        assertEquals(12345, d.readUnsignedLong().longValue());
        assertEquals(-12345, d.readLong().longValue());
        assertEquals(0.125, d.readFloat().floatValue(), 0e-10);
        assertEquals(0.125, d.readDouble().doubleValue(), 0e-10);
    }

    @Test
    public void testStrings() throws IOException
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQBytesMessage.readFloat()

  public void testReadFloat() {
    ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
    try {
      msg.writeFloat(3.3f);
      msg.reset();
      assertTrue(msg.readFloat() == 3.3f);
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQStreamMessage.readFloat()

    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    try {
      float test = 4.4f;
      msg.writeFloat(test);
      msg.reset();
      assertTrue(msg.readFloat()==test);
      msg.reset();
      assertTrue(msg.readDouble()==test);
      msg.reset();
      assertTrue(msg.readString().equals(new Float(test).toString()));
    }catch(JMSException jmsEx){
View Full Code Here

Examples of org.elasticsearch.common.io.stream.BytesStreamInput.readFloat()

        assertThat(in.readShort(), equalTo((short) -1));
        assertThat(in.readInt(), equalTo(-1));
        assertThat(in.readVInt(), equalTo(2));
        assertThat(in.readLong(), equalTo((long) -3));
        assertThat(in.readVLong(), equalTo((long) 4));
        assertThat((double) in.readFloat(), closeTo(1.1, 0.0001));
        assertThat(in.readDouble(), closeTo(2.2, 0.0001));
        assertThat(in.readUTF(), equalTo("hello"));
        assertThat(in.readUTF(), equalTo("goodbye"));
    }
}
View Full Code Here

Examples of org.hornetq.core.client.impl.LargeMessageBufferImpl.readFloat()

      LargeMessageBufferImpl readBuffer = splitBuffer(3, dynamic.toByteBuffer().array());

      Assert.assertEquals(str1, readBuffer.readUTF());
      Assert.assertEquals(str2, readBuffer.readString());
      Assert.assertEquals(d1, readBuffer.readDouble());
      Assert.assertEquals(f1, readBuffer.readFloat());
   }

   private File getTestFile()
   {
      return new File(getTestDir(), "temp." + tmpFileCounter + ".file");
View Full Code Here

Examples of org.hornetq.core.client.impl.LargeMessageControllerImpl.readFloat()

      LargeMessageControllerImpl readBuffer = splitBuffer(3, dynamic.toByteBuffer().array());

      Assert.assertEquals(str1, readBuffer.readUTF());
      Assert.assertEquals(str2, readBuffer.readString());
      Assert.assertEquals(d1, readBuffer.readDouble());
      Assert.assertEquals(f1, readBuffer.readFloat());
   }

   private File getTestFile()
   {
      return new File(getTestDir(), "temp." + tmpFileCounter + ".file");
View Full Code Here

Examples of org.hornetq.jms.client.HornetQStreamMessage.readFloat()

      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeFloat(value);
      message.reset();

      Assert.assertEquals(value, message.readFloat());
   }

   public void testReadFloatFromString() throws Exception
   {
      float value = RandomUtil.randomFloat();
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readFloat()

    assertEquals(0x42, buffer.readUnsignedByte());
    assertEquals(0x12345678, buffer.readInt());

    assertEquals(0x63, buffer.readUnsignedByte());
    assertEquals(1234.5678F, buffer.readFloat(), 0);

    assertEquals(0x84, buffer.readUnsignedByte());
    assertEquals("test", ChannelBufferUtils.readString(buffer));

    assertEquals(0xA5, buffer.readUnsignedByte());
View Full Code Here

Examples of org.jgroups.util.ByteArrayDataInputStream.readFloat()

        float[] numbers={-322649.25f, 100.7531f, 0f, 1f, 2.75f, 3.1425f, 322649f, 322649.75f};
        for(float i: numbers)
            out.writeFloat(i);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        for(float i: numbers) {
            float num=in.readFloat();
            assert num == i;
        }
    }

    public void testDouble() throws IOException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.