Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.LiteralNameOrReference


  @Test
  public void test_Validate_AssignmentExpression_NotOk() {
    PuppetManifest pp = pf.createPuppetManifest();
    AssignmentExpression ae = pf.createAssignmentExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    LiteralNameOrReference v = createNameOrReference("x");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);

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


    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

    // -- 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("->");
    rel1.setLeftExpr(r1);
    rel1.setRightExpr(r2);
View Full Code Here

  protected AttributeOperation createAttributeDefinition(String name, String value) {
    return createAttributeDefinition(name, createNameOrReference(value));
  }

  protected LiteralNameOrReference createNameOrReference(String name) {
    LiteralNameOrReference o = pf.createLiteralNameOrReference();
    o.setValue(name);
    return o;
  }
View Full Code Here

      resourceName.setExported(exported);
      resourceExpr = resourceName;

    }
    else {
      LiteralNameOrReference resourceName = pf.createLiteralNameOrReference();
      resourceName.setValue(type);
      resourceExpr = resourceName;
    }
    re.setResourceExpr(resourceExpr);

    re.getResourceData().add(createResourceBody(additive, title, keyValPairs));
View Full Code Here

    s.setText(text);
    return s;
  }

  protected Expression createValue(String txt) {
    LiteralNameOrReference v = pf.createLiteralNameOrReference();
    v.setValue(txt);
    return v;
  }
View Full Code Here

TOP

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

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.