Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.PuppetManifest


   */
  @Override
  protected T doSwitch(int classifierID, EObject theEObject) {
    switch(classifierID) {
      case PPPackage.PUPPET_MANIFEST: {
        PuppetManifest puppetManifest = (PuppetManifest) theEObject;
        T result = casePuppetManifest(puppetManifest);
        if(result == null)
          result = caseExpressionBlock(puppetManifest);
        if(result == null)
          result = caseExpression(puppetManifest);
View Full Code Here


   */
  private void provideSemanticHighlighting(XtextResource resource, IHighlightedPositionAcceptor acceptor) {
    EList<EObject> contents = resource.getContents();
    if(contents == null || contents.size() == 0)
      return; // nothing there at all - probably an empty file
    PuppetManifest model = (PuppetManifest) contents.get(0);
    doHighlight(model, acceptor);
  }
View Full Code Here

    // magic insertion of text not in the node model.
    return false;
  }

  private void subTestValidateExpressionTitles(Expression titleExpr) {
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();

    ResourceExpression re = createVirtualResourceExpression("file", titleExpr, "owner", createValue("0777"));
    statements.add(re);
    tester.validator().checkResourceExpression(re);
    tester.validator().checkResourceBody(re.getResourceData().get(0));
View Full Code Here

  }

  @Test
  public void test_Serialize_assignArray() throws Exception {
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();
    AssignmentExpression assignment = PPFactory.eINSTANCE.createAssignmentExpression();
    assignment.setLeftExpr(createVariable("a"));
    LiteralList pplist = PPFactory.eINSTANCE.createLiteralList();
    assignment.setRightExpr(pplist);
    pplist.getElements().add(createSqString("10"));
View Full Code Here

    assertEquals("serialization should produce same result", fmt, s);
  }

  @Test
  public void test_Serialize_DefaultResource() throws Exception {
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();
    statements.add(createResourceExpression(
      "File", NOTITLE, "owner", createValue("0777"), "group", createValue("0666"), "other", createValue("0555")));
    String s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_DefaultResource, s);
  }
View Full Code Here

    assertEquals("serialization should produce specified result", Sample_DefaultResource, s);
  }

  @Test
  public void test_Serialize_fromModel() throws Exception {
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();
    VariableExpression var = pf.createVariableExpression();
    var.setVarName("$a");
    statements.add(var);

    String s = serialize(pp);
View Full Code Here

    assertEquals("serialization should produce same result", "$a\n", s);
  }

  @Test
  public void test_Serialize_MResourcesMAttributes() throws Exception {
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();
    ResourceExpression re = createResourceExpression(
      "file", "a resource", "owner", createValue("0777"), "group", createValue("0666"), "other",
      createValue("0555"));
    re.getResourceData().add(
      createResourceBody(
View Full Code Here

    assertEquals("serialization should produce specified result", Sample_MResourcesMAttributes, s);
  }

  @Test
  public void test_Serialize_ResourceMAttributes() throws Exception {
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();
    statements.add(createResourceExpression(
      "file", "a resource", "owner", createValue("0777"), "group", createValue("0666"), "other",
      createValue("0555")));
    String s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_ResourceMAttributes, s);
View Full Code Here

   * @throws Exception
   */
  @Test
  public void test_Serialize_ResourceNoAttributes() throws Exception {
    // --with attribute definition
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();
    statements.add(createResourceExpression("class", "myclass"));
    String s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_ResourceNoAttributes, s);

  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void test_Serialize_ResourceOneAttribute() throws Exception {
    // --with attribute definition
    PuppetManifest pp = pf.createPuppetManifest();
    EList<Expression> statements = pp.getStatements();
    statements.add(createResourceExpression("file", "a resource", "owner", "fred"));
    String s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_ResourceOneAttribute, s);

    // --with attribute addition
    pp = pf.createPuppetManifest();
    statements = pp.getStatements();
    statements.add(createResourceExpression(true, "File", "a resource", "owner", "fred"));
    s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_ResourceOneAddAttribute, s);
  }
View Full Code Here

TOP

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

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.