Package org.apache.etch.bindings.java.msg

Examples of org.apache.etch.bindings.java.msg.Message


//    System.out.printf( "x.id() = %04x\n", x.getId() );
//    System.out.printf( "y.id() = %04x\n", y.getId() );
//    System.out.printf( "_mf__messageId.id() = %04x\n", _mf__messageId.getId() );
//    System.out.printf( "msgid = %08x\n", msgid );
   
    Message msg = new Message( add, vf );
    msg.put( x, 123456789 );
    msg.put( y, 876543210 );
    msg.put( _mf__messageId, msgid );
//    System.out.println( "msg = "+msg );
   
    Resources res = new Resources();
    res.put( Transport.VALUE_FACTORY, vf );
    MyPacketSource ps = new MyPacketSource();
View Full Code Here


   
    int[] array = new int[2];
    for (int i = 0; i < array.length; i++)
      array[i] = 123456789;
   
    Message msg = new Message( sum, vf );
    msg.put( values, array );
    msg.put( _mf__messageId, msgid );
//    System.out.println( "msg = "+msg );
   
    Resources res = new Resources();
    res.put( Transport.VALUE_FACTORY, vf );
    MyPacketSource ps = new MyPacketSource();
View Full Code Here

 
  /** @throws Exception */
  @Test
  public void badtype() throws Exception
  {
    @SuppressWarnings("unused")
    Message msg = bytes2msg( new byte[] { 3, 1, 0, -127 } );
//    System.out.println( "msg = "+msg );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void badmsglen1() throws Exception
  {
    @SuppressWarnings("unused")
    Message msg = bytes2msg( new byte[] { 3, 1, -1, -127 } );
//    System.out.println( "msg = "+msg );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test( expected = IllegalArgumentException.class )
  public void badmsglen2() throws Exception
  {
    @SuppressWarnings("unused")
    Message msg = bytes2msg( new byte[] { 3, 1, 99, -127 } );
//    System.out.println( "msg = "+msg );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test
  public void badfield() throws Exception
  {
    @SuppressWarnings("unused")
    Message msg = bytes2msg( new byte[] { 3, 1, 1, 2, 2, -127 }, Level.MISSING_OK );
//    System.out.println( "msg = "+msg );
  }
View Full Code Here

  {
    Type t = new Type( 1, "a" );
    Field f = new Field( 2, "b" );
    t.putValidator( f, Validator_object.get( 0 ) );
   
    Message msg = new Message( t, vf );
    msg.put( f, value );
//    System.out.println( "msg = "+msg );
   
    BinaryTaggedDataOutput btdo = new BinaryTaggedDataOutput( vf, "none:" );
    FlexBuffer buf = new FlexBuffer();
   
View Full Code Here

//    System.out.println( "-----------------------------------------" );
   
    mt_foo.clearValidator( mf_x );
    mt_foo.putValidator( mf_x, v );
   
    Message msg = new Message( mt_foo, vf );
    msg.put( mf_x, x );
//    System.out.println( "msg = "+msg );
   
    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

  /** @throws Exception */
  @Test
  public void message1() throws Exception
  {
    Message msg = new Message( MyValueFactory.mt_add, vf );
    transport.header_size = 0;
   
    assertNull( transport.what );
   
    m.transportMessage( who, msg );
View Full Code Here

  /** @throws Exception */
  @Test
  public void message2() throws Exception
  {
    Message msg = new Message( MyValueFactory.mt_add_result, vf );
    transport.header_size = 8;
   
    assertNull( transport.what );
   
    m.transportMessage( who, msg );
View Full Code Here

TOP

Related Classes of org.apache.etch.bindings.java.msg.Message

Copyright © 2018 www.massapicom. 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.