Examples of PuppetManifest


Examples of com.puppetlabs.geppetto.pp.PuppetManifest

    tester.validate(me).assertOK();
  }

  @Test
  public void test_Validate_RelationshipExpression_NotOk() {
    PuppetManifest pp = pf.createPuppetManifest();
    // -- check file { 'file1': } -> file{'file2': } -> file{'file3' : }
    RelationshipExpression rel1 = pf.createRelationshipExpression();
    pp.getStatements().add(rel1);

    ResourceExpression r1 = createResourceExpression("file", "file1");
    LiteralNameOrReference r2 = createNameOrReference("a");

    rel1.setOpName("->");
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

   * Test that the four different relationship expressions operands can be used between
   * the allowed operands.
   */
  @Test
  public void test_Validate_RelationshipExpression_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    // -- check file { 'file1': } -> file{'file2': } -> file{'file3' : }
    RelationshipExpression rel1 = pf.createRelationshipExpression();
    RelationshipExpression rel2 = pf.createRelationshipExpression();
    pp.getStatements().add(rel2);
    ResourceExpression r1 = createResourceExpression("file", "'file1'");
    ResourceExpression r2 = createResourceExpression("file", "'file2'");
    ResourceExpression r3 = createResourceExpression("file", "'file3'");

    rel1.setOpName("->");
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

  }

  @Test
  public void test_Validate_VariableExpression_NotOk() {
    PuppetManifest pp = pf.createPuppetManifest();
    VariableExpression v = pf.createVariableExpression();
    pp.getStatements().add(v);

    // name is null
    tester.validate(v).assertError(IPPDiagnostics.ISSUE__NOT_VARNAME);

    v.setVarName("");
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

    tester.validate(v).assertError(IPPDiagnostics.ISSUE__NOT_VARNAME);
  }

  @Test
  public void test_Validate_VariableExpression_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    VariableExpression v = pf.createVariableExpression();
    pp.getStatements().add(v);
    v.setVarName("$x");

    tester.validate(v).assertOK();

    v.setVarName("$abc123");
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

  /**
   * Test that model without node-model formats and adds the optional end comma in a list.
   */
  @Test
  public void test_List_NoNodeModel() throws Exception {
    PuppetManifest pp = pf.createPuppetManifest();
    AssignmentExpression assignment = PPFactory.eINSTANCE.createAssignmentExpression();
    assignment.setLeftExpr(createVariable("a"));
    LiteralList pplist = PPFactory.eINSTANCE.createLiteralList();
    assignment.setRightExpr(pplist);
    pplist.getElements().add(createSqString("10"));
    pplist.getElements().add(createSqString("20"));
    pp.getStatements().add(assignment);
    String fmt = "$a = ['10', '20',]\n";
    String s = serializeFormatted(pp);
    assertEquals("formatting should produce wanted result", fmt, s);
  }
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

    assertEquals("serialization should produce expected on-spaced result", fmt, s);
  }

  @Test
  public void test_Serialize_assignArray() throws Exception {
    PuppetManifest pp = pf.createPuppetManifest();
    AssignmentExpression assignment = PPFactory.eINSTANCE.createAssignmentExpression();
    assignment.setLeftExpr(createVariable("a"));
    LiteralList pplist = PPFactory.eINSTANCE.createLiteralList();
    assignment.setRightExpr(pplist);
    pplist.getElements().add(createSqString("10"));
    pplist.getElements().add(createSqString("20"));
    pp.getStatements().add(assignment);
    String fmt = "$a = [ '10' , '20' , ]";
    String s = serialize(pp);
    assertEquals("serialization should produce single spaced result", fmt, s);

  }
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

  // @formatter:on

  @Test
  public void test_Serialize_SelectorExpression() {
    PuppetManifest pp = pf.createPuppetManifest();
    SelectorExpression se = pf.createSelectorExpression();
    pp.getStatements().add(se);

    SelectorEntry entry = pf.createSelectorEntry();
    se.getParameters().add(entry);

    LiteralNameOrReference slhs = pf.createLiteralNameOrReference();
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

  }

  @Test
  public void test_Validate_SelectorExpression_NotOk() {
    PuppetManifest pp = pf.createPuppetManifest();
    SelectorExpression se = pf.createSelectorExpression();
    pp.getStatements().add(se);

    SelectorEntry entry = pf.createSelectorEntry();
    se.getParameters().add(entry);

    AdditiveExpression slhs = pf.createAdditiveExpression();
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

  }

  @Test
  public void test_Validate_SelectorExpression_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    SelectorExpression se = pf.createSelectorExpression();
    pp.getStatements().add(se);

    SelectorEntry entry = pf.createSelectorEntry();
    se.getParameters().add(entry);

    // -- Literal String
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.PuppetManifest

    tester.validate(r.getContents().get(0)).assertOK();
  }

  @Test
  public void test_Serialize_AppendExpression() {
    PuppetManifest pp = pf.createPuppetManifest();
    AppendExpression ae = pf.createAppendExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    b.setValue(true);
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$x");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);

    String s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_Append, s);
  }
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.