Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.PuppetManifest


   * Tests assignment not ok states:
   * - $a::b = expr
   */
  @Test
  public void test_Validate_AssignmentExpression_NotOk_Scope() {
    PuppetManifest pp = pf.createPuppetManifest();
    AssignmentExpression ae = pf.createAssignmentExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$a::b");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);

    tester.validate(pp).assertError(IPPDiagnostics.ISSUE__ASSIGNMENT_OTHER_NAMESPACE);
  }
View Full Code Here


   * - $x = expr
   * - $x[expr] = expr
   */
  @Test
  public void test_Validate_AssignmentExpression_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    AssignmentExpression ae = pf.createAssignmentExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$x");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);

    tester.validate(pp).assertOK();

    AtExpression at = pf.createAtExpression();
    at.setLeftExpr(v);
View Full Code Here

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

  @Test
  public void test_Validate_ImportExpression_NotOk() {
    PuppetManifest pp = pf.createPuppetManifest();
    ImportExpression ip = pf.createImportExpression();
    pp.getStatements().add(ip);

    tester.validate(ip).assertError(IPPDiagnostics.ISSUE__REQUIRED_EXPRESSION);
  }
View Full Code Here

    tester.validate(ip).assertError(IPPDiagnostics.ISSUE__REQUIRED_EXPRESSION);
  }

  @Test
  public void test_Validate_ImportExpression_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    ImportExpression ip = pf.createImportExpression();
    ip.getValues().add(createSqString("somewhere/*.pp"));
    pp.getStatements().add(ip);

    tester.validate(ip).assertOK();
    ip.getValues().add(createSqString("nowhere/*.pp"));
    tester.validate(ip).assertOK();
  }
 
View Full Code Here

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

  @Test
  public void test_Validate_Manifest_NotOk() {
    PuppetManifest pp = pf.createPuppetManifest();
    VariableExpression v = pf.createVariableExpression();
    pp.getStatements().add(v);
    v.setVarName("$x");
    tester.validate(pp).assertError(IPPDiagnostics.ISSUE__NOT_TOPLEVEL);
  }
View Full Code Here

    tester.validate(pp).assertError(IPPDiagnostics.ISSUE__NOT_TOPLEVEL);
  }

  @Test
  public void test_Validate_Manifest_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    AssignmentExpression a = pf.createAssignmentExpression();
    VariableExpression v = pf.createVariableExpression();
    pp.getStatements().add(a);
    v.setVarName("$x");
    a.setLeftExpr(v);
    LiteralNameOrReference value = createNameOrReference("10");
    a.setRightExpr(value);
    tester.validate(pp).assertOK();
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.