@Override public void doCell(Fixture aFixture, Parse aCell) throws Throwable { String text = aCell.text(); if ("null".equals(text) || "".equals(text)) { text = null; } else if ("blank".equals(text)) { text = ""; } currentRowValues.put(header, text); } }
@Override public void doCells(Parse cells) { this.cells = cells; String methodName = cells.text(); try { getClass().getMethod(methodName).invoke(this); } catch (Exception e) { exception(cells, e); } }
@Override public void doTable(Parse parse) { Parse cell = parse.parts.more.parts; String value = cell.text(); System.err.println(value); right(cell); } }
public void doCells(Parse cells) { this.cells = cells; try { Method action = getClass().getMethod(cells.text()); action.invoke(this); } catch (Exception e) { exception(cells, e); } }
@Override public void doCells(Parse cells) { this.cells = cells; String methodName = cells.text(); try { getClass().getMethod(methodName).invoke(this); } catch (Exception e) { exception(cells, e); } }
@Override public void check(Parse cell, TypeAdapter a) { expected = cell.text(); super.check(cell, a); }
public void check(Parse cell, String value) { if (cell.text().equals(value)) { right(cell); } else { wrong(cell, value); } }
@Override public void doCells(Parse cells) { this.cells = cells; try { Method action = getAction(cells.text()); action.invoke(this); } catch (Exception e) { exception(cells, e); } }
public void check(Parse cell, String value) { if (cell.text().equals(value)) { right(cell); } else { wrong(cell, value); } }
@Override public void doRow(Parse row) { String packageName = row.parts.text(); FixtureLoader.instance().addPackageToPath(packageName); } }
@Override public void doRow(Parse row) { String packageName = row.parts.text(); FixtureLoader.instance().addPackageToPath(packageName); } }
public void enter() throws Exception { Parse argumentCell = cells.more.more; if (argumentCell == null) throw new FitFailureException("You must specify an argument."); Method enterMethod = tryFindMethodWithArgs(1); Class<?> parameterType = enterMethod.getParameterTypes()[0]; String argument = argumentCell.text(); enterMethod.invoke(actor, adaptArgumentToType(parameterType, argument)); }
public void wrong(Parse cell) { cell.addToTag(" bgcolor=\"" + red + "\""); cell.body = escape(cell.text()); counts.wrong++; }
int columnNumberContainingText(String columnName, int headerRowIndex) throws InvalidInputException { int columnNumber = -1; Parse columns = table.at(0, headerRowIndex, 0); while (columns != null) { columnNumber++; if (columnName.equals(columns.text())) { return columnNumber; } columns = columns.more; } throw new InvalidInputException(errorMsg(columnName)); }
protected Fixture getLinkedFixtureWithArgs(Parse tables) throws Exception { Parse header = tables.at(0, 0, 0); Fixture fixture = loadFixture(header.text()); fixture.counts = counts; fixture.summary = summary; fixture.getArgsForTable(tables); return fixture; }
protected Fixture getLinkedFixtureWithArgs(Parse tables) throws Throwable { Parse header = tables.at(0, 0, 0); Fixture fixture = loadFixture(header.text()); fixture.counts = counts; fixture.summary = summary; fixture.getArgsForTable(tables); return fixture; }
public void start() throws Throwable { Parse fixture = cells.more; if (isNullOrBlank(fixture)) throw new FitFailureException("You must specify a fixture to start."); actor = loadFixture(fixture.text()); }
void incrementColumnValues(String columnName, Delta delta, int headerRowIndex) throws InvalidInputException { int columnNumber = columnNumberContainingText(columnName, headerRowIndex); int totalNumberOfRows = numberOfRows(); for (int i = headerRowIndex + 2; i < totalNumberOfRows; ++i) { Parse columnToBeUpdated = table.at(0, i, columnNumber); String value = columnToBeUpdated.text(); value = delta.addTo(value, i - headerRowIndex - 1); columnToBeUpdated.body = value; } }
public void error(Parse cell, String message) { cell.body = escape(cell.text()); cell.addToBody("<hr><pre>" + escape(message) + "</pre>"); cell.addToTag(" bgcolor=\"" + yellow + "\""); counts.exceptions++; }