Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.LiteralName


        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case PPPackage.LITERAL_NAME: {
        LiteralName literalName = (LiteralName) theEObject;
        T result = caseLiteralName(literalName);
        if(result == null)
          result = caseLiteralExpression(literalName);
        if(result == null)
          result = caseExpression(literalName);
View Full Code Here


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

      SingleQuotedString slhs = pf.createSingleQuotedString();
      slhs.setText("\'x\'");
      LiteralName entrylhs = pf.createLiteralName();
      entrylhs.setValue("a");

      titleExpr.setLeftExpr(slhs);
      entry.setLeftExpr(entrylhs);
      entry.setRightExpr(pf.createLiteralBoolean());
      subTestValidateExpressionTitles(titleExpr);
View Full Code Here

    // -- Literal String
    {
      SingleQuotedString slhs = pf.createSingleQuotedString();
      slhs.setText("x");
      LiteralName entrylhs = pf.createLiteralName();
      entrylhs.setValue("a");

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

      tester.validate(se).assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
    }

    // -- LiteralName
    {
      LiteralName slhs = pf.createLiteralName();
      slhs.setValue("x");
      LiteralName entrylhs = pf.createLiteralName();
      entrylhs.setValue("a");

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

      tester.validate(se).assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
    }
    // -- LiteralNameOrReference
    {
      LiteralNameOrReference slhs = createNameOrReference("x");
      LiteralNameOrReference entrylhs = createNameOrReference("a");

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

      tester.validate(se).assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
    }
    // -- variable
    {
      VariableExpression slhs = pf.createVariableExpression();
      slhs.setVarName("$x");
      VariableExpression entrylhs = pf.createVariableExpression();
      entrylhs.setVarName("$a");

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

      tester.validate(se).assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
    }
    // -- function call
    {
      FunctionCall slhs = pf.createFunctionCall();
      slhs.setLeftExpr(createNameOrReference("include"));
      slhs.getParameters().add(pf.createLiteralBoolean());
      FunctionCall entrylhs = pf.createFunctionCall();
      entrylhs.setLeftExpr(createNameOrReference("include"));
      entrylhs.getParameters().add(pf.createLiteralBoolean());

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

      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

TOP

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

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.