Package fr.imag.adele.apam.impl

Examples of fr.imag.adele.apam.impl.ComponentImpl


    }

    private static void AssertCorrectSourceTargetTypes(Component component,
      Class expectedSource, Class expectedTarget) {

  ComponentImpl ci = null;

  if (component instanceof Implementation
    && expectedSource == Specification.class) {
      ci = (ComponentImpl) ((Implementation) component).getSpec();
  }
  if (component instanceof Instance && expectedSource == Instance.class) {
      ci = (ComponentImpl) component;
  }

  for (Link link : ci.getLocalLinks()) {

      validateSourceTargetTypes(link.getSource(), link.getDestination(),
        expectedSource, expectedTarget);

  }
View Full Code Here


  dependency.getInjected();

  String messageTemplate = "Declaring a relation from source %s to target %s, instantiated object of the type %s which is not the targetKind expected.";

  ComponentImpl ci = (ComponentImpl) implementation;

  Assert.assertTrue(
    String.format(
      "Only one link should have been created, but %s links were found",
      ci.getLocalLinks().size()),
    ci.getLocalLinks().size() == 1);

  for (Link link : ci.getLocalLinks()) {

      validateSourceTargetTypes(link.getSource(), link.getDestination(),
        Implementation.class, Implementation.class);

  }
View Full Code Here

  auxListProperties(instanceInjectedReference);

  auxListInstances();

  ComponentImpl ci = (ComponentImpl) implementation;

  Assert.assertTrue(
    String.format(
      "Only one link should have been created, but %s links were found",
      ci.getLocalLinks().size()),
    ci.getLocalLinks().size() == 1);

  for (Link link : ci.getLocalLinks()) {

      validateSourceTargetTypes(link.getSource(), link.getDestination(),
        Implementation.class, Instance.class);

  }
View Full Code Here

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

  auxListInstances();

  ComponentImpl ci = (ComponentImpl) implementation;

  Assert.assertTrue(
    "Using an relation with creation='eager' should instantiate imediatly the dependency, which didnt happened",
    ci.getLocalLinks().size() > 0);

    }
View Full Code Here

    Collections.<String, String> emptyMap());

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

  ComponentImpl ci = (ComponentImpl) implementation;

  Assert.assertTrue(
    "In relation, testing creation='lazy'. There should not exist a link before the dependency call",
    ci.getLocalLinks().size() == 0);

  auxListInstances();

  // Instance instanceInjectedReference =
  // auxListInstanceReferencedBy(dependency
  // .getInjected());

  // Force field injection
  dependency.getInjected();

  Assert.assertTrue(
    "Using an relation with creation='lazy' should instantiate after the dependency is called, which didnt happened",
    ci.getLocalLinks().size() == 1);

    }
View Full Code Here

  auxListProperties(dependency.getInjected());

  auxListInstances();

  ComponentImpl ci = (ComponentImpl) implementation;

  Assert.assertTrue(
    String.format(
      "Only one link should have been created, but %s links were found",
      ci.getLocalLinks().size()),
    ci.getLocalLinks().size() == 1);

  for (Link link : ci.getLocalLinks()) {

      validateSourceTargetTypes(link.getSource(), link.getDestination(),
        Implementation.class, Specification.class);

  }
View Full Code Here

  auxListProperties(dependency.getInjected());

  auxListInstances();

  ComponentImpl ci = (ComponentImpl) instance;

  Assert.assertTrue(
    String.format(
      "Only one link should have been created, but %s links were found",
      ci.getLocalLinks().size()),
    ci.getLocalLinks().size() == 1);

  for (Link link : ci.getLocalLinks()) {

      validateSourceTargetTypes(link.getSource(), link.getDestination(),
        Instance.class, Implementation.class);

  }
View Full Code Here

    .getServiceObject();

  // Force field injection
  dependency.getInjected();

  ComponentImpl ci = (ComponentImpl) instance;

  auxListInstances();

  Assert.assertTrue(String.format(
    "One link should have been created, but %s links were found",
    ci.getLocalLinks().size()), ci.getLocalLinks().size() == 1);

  AssertCorrectSourceTargetTypes(instance, Instance.class, Instance.class);

    }
View Full Code Here

  auxListProperties(dependency.getInjected());

  auxListInstances();

  ComponentImpl ci = (ComponentImpl) instance;

  Assert.assertTrue(
    String.format(
      "Only one link should have been created, but %s links were found",
      ci.getLocalLinks().size()),
    ci.getLocalLinks().size() == 1);

  for (Link link : ci.getLocalLinks()) {

      validateSourceTargetTypes(link.getSource(), link.getDestination(),
        Instance.class, Specification.class);

  }
View Full Code Here

    .getServiceObject();

  // Force field injection
  dependency.getInjected();

  ComponentImpl ci = (ComponentImpl) implementation.getSpec();

  Assert.assertTrue(String.format(
    "One link should have been created, but %s links were found",
    ci.getLocalLinks().size()), ci.getLocalLinks().size() == 1);

  AssertCorrectSourceTargetTypes(implementation, Specification.class,
    Implementation.class);

    }
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.impl.ComponentImpl

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.