Package net.timewalker.ffmq3.common.message

Examples of net.timewalker.ffmq3.common.message.StreamMessageImpl.writeBytes()


    try { msg.readFloat(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Double
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    try { msg.readDouble(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // String
View Full Code Here


    try { msg.readDouble(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // String
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    try { msg.readUTF(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Bytes
View Full Code Here

    try { msg.readUTF(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Bytes
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    byte[] data = new byte[3];
    assertEquals(3,msg.readBytes(data));
    System.out.println(data[0]);
    assertEquals(1, data[0]);
View Full Code Here

        msg.writeShort((short)2);
        msg.writeInt(3);
        msg.writeLong(4);
        msg.writeFloat(1.23f);
        msg.writeDouble(4.56);
        msg.writeBytes(createDummyByteArray(size));
       
        return msg;
    }
   
    public static TextMessageImpl createTextMessage( int size ) throws JMSException
View Full Code Here

   
    byte[] dummy = { (byte)1 , (byte)2 , (byte)3 };
   
    // Boolean
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
    try { msg.readBoolean(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Byte
View Full Code Here

    try { msg.readBoolean(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Byte
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
    try { msg.readByte(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Short
View Full Code Here

    try { msg.readByte(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Short
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
    try { msg.readShort(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Char
View Full Code Here

    try { msg.readShort(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Char
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
    try { msg.readChar(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Int
View Full Code Here

    try { msg.readChar(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Int
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
    try { msg.readInt(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Long
View Full Code Here

    try { msg.readInt(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Long
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
    try { msg.readLong(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Float
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.