Package etch.tests.Test1

Examples of etch.tests.Test1.S1


  private void testS3Import(String s, Object value)
  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_etch_tests_Test1_S3, vf );
    sv.put( ValueFactoryTest1._mf_tipe, s );
    sv.put( ValueFactoryTest1._mf_x, value );
    S3 myS3 = (S3) vf.importCustomValue( sv );
    assertEquals( s, myS3.tipe );
    assertEquals( value, myS3.x );
 
View Full Code Here


 
  /** */
  @Test public void  testObjectStructArray() {
    try
    {
      S4 a  = null;
      testServer.p_object_struct_array( a );
      testClient.p_object_struct_array( a );
    }
    catch ( UnsupportedOperationException e )
    {
View Full Code Here

    assertEquals( value, myS3.x );
 
 
  private void testS4Export(String s, Object[] value)
  {
    StructValue sv = vf.exportCustomValue( new S4( s,value ) );
    sv.checkType( ValueFactoryTest1._mt_etch_tests_Test1_S4 );
    assertEquals( 2, sv.size() );
    assertEquals( s, sv.get( ValueFactoryTest1._mf_tipe ) );
    assertEquals( value, sv.get( ValueFactoryTest1._mf_x ) );
  }
View Full Code Here

  private void testS4Import(String s, Object[] value)
  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_etch_tests_Test1_S4, vf );
    sv.put( ValueFactoryTest1._mf_tipe, s );
    sv.put( ValueFactoryTest1._mf_x, value );
    S4 myS4 = (S4) vf.importCustomValue( sv );
    assertEquals( s, myS4.tipe );
    assertArrayEquals( value, myS4.x );
  }
View Full Code Here

    System.out.println("testing create instance root");
    Instance a = appliTest00.createInstance(null /* composite */, null/* properties */);
    assertTrue(a!= null);

    System.out.println("testing call to S1toS2Final");
    S1 s01 = (S1) a.getServiceObject();
    s01.callS1("createAppli by API by name. Should call S2Final.");

    System.out.println("=========== passed testCreateCompoRootS1toS2Final\n\n");

    System.out.println("=========== start nested composite instance by API");
    System.out.println("Testing the manual creation of a composite instance inside another composite instance of same type");
View Full Code Here

    Map<String, String> props = new HashMap<String, String>();
    Instance test00_instance0 = null ;
    CompositeType appli3 ;
    // Calling that application from an external program (this instance).
    S1 s11 = (S1) test00_instance0.getServiceObject();
    s11.callS1("createAppli-1");

    // setting visibilities
    // composite a3 should not be shared
    //    test00_instance0.setProperty(CST.SHARED, CST.V_FALSE);

    System.out.println("\n\n===================================== Testing promotions\n"
        + " creating composite on S1 containing an S2 composite \n");

    props.clear();
    //    props.put(CST.A_LOCALIMPLEM, CST.V_TRUE);
    //    props.put(CST.A_LOCALINSTANCE, CST.V_TRUE);
    //    props.put(CST.A_BORROWIMPLEM, CST.V_FALSE);
    //    props.put(CST.A_BORROWINSTANCE, CST.V_FALSE);

    CompositeType mainCompo = apam.createCompositeType("Test00", "TestS1Promotions", null, "S1Main", null /* models */,
        props);

    System.err.println("TestS1Promotions inside Test00 and black box");
    mainCompo.createInstance((Composite) test00_instance0, props);

    System.out.println("\n\n\n========================== deuxieme exec ===");
    //        test00_instance0 = appli3.createInstance(null /* composite */, null/* properties */);

    // Calling that application from an external program (this instance).
    s11 = (S1) test00_instance0.getServiceObject();
    s11.callS1("createAppli-2");


    System.out.println("\n\n\n== troisieme exec ===");
    //        test00_instance0 = appli3.createInstance(null /* composite */, null/* properties */);
    // Calling that application from an external program (this instance).
    s11 = (S1) test00_instance0.getServiceObject();
    s11.callS1("createAppli-3");

  }
View Full Code Here

        Implementation implS1 = CST.apamResolver.findImplByName(null,"S1ImplEmpty");
        Instance s1 = implS1.createInstance(null, null);
        Instance s2 = implS1.createInstance(null, null);


        S1 testReaction = perfWire.getFieldTestReaction();
        Assert.assertNotNull("S1 field testReaction not resoved", testReaction);

        Instance test = CST.componentBroker.getInstService(testReaction) ;
        System.out.println("connected to " + test.getName());
        if (test == s1)
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

TOP

Related Classes of etch.tests.Test1.S1

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.