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

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


  Composite composite_a = (Composite) cta.createInstance(composite_root,
    null);

  Instance instanceApp1 = composite_a.getMainInst();

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

  String messageTemplate = "In contentMngt->dependency if we adopt fail='exception' exception='A', the exception A should be throw in case the dependency is not satifiable. %s";

  boolean exception = false;
  boolean exceptionType = false;

  try {

      Eletronic injected = ga1.getElement();
      System.out.println("Element:" + injected);

  } catch (Exception e) {
      exception = true;
View Full Code Here


  Composite composite_a = (Composite) cta.createInstance(null, null);

  Instance instanceApp1 = composite_a.getMainInst();

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

  ThreadWrapper wrapper = new ThreadWrapper(ga1);
  wrapper.setDaemon(true);
  wrapper.start();
View Full Code Here

  Implementation group_a = waitForImplByName(null,
    "group-a-fail-exception");

  Instance instance_a = group_a.createInstance(null, null);

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

  String messageTemplate = "In dependency if we adopt fail='exception' exception='A', the exception A should be throw in case the dependency is not satifiable. %s";

  boolean exception = false;
  boolean exceptionType = false;

  try {

      Eletronic injected = ga1.getElement();
      System.out.println("Element:" + injected);

  } catch (Exception e) {
      exception = true;
View Full Code Here

  Implementation group_a = waitForImplByName(null,
    "group-a-fail-exception-native");

  Instance instance_a = group_a.createInstance(null, null);

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

  String messageTemplate = "In dependency if we adopt fail='exception' exception='A' (With A being an exception that already exists in java JRE), the exception A should be throw in case the dependency is not satifiable. But the exception thrown was not type (A)";

  boolean exceptionType = false;

  try {

      Eletronic injected = ga1.getElement();
      System.out.println("Element:" + injected);

  } catch (Exception e) {

      System.err
View Full Code Here

  Implementation cta = waitForImplByName(null, "group-a-fail-wait");

  Instance instanceApp1 = cta.createInstance(null, null);

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

  ThreadWrapper wrapper = new ThreadWrapper(ga1);
  wrapper.setDaemon(true);
  wrapper.start();
View Full Code Here

    Composite composite_a = (Composite) cta.createInstance(composite_root,
        null);// inner composite with hide='true'

    Instance instanceApp1 = composite_a.getMainInst();

    S3GroupAImpl ga1 = (S3GroupAImpl) instanceApp1.getServiceObject();
    // force injection
    ga1.getElement();

    auxListInstances("\t");

    List<Instance> instancesOfImplementation = auxLookForInstanceOf("fr.imag.adele.apam.pax.test.implS3.S3GroupAImpl");
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
    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

    Composite composite_b = (Composite) ctb.createInstance(null, null);

    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

    Implementation groupAImpl = waitForImplByName(null, "group-a");

    Instance groupAInstance = groupAImpl.createInstance(composite_a,
        Collections.<String, String> emptyMap());

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

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

    auxListInstances("---");

    String message = String
        .format(messageTemplate,
            "A should have visibility to the implementation, just NOT export them, so the composite A should be able to create an instance of it");

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

  }
View Full Code Here

    Instance groupAInstance = groupAImpl.createInstance(composite_a,
        Collections.<String, String> emptyMap());
    Instance groupBInstance = groupBImpl.createInstance(null,
        Collections.<String, String> emptyMap());

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

    S3GroupBImpl gb = (S3GroupBImpl) groupBInstance.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,
            "B should have created a new instance, since he has access to the implementation but not the instances of A");

    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.