protected Parse appendCell(Parse row, String text) { Parse lastCell = new Parse("td", text, null, null); row.parts.last().more = lastCell; return lastCell; }
protected Parse appendCell(Parse row, String text) { Parse lastCell = new Parse("td", text, null, null); row.parts.last().more = lastCell; return lastCell; }
private Parse createTestTableParse() throws Exception { return new Parse("<table>" + "<tr><td>Fake Fixture</td></tr>" + "<tr><td>arg1</td><td>arg2</td></tr>" + "</table>"); } }
protected void exception(Exception e) { tables = new Parse("body", "Unable to parse input. Input ignored.", null, null); fixture.exception(tables, e); }
public Parse makeMessageCell(Exception e) { Parse errorCell = new Parse("td", "", null, null); final StringWriter buffer = new StringWriter(); e.printStackTrace(new PrintWriter(buffer)); errorCell.addToTag(" colspan=\"" + (columnBindings.length + 1) + "\""); errorCell.addToBody("<i>" + ERROR_INDICATOR + e.getMessage() + "</i>"); errorCell.addToBody("<pre>" + (buffer.toString()) + "</pre>"); wrong(errorCell); return errorCell; }
public Parse makeMessageCell(Exception e) { Parse errorCell = new Parse("td", "", null, null); final StringWriter buffer = new StringWriter(); e.printStackTrace(new PrintWriter(buffer)); errorCell.addToTag(" colspan=\"" + (columnBindings.length + 1) + "\""); errorCell.addToBody("<i>" + ERROR_INDICATOR + e.getMessage() + "</i>"); errorCell.addToBody("<pre>" + (buffer.toString()) + "</pre>"); wrong(errorCell); return errorCell; }
@Override public void process() { String[] tags = {"wiki", "table", "tr", "td"}; try { tables = new Parse(input, tags); // look for wiki tag enclosing tables fixture.doTables(tables.parts); // only do tables within that tag } catch (Exception e) { exception(e); } tables.print(output); } }
@Override public void process() { String[] tags = {"wiki", "table", "tr", "td"}; try { tables = new Parse(input, tags); // look for wiki tag enclosing tables fixture.doTables(tables.parts); // only do tables within that tag } catch (Exception e) { exception(e); } tables.print(output); } }
public void process() { try { tables = new Parse(input); fixture.doTables(tables); } catch (Exception e) { exception(e); } tables.print(output); }
public void process() { try { tables = new Parse(input); fixture.doTables(tables); } catch (Exception e) { exception(e); } tables.print(output); }
private boolean run(Reader reader, Writer writer) throws IOException, ParseException { String input = read(reader); Parse tables = new Parse(input); fixture = new Fixture(); fixture.doTables(tables); PrintWriter output = new PrintWriter(writer); tables.print(output); output.flush(); return passed(fixture); }
protected void exception(Exception e) { print("Exception occurred!" + "\n"); print("\t" + e.getMessage() + "\n"); Parse tables = new Parse("span", "Exception occurred: ", null, null); fixture.exception(tables, e); counts.exceptions += 1; fixture.listener.tableFinished(tables); fixture.listener.tablesFinished(counts); //TODO shouldn't this be fixture.counts }
protected void exception(Exception e) { print("Exception occurred!" + "\n"); print("\t" + e.getMessage() + "\n"); Parse tables = new Parse("span", "Exception occurred: ", null, null); fixture.exception(tables, e); counts.exceptions += 1; fixture.listener.tableFinished(tables); fixture.listener.tablesFinished(counts); //TODO shouldn't this be fixture.counts }
private void copyAndAppend(Parse lastRow, int numberOfTimes) { for (int i = 0; i < numberOfTimes; i++) { Parse columns = lastRow.parts; Parse nextColumn = columns.more; Parse newNextColumn = newParse(nextColumn, nextColumn.more); Parse newColumn = newParse(columns, newNextColumn); Parse newRow = new Parse(stripAngularBrackets(lastRow.tag), lastRow.body, newColumn, null); lastRow.last().more = newRow; } }
private void copyAndAppend(Parse lastRow, int numberOfTimes) { for (int i = 0; i < numberOfTimes; i++) { Parse columns = lastRow.parts; Parse nextColumn = columns.more; Parse newNextColumn = newParse(nextColumn, nextColumn.more); Parse newColumn = newParse(columns, newNextColumn); Parse newRow = new Parse(stripAngularBrackets(lastRow.tag), lastRow.body, newColumn, null); lastRow.last().more = newRow; } }