Package fr.imag.adele.apam

Examples of fr.imag.adele.apam.Instance


    public void RelationSourceSpecificationTargetImplementationFailExceptionCustom_tc108() {

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

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

  S07ImplementationImporter12 dependency = (S07ImplementationImporter12) instance
    .getServiceObject();

  Exception raised = null;

  try {
View Full Code Here


    public void RelationSourceSpecificationTargetImplementationFailExceptionGeneric_tc107() {

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

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

  S07ImplementationImporter11 dependency = (S07ImplementationImporter11) instance
    .getServiceObject();

  Exception raised = null;

  try {
View Full Code Here

    public void RelationSourceSpecificationTargetImplementationFailWait_tc106() {

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

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

  S07ImplementationImporter10 dependency = (S07ImplementationImporter10) instance
    .getServiceObject();

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

  target.createInstance(null, null);

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

  Instance instance = implementation.createInstance(null, null);

  S07ImplementationImporter07 dependency = (S07ImplementationImporter07) instance
    .getServiceObject();

  // Force field injection
  dependency.getInjected();
View Full Code Here

    public void RelationSourceSpecificationTargetSpecification_tc105() {

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

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

  S07ImplementationImporter09 dependency = (S07ImplementationImporter09) instance
    .getServiceObject();

  // Force field injection
  dependency.getInjected();
View Full Code Here

    /*
     * If the target of the wire is a non sharable instance, the released
     * instance can potentially be used by a pending requests.
     */
    if (link.getDestination() instanceof Instance) {
      Instance candidate = (Instance) link.getDestination();

      if ((!candidate.isShared()) && candidate.isSharable()) {
        resolveWaitingRequests(candidate);
      }
    }
  }
View Full Code Here

        ((RelToResolveImpl)relToResolve).computeFilters();
        return resolveOneManager(manager, relToResolve, mess);
      }

      Composite compo = (source instanceof Instance) ? ((Instance) source).getComposite() : CompositeImpl.getRootInstance();
      Instance inst = resolved.toInstantiate.createInstance(compo, null);
      if (inst == null) {
        /*
         *  Failed to be instantiated.
         *  Flag instantiateFails is turned to "true" in createInstance.
         *  Instantiation will not be attempted again on this implem.
View Full Code Here

    "S07-DependencyImpl");

  Implementation implementationTarget = waitForImplByName(null,
    "S07-implementation-15");

  Instance instanceInvalid01 = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "do-not-take-this-instance");
        }
    });
  Instance instanceInvalid02 = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "neither-this");
        }
    });
  Instance instanceValid = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "the-chosen-one");
        }
    });
  Instance instanceInvalid04 = implementation.createInstance(null,
    new HashMap<String, String>() {
        {
      put("criteria", "ignore-this");
        }
    });

  Instance instanceTarget = implementationTarget.createInstance(null,
    null);

  S07ImplementationImporter15 implem = (S07ImplementationImporter15) instanceTarget
    .getServiceObject();

  Instance instanceInjected = auxListInstanceReferencedBy(implem
    .getInjected());

  Assert.assertTrue(
    "Using <relation/> element in metadata to inject a dependency, the constraint filter was not respect as expected.",
    instanceInjected == instanceValid);
View Full Code Here

    @Test
    public void RelationLinkCreationManual_tct004() {
  Implementation implementation = waitForImplByName(null,
    "S07-implementation-16");

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

  Implementation implementationdep = waitForImplByName(null,
    "S07-DependencyImpl-02");
  Instance instancedep = implementationdep.createInstance(null,
    Collections.<String, String> emptyMap());

  org.junit.Assert
    .assertTrue(
      "An exception should be raised as the dependency cannot be resolved automatically (creation=manual)",
View Full Code Here

    public void RelationLinkResolveExist_tct001() {

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

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

  org.junit.Assert
    .assertTrue(
      "An exception should be raised as the dependency cannot be resolved as no instance running",
      testResolutionExceptionCase14(instance, 2));
  Assert.assertEquals(
    "No relations should have been created (no instance of dependency existing)",
    0, instance.getRawLinks().size());

  Implementation implementationdep = waitForImplByName(null,
    "S07-DependencyImpl-02");

  Instance instancedep = implementationdep.createInstance(null,
    Collections.<String, String> emptyMap());
  auxListInstances();

  org.junit.Assert
    .assertFalse(
View Full Code Here

TOP

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

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.