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

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


    assertTrue( session.up );
   
    assertSame( What.TRANSPORT_MESSAGE, transport.what );
    Message msg = transport.msg;
    assertEquals( "_Etch_PwAuthReq", msg.type().getName() );
    assertEquals( "mary", msg.get( new Field( "user" ) ) );
    assertEquals( "3456", msg.get( new Field( "password" ) ) );
  }
View Full Code Here


   */
  @Test public void test_add() throws Exception
  {
    Type add = vf.getType( "add" );
   
    Field x = new Field( "x" );
    add.putValidator( x, Validator_int.get( 0 ) );
   
    Field y = new Field( "y" );
    add.putValidator( y, Validator_int.get( 0 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    add.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0102030405060708L;
   
//    System.out.printf( "add.id() = %04x\n", add.getId() );
View Full Code Here

   * @throws Exception */
  @Test public void test_add_in() throws Exception
  {
    Type add = vf.getType( "add" );
   
    Field x = new Field( "x" );
    add.putValidator( x, Validator_int.get( 0 ) );
   
    Field y = new Field( "y" );
    add.putValidator( y, Validator_int.get( 0 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    add.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0123456789abcdefL;

    byte[] buf =
View Full Code Here

   * @throws Exception */
  @Test public void test_add_perf() throws Exception
  {
    Type add = vf.getType( "add" );
   
    Field x = new Field( "x" );
    add.putValidator( x, Validator_int.get( 0 ) );
   
    Field y = new Field( "y" );
    add.putValidator( y, Validator_int.get( 0 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    add.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0123456789abcdefL;
   
//    System.out.printf( "add.id() = %04x\n", add.getId() );
View Full Code Here

   * @throws Exception */
  @Test public void test_sum_perf() throws Exception
  {
    Type sum = vf.getType( "sum" );
   
    Field values = new Field( "values" );
    sum.putValidator( values, Validator_int.get( 1 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    sum.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0123456789abcdefL;
   
//    System.out.printf( "add.id() = %04x\n", add.getId() );
View Full Code Here

  }
 
  private void assertValueToBytes( Object value, byte[] expectedBytes ) throws Exception
  {
    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 );
View Full Code Here

  /** Field for result */
  public static Field _mf_result;

  private static void initFields()
  {
    _mf_code = new Field( "code" );
    _mf_msg = new Field( "msg" );
    _mf_req = new Field( "req" );
    _mf_result = new Field( "result" );

    _mt_etch_examples_cuae_CuaeClient__result_doit1.setResponseField( _mf_result );
    _mt_etch_examples_cuae_CuaeServer__result_doit2.setResponseField( _mf_result );
    _mt_etch_examples_cuae_Cuae__result_doit3.setResponseField( _mf_result );
    _mt_etch_examples_cuae_Cuae__result_doit4.setResponseField( _mf_result );
View Full Code Here

    Thread.sleep( 5000 );    
//    System.out.println("Out of sleep");
    assertSame( What.TRANSPORT_MESSAGE, transport.what );
    Message msg = transport.msg;
    assertEquals( "_Etch_KeepAliveReq", msg.type().getName() );
    assertEquals( 4, msg.get( new Field( "count" ) ) );
    assertEquals( 3, msg.get( new Field( "delay" ) ) );
  }
View Full Code Here

    Thread.sleep( 4000 );    
//    System.out.println("Out of sleep");
    assertSame( What.TRANSPORT_MESSAGE, transport.what );
    Message msg = transport.msg;
    assertEquals( "_Etch_KeepAliveReq", msg.type().getName() );
    assertEquals( 4, msg.get( new Field( "count" ) ) );
    assertEquals( 2, msg.get( new Field( "delay" ) ) );
  }
View Full Code Here

    int delay = 15;
    int count = 4;
   
    MyValueFactory vf1 = new MyValueFactory( "tcp:" );
   
    Field mf_delay = new Field( "delay" );
    Field mf_count = new Field( "count" );
   
    Type mt_request = new Type( "_Etch_KeepAliveReq" );
    mt_request.putValidator( mf_delay, Validator_int.get( 0 ) );
    mt_request.putValidator( mf_count, Validator_int.get( 0 ) );
    vf1.addType( mt_request );
View Full Code Here

TOP

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

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.