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

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


  {
//    System.out.println( "---------------------------------------------" );
//    System.out.println( "url = "+url );

    ValueFactory vf = new DummyValueFactory();
    Type type = new Type( "url" );
    Class2TypeMap class2type = new Class2TypeMap();
    URLSerializer.init( type, class2type );
    ImportExportHelper helper = type.getImportExportHelper();
   
    StructValue sv = helper.exportValue( vf, url );
//    System.out.println( "sv = "+sv );
   
    assertEquals( sv.type(), type );
View Full Code Here


 
  /** @throws Exception */
  @Test
  public void constructor2() throws Exception
  {
    Type t1 = new Type( "t1" );
    ArrayValue av = new ArrayValue( new byte[0], (byte) 1, t1, 2 );
    assertEquals( (byte) 1, av.typeCode() );
    assertEquals( t1, av.customStructType() );
    assertEquals( 2, av.dim() );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test
  public void constructor3() throws Exception
  {
    Type t2 = new Type( "t2" );
    ArrayValue av = new ArrayValue( new byte[0], (byte) 3, t2, 4 );
    assertEquals( (byte) 3, av.typeCode() );
    assertEquals( t2, av.customStructType() );
    assertEquals( 4, av.dim() );
  }
View Full Code Here

 
 
  private Message constructMessage() throws Exception
  {
   
    Type mt_request = new Type( "_Etch_Logger_Test" );
   
   
    Type mt_response = new Type( "_Etch_Logger_Test_Resp" );
     
    mt_request.setResult( mt_response );
   
    vf.addType( mt_request);
   
View Full Code Here

    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 );

    Type mt_response = new Type( "_Etch_KeepAliveResp" );
    vf1.addType( mt_response );
   
    mt_request.setResult( mt_response );
   
    Message msg = new Message( mt_request, vf1 );
View Full Code Here

  /** @throws Exception */
  @Test
  public void getField_locked() throws Exception
  {
    Type type = new Type( "blah" );
    assertNotNull( type.getField( "a" ) );
    assertNotNull( type.getField( "b" ) );
    type.lock();
    assertNotNull( type.getField( "a" ) );
    assertNotNull( type.getField( "b" ) );
    assertNull( type.getField( "x" ) );
    assertNull( type.getField( "y" ) );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test
  public void messageId() throws Exception
  {
    Type mt_foo = new Type( "foo" );
    mt_foo.putValidator( DefaultValueFactory._mf__messageId, Validator_long.get( 0 ) );
   
    Message msg = new Message( mt_foo, vf );
   
    assertNull( vf.getMessageId( msg ) );
   
View Full Code Here

TOP

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

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.