Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.DoubleQuotedString


        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case PPPackage.DOUBLE_QUOTED_STRING: {
        DoubleQuotedString doubleQuotedString = (DoubleQuotedString) theEObject;
        T result = caseDoubleQuotedString(doubleQuotedString);
        if(result == null)
          result = caseStringExpression(doubleQuotedString);
        if(result == null)
          result = caseIQuotedString(doubleQuotedString);
View Full Code Here


    XtextResource r = getResourceFromString(code);
    EObject result = r.getContents().get(0);
    assertTrue("Should be a PuppetManifest", result instanceof PuppetManifest);
    result = ((PuppetManifest) result).getStatements().get(0);
    assertTrue("Should be a DoubleQuotedString", result instanceof DoubleQuotedString);
    DoubleQuotedString string = (DoubleQuotedString) result;

    List<TextExpression> t = string.getStringPart();
    assertEquals("List should have 1 entry", 1, t.size());
    assertTrue("List should have an instance of VerbatimTE", t.get(0) instanceof VerbatimTE);
    assertEquals("First element should be 'before'", "before$/after", ((VerbatimTE) t.get(0)).getText());
  }
View Full Code Here

    XtextResource r = getResourceFromString(code);
    EObject result = r.getContents().get(0);
    assertTrue("Should be a PuppetManifest", result instanceof PuppetManifest);
    result = ((PuppetManifest) result).getStatements().get(0);
    assertTrue("Should be a DoubleQuotedString", result instanceof DoubleQuotedString);
    DoubleQuotedString string = (DoubleQuotedString) result;

    List<TextExpression> t = string.getStringPart();
    assertEquals("List should have 3 entries", 3, t.size());
    assertTrue("List first entry should be VerbatimTE", t.get(0) instanceof VerbatimTE);
    assertEquals("First element should be 'before'", "before", ((VerbatimTE) t.get(0)).getText());

    assertTrue(
View Full Code Here

    XtextResource r = getResourceFromString(code);
    EObject result = r.getContents().get(0);
    assertTrue("Should be a PuppetManifest", result instanceof PuppetManifest);
    result = ((PuppetManifest) result).getStatements().get(0);
    assertTrue("Should be a DoubleQuotedString", result instanceof DoubleQuotedString);
    DoubleQuotedString string = (DoubleQuotedString) result;

    List<TextExpression> t = string.getStringPart(); // flattenTextExpression(string.getTextExpression());
    assertEquals("List should have 3 entries", 3, t.size());
    assertEquals("First element should be 'before'", "before", ((VerbatimTE) t.get(0)).getText());
    assertTrue("Second element should be VariableTE", t.get(1) instanceof VariableTE);
    assertEquals("Second element should be '$var'", "$var", ((VariableTE) t.get(1)).getVarName());
    assertEquals("Third element should be '/after'", "/after", ((VerbatimTE) t.get(2)).getText());
View Full Code Here

    assertTrue("Should be a PuppetManifest", result instanceof PuppetManifest);
    result = ((PuppetManifest) result).getStatements().get(0);

    assertTrue("Should be a DoubleQuotedString", result instanceof DoubleQuotedString);

    DoubleQuotedString string = (DoubleQuotedString) result;
    List<TextExpression> te = string.getStringPart(); // string.getTextExpression();
    assertEquals("Should be one text expression", 1, te.size());
    assertTrue("Should be a single verbatim TE", te.get(0) instanceof VerbatimTE);
    assertEquals("Should contain the original", original, ((VerbatimTE) te.get(0)).getText());
  }
View Full Code Here

  }

  @Test
  public void test_Validate_DoubleQuotedString_Ok() {
    DoubleQuotedString ls = pf.createDoubleQuotedString();
    VerbatimTE te = pf.createVerbatimTE();
    ls.getStringPart().add(te);
    te.setText("I am a single quoted string with a tab \\t char");
    tester.validator().checkVerbatimTextExpression(te);
    tester.diagnose().assertOK();

    // -- control char
View Full Code Here

TOP

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

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.