Package fr.imag.adele.apam.pax.test.implS3

Examples of fr.imag.adele.apam.pax.test.implS3.S3GroupAImpl


    Instance instanceApp1 = ia.createInstance(composite_a, null);

    Instance instanceApp2 = ia.createInstance(composite_b, null);

    S3GroupAImpl ga1 = (S3GroupAImpl) instanceApp1.getServiceObject();

    S3GroupAImpl ga2 = (S3GroupAImpl) instanceApp2.getServiceObject();

    System.out.println("instanceApp1 is in appli "
        + instanceApp1.getAppliComposite());
    System.out.println("instanceApp2 is in appli "
        + instanceApp2.getAppliComposite());

    ga1.getElement();

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    auxListInstances("bbbbbbbbbbbbbbbbbbbbbbbb");

    ga2.getElement();

    auxListInstances("aaaaaaaaaaaaaaaaaaaaaaaa");

    String message = "A composite that share its dependencies into application level, should be allowED to inject its instances into other composites that are into the same application.";
    // They are not in the same application !
    Assert.assertTrue(message, ga1.getElement() == ga2.getElement());

  }
View Full Code Here


    Instance instanceApp1 = ia.createInstance(composite_a, null);

    Instance instanceApp2 = ia.createInstance(composite_b, null);

    S3GroupAImpl ga1 = (S3GroupAImpl) instanceApp1.getServiceObject();

    S3GroupAImpl ga2 = (S3GroupAImpl) instanceApp2.getServiceObject();

    ga1.getElement();

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    auxListInstances("bbbbbbbbbbbbbbbbbbbbbbbb");

    ga2.getElement();

    auxListInstances("aaaaaaaaaaaaaaaaaaaaaaaa");

    String message = "Consider composite A, instantiated into a composite SA, and B, into a composite SB. If A declares that export nothing to all app but everything to global, the global take over, and the instances of A should be visible in B";
    // Test faux ?? : ce sont deux appli differentes
    Assert.assertTrue(message, ga1.getElement() == ga2.getElement());

  }
View Full Code Here

    Instance instanceApp1 = ia.createInstance(composite_a, null);

    Instance instanceApp2 = ia.createInstance(composite_b, null);

    S3GroupAImpl ga1 = (S3GroupAImpl) instanceApp1.getServiceObject();

    S3GroupAImpl ga2 = (S3GroupAImpl) instanceApp2.getServiceObject();

    ga1.getElement();

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    auxListInstances("bbbbbbbbbbbbbbbbbbbbbbbb");

    ga2.getElement();

    auxListInstances("aaaaaaaaaaaaaaaaaaaaaaaa");

    String message = "Consider composite A, instantiated into the ROOT composite, and B, into the ROOT composite. If A declares that export nothing to all app but everything to global, the global take over, and the instances of A should be visible in B";

    Assert.assertTrue(message, ga1.getElement() == ga2.getElement());

  }
View Full Code Here

    Instance instanceApp1 = ia.createInstance(composite_a, null);

    Instance instanceApp2 = ia.createInstance(composite_b, null);

    S3GroupAImpl ga1 = (S3GroupAImpl) instanceApp1.getServiceObject();

    S3GroupAImpl ga2 = (S3GroupAImpl) instanceApp2.getServiceObject();

    ga1.getElement();

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    auxListInstances("bbbbbbbbbbbbbbbbbbbbbbbb");

    ga2.getElement();

    auxListInstances("aaaaaaaaaaaaaaaaaaaaaaaa");

    String message = "Consider composite A, instantiated into a composite SA, and B, into a composite SB. If A declares that export everything globally, its instances should be visible/injected in B";

    Assert.assertTrue(message, ga1.getElement() == ga2.getElement());

  }
