Package net.timewalker.ffmq3.common.message

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


    {
        StreamMessageImpl msg = new StreamMessageImpl();
        setDummyProperties(msg);
       
        msg.writeBoolean(true);
        msg.writeString("foobar");
        msg.writeChar('c');
        msg.writeByte((byte)1);
        msg.writeShort((short)2);
        msg.writeInt(3);
        msg.writeLong(4);
View Full Code Here


  {
    StreamMessageImpl msg;
   
    // Boolean
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    assertFalse(msg.readBoolean());
   
    // Byte
    msg = new StreamMessageImpl();
View Full Code Here

    msg.markAsReadOnly();
    assertFalse(msg.readBoolean());
   
    // Byte
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readByte(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */  }
    assertEquals("foobar",msg.readString());
   
    // Short
View Full Code Here

    try { msg.readByte(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */  }
    assertEquals("foobar",msg.readString());
   
    // Short
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readShort(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */  }
    assertEquals("foobar",msg.readString());
   
    // Char
View Full Code Here

    try { msg.readShort(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */  }
    assertEquals("foobar",msg.readString());
   
    // Char
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readChar(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals("foobar",msg.readString());
   
    // Int
View Full Code Here

    try { msg.readChar(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals("foobar",msg.readString());
   
    // Int
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readInt(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // Long
View Full Code Here

    try { msg.readInt(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // Long
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readLong(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // Float
View Full Code Here

    try { msg.readLong(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // Float
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readFloat(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // Double
View Full Code Here

    try { msg.readFloat(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // Double
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readDouble(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // String
View Full Code Here

    try { msg.readDouble(); fail("Should have failed"); } catch (NumberFormatException e) { /* OK */ }
    assertEquals("foobar",msg.readString());
   
    // String
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    assertEquals("foobar",msg.readString());
   
    // Bytes
    msg = new StreamMessageImpl();
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.