Package gherkin.formatter.model

Examples of gherkin.formatter.model.DataTableRow


        StringWriter writer = new StringWriter();
        PrettyFormatter pf = new PrettyFormatter(writer, true, false);
        List<Row> table = new ArrayList<Row>();
        for (String key : KEYWORD_KEYS) {
            List<String> cells = Arrays.asList(key, join(map(keywords(key), QUOTE_MAPPER), ", "));
            table.add(new DataTableRow(Collections.<Comment>emptyList(), cells, -1));
        }
        for (String key : STEP_KEYWORD_KEYS) {
            List<String> codeKeywordList = new ArrayList<String>(keywords.get(key));
            codeKeywordList.remove("* ");
            String codeKeywords = join(map(map(codeKeywordList, CODE_KEYWORD_MAPPER), QUOTE_MAPPER), ", ");

            List<String> cells = Arrays.asList(key + " (code)", codeKeywords);
            table.add(new DataTableRow(Collections.<Comment>emptyList(), cells, -1));
        }
        pf.table(table);
        return writer.getBuffer().toString();
    }
View Full Code Here


    private List<DataTableRow> dataTableRows(List o) {
        List<DataTableRow> rows = new ArrayList<DataTableRow>(o.size());
        for (Object e : o) {
            Map row = (Map) e;
            rows.add(new DataTableRow(comments(row), getList(row, "cells"), getInt(row, "line")));
        }
        return rows;
    }
View Full Code Here

    String[] header =
        original.topCells().size() == 2 ? new String[] { "name", "value" } : new String[] { "type", "name",
                                                                                            "value" };

    List<DataTableRow> newRows = new LinkedList<DataTableRow>();
    newRows.add( new DataTableRow( Collections.<Comment>emptyList(), Arrays.asList( header ), 0 ) );
    newRows.addAll( original.getGherkinRows() );

    return new DataTable( newRows, original.getTableConverter() );
  }
View Full Code Here

TOP

Related Classes of gherkin.formatter.model.DataTableRow

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.