Package fr.imag.adele.apam

Examples of fr.imag.adele.apam.CompositeType


    @Test
    public void SubstitutionReachingMultipleNodesWithKeywordCompositeType_tc124() {

  Implementation subjectBimpl = waitForImplByName(null, "subject-b");

  CompositeType subjectBCompositeType = (CompositeType) waitForImplByName(
    null, "subject-b-composite");
  Composite subjectBComposite = (Composite) subjectBCompositeType
    .createInstance(null, Collections.<String, String> emptyMap());

  // Instance of the subject-a (parent)
  Instance subjectB = subjectBimpl
    .createInstance(subjectBComposite, null);

  auxListProperties("\t", subjectB);

  System.err.println(subjectB.getProperty("property-case-14"));

  Assert.assertTrue(
    String.format(
      "Using metasubstituion to retrieve the name of the compositetype in which a given component is in did not fetch the right composite (%s)",
      subjectB.getProperty("property-case-14")),
    subjectB.getProperty("property-case-14").equals(
      subjectBCompositeType.getProperty("name")));

    }
View Full Code Here


    @Test
    public void SubstitutionReachingMultipleNodesWithKeywordSpec_tc126() {

  Implementation subjectDimpl = waitForImplByName(null, "subject-d");

  CompositeType subjectCCompositeType = (CompositeType) waitForImplByName(
    null, "subject-d-composite");
  Composite subjectDComposite = (Composite) subjectCCompositeType
    .createInstance(null, Collections.<String, String> emptyMap());

  // Instance of the subject-a (parent)
  Instance subjectD = subjectDimpl
    .createInstance(subjectDComposite, null);
View Full Code Here

   *
   */
  @Test
  public void embeddedComposite() {
    waitForApam();
    CompositeType app1CompoType = null;

    try {
      String[] repos = { "jar:mvn:fr.imag.adele.apam.tests.obrman.repositories/public.repository/"
          + obrmanhelper.getMavenVersion() + "!/app-store.xml" };
      obrmanhelper.setObrManInitialConfig("rootAPPS", repos, 1);
      app1CompoType = obrmanhelper.createCompositeType("APP1",
          "APP1_MAIN", null);

      CompositeType app2CompoType = obrmanhelper.createCompositeType(
          "APP2", "APP2_MAIN", null);

      for (String s : repos) {
        System.out.println("repo : " + s);
      }
View Full Code Here

  public void movedCompositev1() {
    waitForApam();

    simpleComposite();

    CompositeType app1CompoType = null;
    try {
      app1CompoType = obrmanhelper.createCompositeType("APP1.2",
          "APP1_MAIN", null);
    } catch (IOException e) {
      fail(e.getMessage());
    }

    CompositeType root = (CompositeType) app1CompoType.getInCompositeType()
        .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
    // app2

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

  }
View Full Code Here

   * spec and the main impl of the composite
   */
  @Test
  public void simpleComposite() {
    waitForApam();
    CompositeType app2CompoType = null;
    try {
      String[] repos = { "jar:mvn:fr.imag.adele.apam.tests.obrman.repositories/public.repository/"
          + obrmanhelper.getMavenVersion() + "!/app-store.xml" };
      obrmanhelper.setObrManInitialConfig("rootAPPS", repos, 1);
      app2CompoType = obrmanhelper.createCompositeType("APP2",
View Full Code Here

  }
 
  @Test
  public void compositeSequenceStartwithOK_tct037() {
   
    CompositeType compo = (CompositeType) waitForComponentByName(null,
        "CompositeSequenceStartwithOK_tct037");
   
    compo.createInstance(null, null);
   
    Implementation implOK = CST.componentBroker.getImpl("ImplemOK");
    Assert.assertNotNull("ImplemOK should have been installed" , implOK );
    Assert.assertNotNull("An Instance of ImplemOK should have been created" , implOK.getInst() );
    Assert.assertTrue("The instance name should be thisOneOK (from the composite)" , implOK.getInst().getName().equals("thisOneOK") );
View Full Code Here

 
 
  @Test
  public void compositeSequenceStartwithFail_tct038() {
   
    CompositeType compo = (CompositeType) waitForComponentByName(null,
        "CompositeSequenceStartwithFail_tct038");
   
    compo.createInstance(null, null);
   
    Implementation implOK = CST.componentBroker.getImpl("ImplemOK");
    Assert.assertNotNull("ImplemOK should have been installed" , implOK );
    Assert.assertNotNull("An Instance of ImplemOK should have been created" , implOK.getInst() );
    Assert.assertTrue("The instance name should be thisOneOK (from the composite)" , implOK.getInst().getName().equals("thisOneOK") );
View Full Code Here

      created = null;
    }

    @Override
    public void run() {
      CompositeType compo = (CompositeType) waitForComponentByName(null,
          myCompositeName);     
      if (compo != null) {
        created = compo.createInstance(null, null);
      }
    }
View Full Code Here

    models.add(model);

    Apam apam = getAService(Apam.class);

    CompositeType app = apam.createCompositeType(null, name, mainSpec,
        main, models, null);

    assertNotNull(app);

    assertNotNull(app.getMainImpl().getApformImpl());

    return app;
  }
View Full Code Here

    public void NotSingletonSharedInstance_tc018() {

  Implementation impl = waitForImplByName(null,
    "HouseMeterNotSingletonShared");

  CompositeType root = (CompositeType) impl.getInCompositeType()
    .toArray()[0];

  Composite rootComposite = null;

  if (root.getInst() instanceof Composite) {
      rootComposite = (Composite) root.getInst();
  }

  impl.createInstance(null, null);

  boolean success = true;
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.CompositeType

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.