Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.Type


 
  /** @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

  {
//    System.out.println( "---------------------------------------------" );
//    System.out.println( "map = "+map );
   
    ValueFactory vf = new DummyValueFactory();
    Type type = new Type( "map" );
    Class2TypeMap class2type = new Class2TypeMap();
    StrStrHashMapSerializer.init( type, class2type );
    ImportExportHelper helper = type.getImportExportHelper();
   
    StructValue sv = helper.exportValue( vf, map );
//    System.out.println( "sv = "+sv );
   
    assertEquals( sv.type(), type );
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

  {
//    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 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

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

//    testbadvalue( 0, 5.5f ); good!
    testbadvalue( 0, 6.6 );
    testbadvalue( 0, "" );
    testbadvalue( 0, "abc" );
    testbadvalue( 0, new Object() );
    testbadvalue( 0, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 0, new Date() );

    testbadvalue( 1, null );
    testbadvalue( 1, false );
    testbadvalue( 1, true );
    testbadvalue( 1, (byte) 1 );
    testbadvalue( 1, (short) 2222 );
    testbadvalue( 1, 333333 );
    testbadvalue( 1, 4444444444444444L );
    testbadvalue( 1, 5.5f );
    testbadvalue( 1, 6.6 );
    testbadvalue( 1, "" );
    testbadvalue( 1, "abc" );
    testbadvalue( 1, new Object() );
    testbadvalue( 1, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 1, new Date() );
  }
View Full Code Here

    testbadvalue( 0, 5.5f );
    testbadvalue( 0, 6.6 );
//    testbadvalue( 0, "" ); // good!
//    testbadvalue( 0, "abc" ); // good!
    testbadvalue( 0, new Object() );
    testbadvalue( 0, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 0, new Date() );

    testbadvalue( 1, null );
    testbadvalue( 1, false );
    testbadvalue( 1, true );
    testbadvalue( 1, (byte) 1 );
    testbadvalue( 1, (short) 2222 );
    testbadvalue( 1, 333333 );
    testbadvalue( 1, 4444444444444444L );
    testbadvalue( 1, 5.5f );
    testbadvalue( 1, 6.6 );
    testbadvalue( 1, "" );
    testbadvalue( 1, "abc" );
    testbadvalue( 1, new Object() );
    testbadvalue( 1, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 1, new Date() );
  }
View Full Code Here

TOP

Related Classes of 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.