Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.LiteralRegex


        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case PPPackage.LITERAL_REGEX: {
        LiteralRegex literalRegex = (LiteralRegex) theEObject;
        T result = caseLiteralRegex(literalRegex);
        if(result == null)
          result = caseLiteralExpression(literalRegex);
        if(result == null)
          result = caseExpression(literalRegex);
View Full Code Here


    }
  }

  @Test
  public void test_Validate_LiteralRegex_NotOk() {
    LiteralRegex r = pf.createLiteralRegex();
    r.setValue("/[a-zA-Z0-9]*");
    tester.validator().checkLiteralRegex(r);
    tester.diagnose().assertError(IPPDiagnostics.ISSUE__NOT_REGEX);

    r.setValue("/[a-zA-Z0-9]*\\/");
    tester.validator().checkLiteralRegex(r);
    tester.diagnose().assertError(IPPDiagnostics.ISSUE__NOT_REGEX);

    r.setValue("/[a-zA-Z0-9]*/i");
    tester.validator().checkLiteralRegex(r);
    tester.diagnose().assertError(IPPDiagnostics.ISSUE__UNSUPPORTED_REGEX_FLAGS);
  }
 
View Full Code Here

   * Test regular expression ok states:
   * TODO: add more tests - this is just a smoke-test
   */
  @Test
  public void test_Validate_LiteralRegex_Ok() {
    LiteralRegex r = pf.createLiteralRegex();
    r.setValue("/[a-zA-Z0-9]*/");
    tester.validator().checkLiteralRegex(r);
    tester.diagnose().assertOK();

  }
 
View Full Code Here

      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_MatchingExpression() {
    PuppetManifest pp = pf.createPuppetManifest();
    MatchingExpression me = pf.createMatchingExpression();
    LiteralRegex regex = pf.createLiteralRegex();
    regex.setValue("/[a-z]*/");
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$x");
    me.setLeftExpr(v);
    me.setOpName("=~");
    me.setRightExpr(regex);
View Full Code Here

  @Test
  public void test_Validate_MatchingExpression_Ok() {
    PuppetManifest pp = pf.createPuppetManifest();
    MatchingExpression me = pf.createMatchingExpression();
    LiteralRegex regex = pf.createLiteralRegex();
    regex.setValue("/[a-z]*/");
    VariableExpression v = pf.createVariableExpression();
    v.setVarName("$x");
    me.setLeftExpr(v);
    me.setOpName("=~");
    me.setRightExpr(regex);
View Full Code Here

TOP

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

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.