public void doCells(Parse cells) { for (int i = 0; cells != null; i++) { try { doCell(cells, i); } catch (Exception e) { exception(cells, e); } cells = cells.more; } }
public void doCells(Parse cells) { for (int i = 0; cells != null; i++) { try { doCell(cells, i); } catch (Exception e) { exception(cells, e); } cells = cells.more; } }
protected void exception(Exception e) { tables = new Parse("body", "Unable to parse input. Input ignored.", null, null); fixture.exception(tables, e); }
protected void exception(Exception e) { tables = new Parse("body", "Unable to parse input. Input ignored.", null, null); fixture.exception(tables, e); }
protected void exception(Exception e) { tables = new Parse("body", "Unable to parse input. Input ignored.", null, null); fixture.exception(tables, e); }
public void doCells(Parse cells) { for (int i = 0; cells != null; i++) { try { doCell(cells, i); } catch (Exception e) { exception(cells, e); } cells = cells.more; } }
private void handleException(Fixture fixture, Parse cell, Exception e) { if (cell.text().isEmpty()) { cell.addToBody(gray("error")); } else { fixture.exception(cell, e); } }
public void doTables(Parse tables) { summary.put("run date", new Date()); summary.put("run elapsed time", new RunTime()); if (tables != null) { Parse fixtureName = fixtureName(tables); if (fixtureName != null) { try { Fixture fixture = getLinkedFixtureWithArgs(tables); fixture.interpretTables(tables); } catch (Exception e) { exception(fixtureName, e); interpretFollowingTables(tables); } } } }
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 handleErrorInCell(TypeAdapter a, Parse cell) { try { Object result = a.invoke(); wrong(cell, a.toString(result)); } catch (IllegalAccessException e) { exception(cell, e); } catch (Exception e) { right(cell); } }
private void handleErrorInCell(TypeAdapter a, Parse cell) { try { Object result = a.invoke(); wrong(cell, a.toString(result)); } catch (IllegalAccessException e) { exception(cell, e); } catch (Exception e) { right(cell); } }
protected void interpretTables(Parse tables) { try { // Don't create the first fixture again, because creation may do something important. getArgsForTable(tables); // get them again for the new fixture object doTable(tables); } catch (Exception ex) { exception(fixtureName(tables), ex); return; } interpretFollowingTables(tables); }
private void compareCellToResult(TypeAdapter a, Parse theCell) { typeAdapter = a; cell = theCell; try { result = typeAdapter.get(); expected = parseCell(); if (expected instanceof Unparseable) tryRelationalMatch(); else compare(); } catch (Exception e) { exception(cell, e); } }
private void compareCellToResult(TypeAdapter a, Parse theCell) { typeAdapter = a; cell = theCell; try { result = typeAdapter.get(); expected = parseCell(); if (expected instanceof Unparseable) tryRelationalMatch(); else compare(); } catch (Exception e) { exception(cell, e); } }
protected void interpretTables(Parse tables) { try { // Don't create the first fixture again, because creation may do something important. getArgsForTable(tables); // get them again for the new fixture object doTable(tables); } catch (Exception ex) { exception(tables.at(0, 0, 0), ex); listener.tableFinished(tables); return; } interpretFollowingTables(tables); }
protected void interpretTables(Parse tables) { try { // Don't create the first fixture again, because creation may do something important. getArgsForTable(tables); // get them again for the new fixture object doTable(tables); } catch (Exception ex) { exception(tables.at(0, 0, 0), ex); listener.tableFinished(tables); return; } interpretFollowingTables(tables); }
@Override public void doCell(Fixture fixture, Parse cell) { try { //TODO-MdM hmm... somehow this needs to regulated by the fixture. if (fixture instanceof ColumnFixture) ((ColumnFixture) fixture).executeIfNeeded(); Object valueObj = adapter.get(); //...might be validly null String symbolValue = valueObj == null ? "null" : valueObj.toString(); String symbolName = cell.text(); Fixture.setSymbol(symbolName, symbolValue); cell.addToBody(Fixture.gray(" = " + symbolValue)); } catch (Exception e) { fixture.exception(cell, e); } } }
private void interpretFollowingTables(Parse tables) { listener.tableFinished(tables); tables = tables.more; while (tables != null) { Parse heading = tables.at(0, 0, 0); if (forcedAbort) ignore(heading); //Semaphores: ignore on failed lock else if (heading != null) { try { Fixture fixture = getLinkedFixtureWithArgs(tables); fixture.doTable(tables); } catch (Throwable e) { // NOSONAR exception(heading, e); } } listener.tableFinished(tables); tables = tables.more; } }
@Override public void doCell(Fixture fixture, Parse cell) throws Exception { String symbolName = cell.text(); if (!Fixture.hasSymbol(symbolName)) fixture.exception(cell, new FitFailureException("No such symbol: " + symbolName)); else { String value = (String) Fixture.getSymbol(symbolName); if (adapter.field != null) { adapter.set(adapter.parse(value)); cell.addToBody(Fixture.gray(" = " + value)); } if (adapter.method != null) { cell.body = value; fixture.check(cell, adapter); } } } }