Package fr.imag.adele.apam.app1.s1.spec

Examples of fr.imag.adele.apam.app1.s1.spec.S1


 
  /** @throws Exception */
  @org.junit.Test
  public void method_p_S2() throws Exception
  {
    S2 a = new S2( new S1( 1, 2, 3 ), new S1( 2, 3, 4 ), E1.A );
    svc.xresult = a;
    S2 r = test.p_S2( a );
    assertObjectEquals( a, r );
    check( What.CALL,
      ValueFactoryTest1._mt_etch_tests_Test1_p_S2,
View Full Code Here


 
  /** @throws Exception */
  @org.junit.Test
  public void method_p_S2_array() throws Exception
  {
    S2 x = new S2( new S1( 1, 2, 3 ), new S1( 2, 3, 4 ), E1.A );
    S2 y = new S2( new S1( 2, 3, 4 ), new S1( 3, 4, 5 ), E1.B );
    S2[] a = { x, y };
    svc.xresult = a;
    S2[] r = test.p_S2_array( a );
    assertObjectEquals( a, r );
    check( What.CALL,
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_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_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_etch_tests_Test1_S2 );
    assertEquals( 3, sv.size() );
View Full Code Here

  @org.junit.Test
  public void test_S2_import()
  {
    StructValue sv = new StructValue( ValueFactoryTest1._mt_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

    } catch (IOException e) {

      fail(e.getMessage());
    }

    App1Spec app1Spec = apam.createInstance(app1CompoType, App1Spec.class);

    System.out
        .println("\n==================Start call test=================== \n");

    app1Spec.call("Call Main APP1 from Test");

    System.out
        .println("\n=================End call test====================\n");
  }
View Full Code Here

        .toArray()[0];

    assertEquals(2, root.getEmbedded().size()); // the root compositeType
    // contains two composites

    App1Spec app1Spec = obrmanhelper.createInstance(app1CompoType,
        App1Spec.class);

    System.out
        .println("\n==================Start call test=================== \n");

    app1Spec.call("Call Main APP1 from Test");

    System.out
        .println("\n=================End call test====================\n");

    assertEquals(1, app1CompoType.getEmbedded().size()); // app1 contains
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

TOP

Related Classes of fr.imag.adele.apam.app1.s1.spec.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.