Package net.timewalker.ffmq3.common.message

Examples of net.timewalker.ffmq3.common.message.BytesMessageImpl.readBytes()


   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeBoolean(true);
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertTrue(msg.readBoolean());
  }

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


   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeByte((byte)123);
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(123,msg.readByte());
  }
 
  public void testShortConversion() throws Exception
  {
View Full Code Here

   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeShort((short)123);
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(123,msg.readShort());
  }
 
  public void testCharConversion() throws Exception
  {
View Full Code Here

   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeChar('c');
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals('c',msg.readChar());
  }
 
  public void testIntConversion() throws Exception
  {
View Full Code Here

   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeInt(123);
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(123,msg.readInt());
  }
 
  public void testLongConversion() throws Exception
  {
View Full Code Here

   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeString("foobar");
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals("foobar",msg.readString());
  }
 
  public void testNumericStringConversion() throws Exception
  {
View Full Code Here

   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeString("123");
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals("123",msg.readString());
  }
 
  public void testBytesConversion() throws Exception
  {
View Full Code Here

    // 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
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
View Full Code Here

    // 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
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
View Full Code Here

    // 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
    msg = new StreamMessageImpl();
    msg.writeBytes(dummy);
    msg.markAsReadOnly();
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.