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

Examples of fr.imag.adele.apam.pax.test.implS7.S07ImplementationImporter03


    }

    public static boolean testResolutionExceptionCase14(Instance inst,
      int methodNumber) {
  // Force field injection (a bit akward with polymorphism)
  S07Implem14 implem = (S07Implem14) inst.getServiceObject();
  try {
      switch (methodNumber) {
      case 2:
    if (implem.getInjected02() == null) {
        return true;
    }
    break;
      case 3:
    if (implem.getInjected03() == null) {
        return true;
    }
    break;
      }
View Full Code Here


  }

  public static boolean testResolutionException(Instance inst,
      int methodNumber) {
    // Force field injection (a bit akward with polymorphism)
    S07Implem14 implem = (S07Implem14) inst.getServiceObject();
    try {
      switch (methodNumber) {
      case 2:
        if (implem.getInjected02() == null) {
          return true;
        }
        break;
      case 3:
        if (implem.getInjected03() == null) {
          return true;
        }
        break;
      }
View Full Code Here

    }

    private boolean testResolutionExceptionCase16(Instance inst) {
  // Force field injection (a bit akward with polymorphism)
  S07Implem16 implem = (S07Implem16) inst.getServiceObject();
  try {
      if (implem.getInjected02() == null) {
    return true;
      }
  } catch (ResolutionException exc) {
      exc.printStackTrace();
      return true;
View Full Code Here

    "S07-implementation-01");

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

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

  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);

  }

  Assert.assertTrue(
    String.format(messageTemplate, "Implementation",
      "Implementation", instance.getServiceObject()),
    dependency.getInjected().getProperty("implementation-property") != null
      && dependency.getInjected().getProperty(
        "instance-property") == null);
    }
View Full Code Here

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

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

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

  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);

  }

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

  Assert.assertTrue(
    String.format(messageTemplate, "Implementation",
      "Specification", instance.getServiceObject()),
    dependency.getInjected().getProperty("instance-property") == null
      && dependency.getInjected().getProperty(
        "implementation-property") == null
      && dependency.getInjected().getProperty(
        "specification-property") != null);

    }
View Full Code Here

    "S07-implementation-03");

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

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

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

  auxListProperties(instanceInjectedReference);

  auxListInstances();
View Full Code Here

    "S07-implementation-04");

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

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

  Assert.assertTrue(
    "Declaring a relation information on the apam specification tag, and just using the id in the apam implementation didnt work, so the dependency was not resolved",
    dependency.getInjected() != null);

    }
View Full Code Here

    "S07-implementation-06");

  Instance instance = implementation.createInstance(null,
    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

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

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

  S07ImplementationImporter07 dependency = (S07ImplementationImporter07) instance
    .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",
View Full Code Here

    "S07-implementation-08");

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

  S07ImplementationImporter08 dependency = (S07ImplementationImporter08) instance
    .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",
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.pax.test.implS7.S07ImplementationImporter03

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.