Package fr.imag.adele.apam

Examples of fr.imag.adele.apam.Implementation


    public void AddedRemovedCallbackInDependencyDeclarationEmptySignature_tc085()
      throws BundleException {

  String message = "Into an <implementation>, when declaring a dependency, we may specify methods (without parameters) to be called as soon as the dependency is wired or unwired, those are 'added' and 'removed' attributes respectively. %s";

  Implementation impl = waitForImplByName(null,
    "S1Impl-added-removed-callback-signature-empty");
  apam.waitForIt(Constants.CONST_WAIT_TIME);

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

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

  Assert.assertTrue(
View Full Code Here


     *       fr.imag.adele.apam.core.CompositeDeclaration
     */
    @Test
    public void AtomicInstanceCreationWithoutInjection_tc012() {

  Implementation s1Impl = waitForImplByName(null,
    "fr.imag.adele.apam.pax.test.impl.S1Impl");

  // save the initial number of instances present in APAM
  int counterInstanceBefore = CST.componentBroker.getInsts().size();

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

  ImplementationDeclaration initialImplDecl = inst.getImpl()
    .getImplDeclaration();

  boolean found = false;
View Full Code Here

    }

    @Test
    public void CallbackInit_tc021() {

  Implementation s1Impl = waitForImplByName(null,
    "fr.imag.adele.apam.pax.test.impl.S1Impl");

  Instance s1Instance = s1Impl.createInstance(null,
    new HashMap<String, String>());

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

  Assert.assertTrue(
View Full Code Here

    }

    @Test
    public void CallbackRemove_tc022() throws BundleException {

  Implementation s1Impl = waitForImplByName(null,
    "fr.imag.adele.apam.pax.test.impl.S1Impl");

  Instance s1Instance = s1Impl.createInstance(null,
    new HashMap<String, String>());

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

  Assert.assertFalse(
View Full Code Here

    @Test
    public void ConstraintInjectionWhenEmptyPreferenceTagExistsAttribute_tc026()
      throws InvalidSyntaxException {

  Implementation lgImpl = waitForImplByName(null, "LgSwitch");
  final Instance lgInst = lgImpl.createInstance(null,
    new HashMap<String, String>() {
        {
      put("currentVoltage", "100");
        }
    });

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

  Implementation siemensImpl = waitForImplByName(null, "SiemensSwitch");
  final Instance siemensInst = siemensImpl.createInstance(null,
    new HashMap<String, String>() {
        {
      put("currentVoltage", "105");
        }
    });

  System.out.println("Instances before injection request");
  auxListInstances("\t");
  // 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

    @Test
    public void FindImplByName_tc027() {

  auxListInstances("before-");

  Implementation impl = waitForImplByName(null,
    "fr.imag.adele.apam.pax.test.impl.S1Impl");
  apam.waitForIt(Constants.CONST_WAIT_TIME);
  auxListInstances("after-");

  Assert.assertTrue(
View Full Code Here

  }

  @Test
  public void PropertiesInjectionStringIntoSetDataType_tc080() {

    Implementation implementation = waitForImplByName(null,
        "PropertyInjectionSwitch");

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

    PropertyInjectionTypeSwitch switchRef = (PropertyInjectionTypeSwitch) instance
        .getServiceObject();

    final String messageTemplate = "%s (value declared into <apam> ... <definition type='{%s}'/> ...</apam>)";
View Full Code Here

  }

  @Test
  public void PropertyChangeNoticationCallback_tc063() {

    Implementation implementation = waitForImplByName(null,
        "PropertyChangeNotification");
    Instance inst = implementation.createInstance(null, null);

    final String PROPERTY_NAME = "state";
    final String VALUE_NEW = "new value";
    final String message_fail_set = "Property being declared but after using instance.setAttribute the value inside the component did not correspont to the configured value";
    final String message_fail_callback = "The callback for property change notifications(using 'method' attribute) was not called";
View Full Code Here

  }

  @Test
  public void PropertyChangeNoticationCallbackCalledOnce_tc064() {

    Implementation implementation = waitForImplByName(null,
        "PropertyChangeNotification");
    Instance inst = implementation.createInstance(null, null);

    final String PROPERTY_NAME = "state";
    final String VALUE_NEW = "new value";
    final String message_fail_set = "Property being declared but after using instance.setAttribute the value inside the component did not correspont to the configured value";
    final String message_fail_callback = "The callback for property change notifications(using 'method' attribute) was called %s times, and should have been called only once";
View Full Code Here

   * Ensures that initial properties are configured in the instance properly
   */
  @Test
  public void PropertyConfiguredWithInitialParameter_tc002() {

    Implementation samsungImpl = waitForImplByName(null, "SamsungSwitch");

    Map<String, String> initialProperties = new HashMap<String, String>() {
      {
        put("property-01", "configured");
        put("property-02", "configured");
        put("property-03", "configured");
        put("property-04", "configured");
        put("property-05", "configured");
      }
    };

    Instance samsungInst = samsungImpl.createInstance(null,
        initialProperties);

    Assert.assertNotNull("Instance could not be create through the API",
        samsungInst);

View Full Code Here

TOP

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

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.