Package org.apache.etch.tests.Test1

Examples of org.apache.etch.tests.Test1.E1


    assertArrayEquals( value, myS4.x );
  }
 
  private void testExcp5Export(String msg, int code, Object value)
  {
    StructValue sv = vf.exportCustomValue( new Excp5( msg, code, value ) );
    sv.checkType( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_Excp5 );
    assertEquals( 3, sv.size() );
    assertEquals( msg, sv.get( ValueFactoryTest1._mf_msg ) );
    assertEquals( code, sv.get( ValueFactoryTest1._mf_code ) );
    assertEquals( value, sv.get( ValueFactoryTest1._mf_x ) );   
View Full Code Here


  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_Excp5, vf );
    sv.put( ValueFactoryTest1._mf_msg, msg );
    sv.put( ValueFactoryTest1._mf_code, code );
    sv.put( ValueFactoryTest1._mf_x, value );   
    Excp5 e = (Excp5) vf.importCustomValue( sv );
    assertEquals( msg, e.msg );
    assertEquals( code, e.code );
    assertEquals( value, e.x );   
 
View Full Code Here

    assertEquals( value, e.x );   
 
 
  private void testExcp6Export(String msg, int code, Object[] value)
  {
    StructValue sv = vf.exportCustomValue( new Excp6( msg, code, value ) );
    sv.checkType( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_Excp6 );
    assertEquals( 3, sv.size() );
    assertEquals( msg, sv.get( ValueFactoryTest1._mf_msg ) );
    assertEquals( code, sv.get( ValueFactoryTest1._mf_code ) );
    assertEquals( value, sv.get( ValueFactoryTest1._mf_x ) );   
View Full Code Here

  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_Excp6, vf );
    sv.put( ValueFactoryTest1._mf_msg, msg );
    sv.put( ValueFactoryTest1._mf_code, code );
    sv.put( ValueFactoryTest1._mf_x, value );   
    Excp6 e = (Excp6) vf.importCustomValue( sv );
    assertEquals( msg, e.msg );
    assertEquals( code, e.code );
    assertArrayEquals( value, e.x );   
  }
View Full Code Here

  @org.junit.Test
  public void test_S2_import()
  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S2, vf );
   
    sv.put( ValueFactoryTest1._mf_a, new S1( 21, 22, 23 ) );
    sv.put( ValueFactoryTest1._mf_b, new S1( 31, 32, 33 ) );
    sv.put( ValueFactoryTest1._mf_c, E1.A );
   
    S2 s = (S2) vf.importCustomValue( sv );
    assertEquals( 21, s.a.x );
    assertEquals( 22, s.a.y );
View Full Code Here

 
  /** */
  @org.junit.Test
  public void test_S1_export()
  {
    StructValue sv = vf.exportCustomValue( new S1( 19, 23, 29 ) );
    sv.checkType( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S1 );
    assertEquals( 3, sv.size() );
    assertEquals( 19, sv.get( ValueFactoryTest1._mf_x ) );
    assertEquals( 23, sv.get( ValueFactoryTest1._mf_y ) );
    assertEquals( 29, sv.get( ValueFactoryTest1._mf_z ) );
View Full Code Here

  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S1, vf );
    sv.put( ValueFactoryTest1._mf_x, 101 );
    sv.put( ValueFactoryTest1._mf_y, 103 );
    sv.put( ValueFactoryTest1._mf_z, 107 );
    S1 s = (S1) vf.importCustomValue( sv );
    assertEquals( 101, s.x );
    assertEquals( 103, s.y );
    assertEquals( 107, s.z );
  }
View Full Code Here

 
  /** */
  @org.junit.Test
  public void test_S2_export()
  {
    S1 a = new S1( 21, 22, 23 );
    S1 b = new S1( 31, 32, 33 );
    E1 c = E1.A;
   
    StructValue sv = vf.exportCustomValue( new S2( a, b, c ) );
    sv.checkType( ValueFactoryTest1._mt_org_apache_etch_tests_Test1_S2 );
    assertEquals( 3, sv.size() );
View Full Code Here

  /** @throws Exception */
  @org.junit.Test
  public void method_dist1() throws Exception
  {
    svc.xresult = Math.sqrt( 3 );
    S1 arg1 =  new S1( 1, 1, 1 );
    S1 arg2 = new S1( 0, 0, 0 );
    assertEquals( Math.sqrt( 3 ), test.dist( arg1, arg2 ) );
    check( What.CALL,
      ValueFactoryTest1._mt_org_apache_etch_tests_Test1_dist,
      new Field[] { ValueFactoryTest1._mf_a, ValueFactoryTest1._mf_b },
      new Object[] { arg1, arg2 },
View Full Code Here

  /** @throws Exception */
  @org.junit.Test
  public void method_dist2() throws Exception
  {
    svc.xresult = Math.sqrt( 35 );
    S1 arg1 = new S1( 1, 2, 3 );
    S1 arg2 = new S1( 6, 5, 4 );
    assertEquals( Math.sqrt( 35 ), test.dist( arg1, arg2 ) );
    check( What.CALL,
      ValueFactoryTest1._mt_org_apache_etch_tests_Test1_dist,
      new Field[] { ValueFactoryTest1._mf_a, ValueFactoryTest1._mf_b },
      new Object[] { arg1, arg2 },
View Full Code Here

TOP

Related Classes of org.apache.etch.tests.Test1.E1

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.