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

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


    "S07-implementation-09");

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

  S07ImplementationImporter09 dependency = (S07ImplementationImporter09) 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-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

    "S07-implementation-11");

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

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

  Exception raised = null;

  try {
      // Force field injection
      dependency.getInjected();
  } catch (Exception e) {
      // If arrive at this block, the test has passed
      raised = e;
  }
View Full Code Here

    "S07-implementation-12");

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

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

  Exception raised = null;

  try {
      // Force field injection
      dependency.getInjected();
  } catch (Exception e) {
      // If arrive at this block, the test has passed
      raised = e;
  }
View Full Code Here

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

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

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

  // Force field injection
  dependency.getInjected();

  ComponentImpl ci = (ComponentImpl) instance;

  auxListInstances();
View Full Code Here

    });

  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

    });

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

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

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

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

      {
    put("instance-property", "ok");
      }
  });// Collections.<String, String> emptyMap()

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

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

  }

  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, "Instance", "Implementation",
      instance.getServiceObject()),
    dependency.getInjected().getProperty("instance-property") == null
      && dependency.getInjected().getProperty(
        "implementation-property") != null
      && dependency.getInjected().getProperty(
        "specification-property") != null);

    }
View Full Code Here

      {
    put("instance-property", "ok");
      }
  });// Collections.<String, String> emptyMap()

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

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

  }

  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, "Instance", "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

TOP

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

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.