Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.StructValue


  /** @throws Exception */
  @Test
  public void exportCustomValue_RuntimeException() throws Exception
  {
    Exception value = new NullPointerException();
    StructValue sv = vf.exportCustomValue( value );
    sv.checkType( vf.getType( "_Etch_RuntimeException" ) );
    assertEquals( 1, sv.size() );
    assertEquals( "java.lang.NullPointerException",
      sv.get( DefaultValueFactory._mf_msg ) );
  }
View Full Code Here


  /** @throws Exception */
  @Test
  public void exportCustomValue_RuntimeException_msg() throws Exception
  {
    Exception value = new NullPointerException( "foo != null" );
    StructValue sv = vf.exportCustomValue( value );
    sv.checkType( vf.getType( "_Etch_RuntimeException" ) );
    assertEquals( 1, sv.size() );
    assertEquals( "java.lang.NullPointerException: foo != null",
      sv.get( DefaultValueFactory._mf_msg ) );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test
  public void importCustomValue_Etch_RuntimeException() throws Exception
  {
    StructValue sv = new StructValue( vf.getType( "_Etch_RuntimeException" ), vf );
    _Etch_RuntimeException e = (_Etch_RuntimeException) vf.importCustomValue( sv );
    assertNotNull( e );
    assertNull( e.msg );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test
  public void importCustomValue_Etch_RuntimeException_msg() throws Exception
  {
    StructValue sv = new StructValue( vf.getType( "_Etch_RuntimeException" ), vf );
    sv.put( DefaultValueFactory._mf_msg, "foo" );
    _Etch_RuntimeException e = (_Etch_RuntimeException) vf.importCustomValue( sv );
    assertNotNull( e );
    assertEquals( "foo", e.msg );
  }
View Full Code Here

 
  /** @throws Exception */
  @Test
  public void importCustomValue_Unknown() throws Exception
  {
    StructValue sv = new StructValue( vf.getType( "x" ), vf );
    assertNull( vf.importCustomValue( sv ) );
    // cannot import unsupported type
  }
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

    testbadvalue( 0, 5.5f );
    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, "" );
    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 ); good!
    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

TOP

Related Classes of etch.bindings.java.msg.StructValue

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.