Package fr.imag.adele.apam

Examples of fr.imag.adele.apam.Implementation.createInstance()


  // Creates S1 instance (class that requires the injection)
  Implementation s1Impl = waitForImplByName(null,
    "fr.imag.adele.apam.pax.test.impl.S1Impl");

  Instance s1Inst = s1Impl.createInstance(null, null);

  // apam.waitForIt(Constants.CONST_WAIT_TIME);

  S1Impl s1 = (S1Impl) s1Inst.getServiceObject();
View Full Code Here


      lgInst.getName(),
      lgInst.getAllProperties().get("currentVoltage")), s1
      .getDevicePreference110v() == lgSwitch);

  Implementation samsungImpl = waitForImplByName(null, "SamsungSwitch");
  final Instance samsungInst = samsungImpl.createInstance(null,
    new HashMap<String, String>() {
        {
      put("currentVoltage", "500");
        }
    });
View Full Code Here

  String messageTemplate = "In case of a remove callback, when a property of a service A change and the service B use a constraint to inject A on its instance, the link from A->B should be brocken and restablished, thus remove callback should have been called";

  Implementation impl = waitForImplByName(null,
    "S1Impl-removed-callback-with-constraint");

  Instance instance = impl.createInstance(null,
    new HashMap<String, String>());

  S1Impl s1 = (S1Impl) instance.getServiceObject();

  S2 first = s1.getS2();
View Full Code Here

  String messageTemplate = "In case of a remove callback, when a property of a service A change and the service B do NOT use a constraint to inject A on its instance, the link from A->B should NOT be brocken and restablished, thus remove callback should NOT have been called";

  Implementation impl = waitForImplByName(null,
    "S1Impl-removed-callback-with-no-constraint");

  Instance instance = impl.createInstance(null,
    new HashMap<String, String>());

  S1Impl s1 = (S1Impl) instance.getServiceObject();

  s1.getS2();
View Full Code Here

    public void SingletonNotSharedInstance_tc015() {

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

  Instance inst1 = impl.createInstance(null,
    new HashMap<String, String>());
  Instance inst2 = null;

  try {
      inst2 = impl.createInstance(null, new HashMap<String, String>());
View Full Code Here

  Instance inst1 = impl.createInstance(null,
    new HashMap<String, String>());
  Instance inst2 = null;

  try {
      inst2 = impl.createInstance(null, new HashMap<String, String>());
  } catch (Exception e) {
      // Nothing to do
  }

  System.out.println("-----" + inst1);
View Full Code Here

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

  impl.createInstance(null, null);

  Instance inst1 = CST.apamResolver.resolveImpl(rootComposite, impl,
    new HashSet<String>(), new ArrayList<String>());
  Instance inst2 = CST.apamResolver.resolveImpl(rootComposite, impl,
    new HashSet<String>(), new ArrayList<String>());
View Full Code Here

    Assert.assertNotNull(
        "Obrman-Test-S3Impl cannot be resolved (cannot be found using obrman)",
        implementation);

    Instance instance = implementation.createInstance(null,
        Collections.<String, String> emptyMap());

    Assert.assertNotNull("Instance of Obrman-Test-S3Impl is null", instance);
    Bundle bundle = implementation.getApformComponent().getBundle();
View Full Code Here

    Assert.assertNotNull(
        "Obrman-Test-S3Impl cannot be resolved as bundle is not started",
        implementation);

    instance = implementation.createInstance(null,
        Collections.<String, String> emptyMap());

    Assert.assertNotNull("Instance of Obrman-Test-S3Impl is null", instance);

  }
View Full Code Here

    waitForApam();

    Implementation implementation = waitForImplByName(null,
        "S07-implementation-14ter");

    Instance instance = implementation.createInstance(null,
        Collections.<String, String> emptyMap());

    // Test should success on external bundle resolution
    auxListInstances();
    org.junit.Assert
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.