View Full Code Here

    Instance a = composite_a.getMainInst();

    Instance b = composite_b.getMainInst();

    S3GroupAImpl ga = (S3GroupAImpl) a.getServiceObject();

    S3GroupBImpl gb = (S3GroupBImpl) b.getServiceObject();

    System.out.println("Element B injected: " + gb.getElement());

    auxListInstances("bbbbbbbbbbbbbbbbbbbbbbbb");

    System.out.println("Element A injected: " + ga.getElement());

    auxListInstances("aaaaaaaaaaaaaaaaaaaaaaaa");

    String messageTemplate = "Composite that do not allow anything to be imported (<import implementation='false' />) should never import other composite instance. %s";

    String message = String
        .format(messageTemplate,
            "Although, an instance from composite B was injected in composite A even if A is marked with <import implementation='false' />");
    // The fact the implem is not visible does not mean we cannot resolve :
    // it can be deployed again,
    // and it is possible to see its instances anyway !.
    Assert.assertTrue(message, ga.getElement() == gb.getElement());

  }
View Full Code Here

    Instance a = composite_a.getMainInst();

    Instance b = composite_b.getMainInst();

    S3GroupAImpl ga = (S3GroupAImpl) a.getServiceObject();

    S3GroupBImpl gb = (S3GroupBImpl) b.getServiceObject();

    gb.getElement();

    auxListInstances("bbbbbbbbbbbbbbbbbbbbbbbb");

    ga.getElement();

    auxListInstances("aaaaaaaaaaaaaaaaaaaaaaaa");

    String messageTemplate = "Composite that do not allow anything to be imported (<import instance='false' />) should never use other composite instance. %s";

    String message = String
        .format(messageTemplate,
            "Although, an instance from composite B was injected in composite A even if A is marked with import instance='false'");

    Assert.assertTrue(message, ga.getElement() != gb.getElement());

  }
View Full Code Here

        "composite-a");

    Composite compositeA = (Composite) compositeAImpl.createInstance(null,
        null);

    S3GroupAImpl s3b = (S3GroupAImpl) compositeA.getMainInst()
        .getServiceObject();
    s3b.getElement();

    System.out.println("Original composite:"
        + sharedDependency.getComposite());

    apam.waitForIt(Constants.CONST_WAIT_TIME);
View Full Code Here

    Instance sharedDependency = sharedDependencyImpl.createInstance(
        compositeA, null); // do not works

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    S3GroupAImpl s3b = (S3GroupAImpl) compositeA.getMainInst()
        .getServiceObject();
    s3b.getElement();

    System.out.println("Original composite:"
        + sharedDependency.getComposite());

    apam.waitForIt(Constants.CONST_WAIT_TIME);
View Full Code Here

    Instance b = composite_b.getMainInst();

    S3GroupAImpl ga = (S3GroupAImpl) a.getServiceObject();

    S3GroupBImpl gb = (S3GroupBImpl) b.getServiceObject();

    // Force instantiation one given specification inside the composite A
    ga.getElement();

    // Force instantiation of the same specification as before in composite
    // B
    gb.getElement();

    auxListInstances("---");

    String message = String
        .format(messageTemplate,
            "But A marked with <export implementation=false />"
                + " allowed its instance to be used by another composite");
    // Normal !
    Assert.assertTrue(message, ga.getElement() == gb.getElement());

  }
View Full Code Here

    Instance a = composite_a.getMainInst();
    Instance b = composite_b.getMainInst();

    S3GroupAImpl ga = (S3GroupAImpl) a.getServiceObject();

    S3GroupBImpl gb = (S3GroupBImpl) b.getServiceObject();

    // Force instantiation one given specification inside the composite A
    System.out.println("A-->" + ga.getElement());

    // Force instantiation of the same specification as before in composite
    // B
    System.out.println("B-->" + gb.getElement());

    auxListInstances("---");

    String message = String
        .format(messageTemplate,
            "But A marked with '<local instance='true'>' allowed its instance to be used by another composite");

    Assert.assertTrue(message, ga.getElement() != gb.getElement());

  }
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.pax.test.implS3.S3GroupAImpl

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.