public DocStringDTO(DocString doc) { contentType = doc.getContentType(); line = doc.getLine(); value = doc.getValue(); }
public DocString toDocString() { return new DocString(contentType, value, line); } }
/** * Generate multiline argument (DataTable or DocString) representation * * @param step - Cucumber step object * @return - transformed multiline argument (or empty string if there is * none) */ public static String buildMultilineArgument(Step step) { List<DataTableRow> table = step.getRows(); DocString ds = step.getDocString(); StringBuilder marg = new StringBuilder(); if (table != null) { marg.append("\r\n"); for (Row row : table) { marg.append(TABLE_SEPARATOR); for (String cell : row.getCells()) { marg.append(" ").append(cell).append(" ").append(TABLE_SEPARATOR); } marg.append("\r\n"); } } if (ds != null) { marg.append(DOCSTRING_DECORATOR).append(ds.getValue()).append(DOCSTRING_DECORATOR); } return marg.toString(); } }
@Override public Range getLineRange() { Range range = super.getLineRange(); if (getRows() != null) { range = new Range(range.getFirst(), getRows().get(getRows().size() - 1).getLine()); } else if (getDocString() != null) { range = new Range(range.getFirst(), getDocString().getLineRange().getLast()); } return range; }
public void docString(DocString docString) { out.println(" \"\"\""); out.println(escapeTripleQuotes(indent(docString.getValue(), " "))); out.println(" \"\"\""); }
public StepExec convertStep(Step step) { StepExec stepExec = new StepExec(step.getKeyword(), step.getName()); stepExec.declareComments(convertComments(step.getComments())); DocString docString = step.getDocString(); if (docString != null) { stepExec.declareDocString(docString.getValue()); } stepExec.declareTable(convertTable(step.getRows())); return stepExec; }
@Override public void docString(String contentType, String content, Integer line) { currentBuilder.docString(new DocString(contentType, content, line)); }
if (o.containsKey("doc_string")) { Map ds = (Map) o.get("doc_string"); docString = new DocString(getString(ds, "content_type"), getString(ds, "value"), getInt(ds, "line"));