Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.HostClassDefinition


        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case PPPackage.HOST_CLASS_DEFINITION: {
        HostClassDefinition hostClassDefinition = (HostClassDefinition) theEObject;
        T result = caseHostClassDefinition(hostClassDefinition);
        if(result == null)
          result = caseDefinition(hostClassDefinition);
        if(result == null)
          result = caseExpression(hostClassDefinition);
View Full Code Here


   * @return
   */
  protected Map<String, String> getDataForEObject(EObject eObject) {
    // pp: class x inherits y {}
    if(eObject.eClass() == PPPackage.Literals.HOST_CLASS_DEFINITION) {
      HostClassDefinition d = (HostClassDefinition) eObject;
      Map<String, String> data = Maps.newHashMapWithExpectedSize(2);
      if(d.getParent() != null && d.getParent().eClass() == PPPackage.Literals.LITERAL_NAME_OR_REFERENCE) {
        String parentName = ((LiteralNameOrReference) d.getParent()).getValue();
        data.put(PPDSLConstants.PARENT_NAME_DATA, parentName);
      }
      int argCount = d.getArguments() == null
          ? 0
          : d.getArguments().getArguments().size();
      if(argCount > 0)
        data.put(PPDSLConstants.CLASS_ARG_COUNT, Integer.toString(argCount));
      return data;
    }
    else if(eObject.eClass() == PPPackage.Literals.DEFINITION_ARGUMENT) {
View Full Code Here

  }

  @Test
  public void test_Serialize_HostClassExpression() {
    PuppetManifest pp = pf.createPuppetManifest();
    HostClassDefinition cd = pf.createHostClassDefinition();
    pp.getStatements().add(cd);
    cd.setClassName("testClass");

    String s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_ClassDefinition, s);

  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.pp.HostClassDefinition

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.