Examples of Implementation


Examples of fr.imag.adele.apam.Implementation

    Composite compositeInstance = (Composite) composite.createInstance(
        null, null);

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    Implementation trigger = waitForImplByName(null,
        "group-a-start-trigger");

    Instance triggerInstance = trigger.createInstance(compositeInstance,
        null);

    Implementation triggered = waitForImplByName(null,
        "group-b-started-by-trigger");

    Assert.assertTrue(triggerInstance != null);

    List<Instance> instancesOfB = auxLookForInstanceOf(((AtomicImplementationDeclaration) triggered
        .getImplDeclaration()).getClassName());

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    auxListInstances("INSTANCE-t2-");
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    Composite compositeInstance = (Composite) composite.createInstance(
        null, null);

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    Implementation trigger = waitForImplByName(null,
        "group-a-start-trigger");

    Implementation triggered = waitForImplByName(null,
        "group-b-started-by-trigger");

    Instance triggerInstance = trigger.createInstance(compositeInstance,
        null);

    Assert.assertTrue(triggerInstance != null);

    List<Instance> instancesOfB = auxLookForInstanceOf(((AtomicImplementationDeclaration) triggered
        .getImplDeclaration()).getClassName());

    apam.waitForIt(Constants.CONST_WAIT_TIME);

    auxListInstances("INSTANCE-t2-");
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

 
  @Test
  public void getNewPredefinedProperties_tct039()
      throws InvalidSyntaxException {

    Implementation client = waitForImplByName(null, "implem-client");
    System.err.println("properties, "+client.getImplDeclaration().getProperties());
    Assert.assertNotNull("client must exists", client);
    Assert.assertNotNull("Property maven.groupId must exist ",client.getPropertyObject("maven.groupId"));
    Assert.assertEquals("Property maven.groupId type is a string ", "string", client.getPropertyDefinition("maven.groupId").getType());
   
    Assert.assertNotNull("Property maven.artifactId must exist ",client.getPropertyObject("maven.artifactId"));
    Assert.assertEquals("Property maven.artifactId type is a string ", "string", client.getPropertyDefinition("maven.artifactId").getType());
   
    Assert.assertNotNull("Property maven.version must exist ",client.getPropertyObject("maven.version"));
    Assert.assertEquals("Property maven.version type is a string ", "string", client.getPropertyDefinition("maven.version").getType());
   
    Assert.assertNotNull("Property apam.version must exist ",client.getPropertyObject("apam.version"));
    Assert.assertEquals("Property apam.version type is a version ", "version", client.getPropertyDefinition("apam.version").getType());
   
    Assert.assertNotNull("Property version must exist ",client.getPropertyObject("version"));
    Assert.assertEquals("Property version type is a version ", "version", client.getPropertyDefinition("version").getType());
  }
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

 
  @Test
  public void getPropertyVersion_tct040()
      throws InvalidSyntaxException {

    Implementation client = waitForImplByName(null, "implem-client");
    Assert.assertNotNull("client must exists", client);
    System.err.println("Client implem properties, "+client.getImplDeclaration().getProperties());

    System.err.println("version : "+client.getProperty("testVersionProp"));   
    Assert.assertNotNull("Property testVersionProp must exist ",client.getPropertyObject("testVersionProp"));
    Assert.assertEquals("Property testVersionProp type is a version ", "version", client.getPropertyDefinition("testVersionProp").getType());
    Assert.assertEquals("Property testVersionProp value is 1.2.3 ", Version.parseVersion("1.2.3"), client.getPropertyObject("testVersionProp"));
   
    client.setProperty("testVersionDef", Version.parseVersion("4.5.6"));
    Assert.assertNotNull("Property testVersionDef must exist ",client.getPropertyObject("testVersionDef"));
    Assert.assertEquals("Property testVersionDef type is a version ", "version", client.getPropertyDefinition("testVersionDef").getType());
    Assert.assertEquals("Property testVersionDef value is 4.5.6 ", Version.parseVersion("4.5.6"), client.getPropertyObject("testVersionDef"));
   
    System.err.println("Creating an instance, defined properties should be inherited");

    Instance instClient = client.createInstance(null, null);
    System.err.println("Client instance properties, "+instClient.getAllProperties().entrySet());

    Assert.assertNotNull("Property testVersionProp must exist ",instClient.getPropertyObject("testVersionProp"));
    Assert.assertEquals("Property testVersionProp type is a version ", "version", instClient.getPropertyDefinition("testVersionProp").getType());
    Assert.assertEquals("Property testVersionProp value is 1.2.3 ", Version.parseVersion("1.2.3"), instClient.getPropertyObject("testVersionProp"));
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    }

    @Test
    public void ConstraintsCheckingImplementation_tc009() {

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

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

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

  Instance philipsSwitch = CST.componentBroker.getInstService(s1
    .getSimpleDevice110v());
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    @Test
    public void ConstraintsCheckingInstanceFilteringByInitialProperty_tc010()
      throws InvalidSyntaxException {

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

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

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

  Implementation boschImpl = waitForImplByName(null, "BoschSwitch");
  final Instance boschInst = boschImpl.createInstance(null,
    new HashMap<String, String>() {
        {
      put("currentVoltage", "110");
        }
    });

  Implementation philipsImpl = waitForImplByName(null, "philipsSwitch");
  final Instance philipsInst = philipsImpl.createInstance(null,
    new HashMap<String, String>() {
        {
      put("currentVoltage", "117");
        }
    });

  Set<Instance> validInstances = new HashSet<Instance>() {
      {
    add(siemensInst);
    add(lgInst);
    add(boschInst);
    add(samsungInst);
      }
  };

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

  // apam.waitForIt(Constants.CONST_WAIT_TIME);

  Instance s1Inst = s1Impl.createInstance(null, null);
  S1Impl s1 = (S1Impl) s1Inst.getServiceObject();

  // apam.waitForIt(Constants.CONST_WAIT_TIME);

  for (Eletronic e : s1.getEletronicInstancesConstraintsInstance()) {
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    @Test
    public void ConstraintsCheckingInstanceFilteringBySetProperty_tc011()
      throws InvalidSyntaxException {

  Implementation samsungImpl = waitForImplByName(null, "SamsungSwitch");
  final Instance samsungInst = samsungImpl.createInstance(null, null);

  Implementation lgImpl = waitForImplByName(null, "LgSwitch");
  final Instance lgInst = lgImpl.createInstance(null, null);

  Implementation siemensImpl = waitForImplByName(null, "SiemensSwitch");
  final Instance siemensInst = siemensImpl.createInstance(null, null);

  Implementation boschImpl = waitForImplByName(null, "BoschSwitch");
  final Instance boschInst = boschImpl.createInstance(null, null);

  Implementation philipsImpl = waitForImplByName(null, "philipsSwitch");
  final Instance philipsInst = philipsImpl.createInstance(null, null);

  samsungInst.setProperty("currentVoltage", "95");
  lgInst.setProperty("currentVoltage", "100");
  siemensInst.setProperty("currentVoltage", "105");
  boschInst.setProperty("currentVoltage", "110");
  philipsInst.setProperty("currentVoltage", "117");

  apam.waitForIt(Constants.CONST_WAIT_TIME);

  Set<Instance> validInstances = new HashSet<Instance>() {
      {
    add(siemensInst);
    add(lgInst);
    add(boschInst);
    add(samsungInst);
      }
  };

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

  Instance s1Inst = s1Impl.createInstance(null, null);
  S1Impl s1 = (S1Impl) s1Inst.getServiceObject();

  // auxListInstanceReferencedBy("#################",s1.getEletronicInstancesConstraintsInstance());
  auxListInstances("-------Available instances before using the list-------");
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

  return addon;
    }

    @Test
    public void FunctionCall_tc093() {
  Implementation subjectAimpl = waitForImplByName(null, "subject-a");

  Instance subjectA = subjectAimpl.createInstance(null, null);

  S6Impl s6 = (S6Impl) subjectA.getServiceObject();

  auxListProperties("\t", subjectA);
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    .equals(s6.functionCall(null)));
    }

    @Test
    public void FunctionCallEscaped_tc094() {
  Implementation subjectAimpl = waitForImplByName(null, "subject-a");

  Instance subjectA = subjectAimpl.createInstance(null, null);

  auxListProperties("\t", subjectA);

  String template = "after fetching a property value (pointing to a function which the '@' was escaped with backslash) the returned value do not correspond to the returned function. Value '%s' was returned instead of '%s'";
  String message = String.format(template,
View Full Code Here

Examples of fr.imag.adele.apam.Implementation

    }

    @Test
    public void SubstitutionGetPropertyEscaped_tc095() {
  Implementation subjectAimpl = waitForImplByName(null, "subject-a");

  Instance subjectA = subjectAimpl.createInstance(null, null);

  auxListProperties("\t", subjectA);

  String templace = "after fetching a property value (pointing to metasubstitution) with '$' escaped (with backslash), the content should not be processed by metasubtitution. Value was %s instead of %s";
  String message = String.format(templace,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.