Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.Message.checkType()


      int timeout = disableTimeout ? 0 : responseType.getTimeout();
      Mailbox.Element mbe = mb.read( timeout);
      if (mbe == null)
        throw new TimeoutException( "timeout waiting for "+responseType );
      Message rmsg = mbe.msg;
      rmsg.checkType( responseType );
      Object r = rmsg.get( responseType.getResponseField() );
      if (r instanceof Exception)
      {
        Exception e = (Exception) r;
        e.fillInStackTrace();
View Full Code Here


      21, 10, 44, -77, // x
      1, // tiny int = 1 (value)
      -127 // NONE
    };
    Message msg = bytes2msg( buf );
    msg.checkType( add );
    Assert.assertEquals( 3, msg.size() );
    Assert.assertEquals( 1, msg.get( x ) );
    Assert.assertEquals( 2, msg.get( y ) );
    Assert.assertEquals( msgid, msg.get( _mf__messageId ) );
   
View Full Code Here

      -122, // INT (value)
      59, -102, -54, 0,
      -127 // NONE
    };
    msg = bytes2msg( buf );
    msg.checkType( add );
    Assert.assertEquals( 3, msg.size() );
    Assert.assertEquals( 1000000000, msg.get( x ) );
    Assert.assertEquals( 2000000000, msg.get( y ) );
    Assert.assertEquals( msgid, msg.get( _mf__messageId ) );
  }
View Full Code Here

    byte[] bufx = msg2bytes( msg, stringTypeAndField );
//    dump( bufx );
    Message msg2 = bytes2msg( bufx );
   
//    System.out.println( "msg2 = "+msg2 );
    msg2.checkType( mt_foo );
    Assert.assertEquals( 1, msg2.size() );
    Assert.assertTrue( msg.containsKey( mf_x ) );
    Object y = msg2.get( mf_x );
   
    assertEquals( x, y );
View Full Code Here

      int timeout = disableTimeout ? 0 : responseType.getTimeout();
      Mailbox.Element mbe = mb.read( timeout);
      if (mbe == null)
        throw new TimeoutException( "timeout waiting for "+responseType );
      Message rmsg = mbe.msg;
      rmsg.checkType( responseType );
      Object r = rmsg.get( responseType.getResponseField() );
      if (r instanceof Exception)
      {
        Exception e = (Exception) r;
        e.fillInStackTrace();
View Full Code Here

  /** @throws Exception */
  @Test
  public void newMessage() throws Exception
  {
    Message msg = remote._newMessage( mt );
    msg.checkType( mt );
    assertSame( vf, msg.vf() );
  }

  /** @throws Exception */
  @Test
 
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.