Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.LiteralBoolean


        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case PPPackage.LITERAL_BOOLEAN: {
        LiteralBoolean literalBoolean = (LiteralBoolean) theEObject;
        T result = caseLiteralBoolean(literalBoolean);
        if(result == null)
          result = caseLiteralExpression(literalBoolean);
        if(result == null)
          result = caseExpression(literalBoolean);
View Full Code Here


    LiteralNameOrReference entrylhs = pf.createLiteralNameOrReference();
    entrylhs.setValue("a");

    se.setLeftExpr(slhs);
    entry.setLeftExpr(entrylhs);
    LiteralBoolean b = pf.createLiteralBoolean();
    b.setValue(true);
    entry.setRightExpr(b);

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

    // add a second entry and format
    entry = pf.createSelectorEntry();
    se.getParameters().add(entry);

    entrylhs = pf.createLiteralNameOrReference();
    entrylhs.setValue("be");
    entry.setLeftExpr(entrylhs);
    b = pf.createLiteralBoolean();
    b.setValue(false);
    entry.setRightExpr(b);

    s = serializeFormatted(pp);
    assertEquals("serialization should produce specified result", Sample_Selector2, s);
View Full Code Here

      tester.validate(se).assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
    }
    // boolean
    {
      LiteralBoolean slhs = pf.createLiteralBoolean();
      LiteralBoolean entrylhs = pf.createLiteralBoolean();

      se.setLeftExpr(slhs);
      entry.setLeftExpr(entrylhs);
      entry.setRightExpr(pf.createLiteralBoolean());

      tester.validate(se).assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
    }
    // -- undef
    {
      LiteralUndef slhs = pf.createLiteralUndef();
      LiteralUndef entrylhs = pf.createLiteralUndef();

      se.setLeftExpr(slhs);
      entry.setLeftExpr(entrylhs);
      entry.setRightExpr(pf.createLiteralBoolean());

      tester.validate(se).assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
    }
    // -- regex
    {
      LiteralRegex slhs = pf.createLiteralRegex();
      slhs.setValue("/[a-z]*/");
      LiteralRegex entrylhs = pf.createLiteralRegex();
      entrylhs.setValue("/[a-z]*/");

      se.setLeftExpr(slhs);
      entry.setLeftExpr(entrylhs);
      entry.setRightExpr(pf.createLiteralBoolean());

 
View Full Code Here

  @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);
View Full Code Here

  @Test
  public void test_Serialize_AssignmentExpression() {
    PuppetManifest pp = pf.createPuppetManifest();
    AssignmentExpression ae = pf.createAssignmentExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    b.setValue(true);
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$x");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);
View Full Code Here

  public void test_Validate_AppendExpression_NotOk() {
    PuppetManifest pp = pf.createPuppetManifest();
    AppendExpression ae = pf.createAppendExpression();
    pp.getStatements().add(ae);

    LiteralBoolean b = pf.createLiteralBoolean();
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$x");
    AtExpression at = pf.createAtExpression();
    at.setLeftExpr(v);
    at.getParameters().add(createNameOrReference("a"));
View Full Code Here

   */
  @Test
  public void test_Validate_AppendExpression_NotOk_Decimal() {
    PuppetManifest pp = pf.createPuppetManifest();
    AppendExpression ae = pf.createAppendExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$0");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);
View Full Code Here

   */
  @Test
  public void test_Validate_AppendExpression_NotOk_Scope() {
    PuppetManifest pp = pf.createPuppetManifest();
    AppendExpression ae = pf.createAppendExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$a::b");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);
View Full Code Here

   */
  @Test
  public void test_Validate_AppendExpression_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    AppendExpression ae = pf.createAppendExpression();
    LiteralBoolean b = pf.createLiteralBoolean();
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$x");
    ae.setLeftExpr(v);
    ae.setRightExpr(b);
    pp.getStatements().add(ae);
View Full Code Here

  @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);
View Full Code Here

TOP

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

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.