@Override
 public void processFinished(Parse row, boolean anyErrors) {
   if (!anyErrors) {
     mFixture.right(row);
   } else {
     mFixture.wrong(row);
   }
 }
Пример #2
0
 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);
   }
 }
Пример #3
0
  public void doCell(Fixture fixture, Parse cell) {
    ContentOfTableCell content = new ContentOfTableCell(cell.text());
    try {
      if (content.isSymbolSetter()) {
        Object actual = this.adapter.get();
        dbfit.util.SymbolUtil.setSymbol(content.text(), actual);
        cell.addToBody(Fixture.gray("= " + String.valueOf(actual)));
        // fixture.ignore(cell);
      } else if (content.isSymbolGetter()) {
        Object actual = this.adapter.get();
        Object expected = this.adapter.parse(content.text());
        cell.addToBody(Fixture.gray("= " + String.valueOf(expected)));

        if (adapter.equals(actual, expected)) {
          fixture.right(cell);
        } else {
          fixture.wrong(cell, String.valueOf(actual));
        }
      } else if (content.isExpectingInequality()) {
        // expect failing comparison
        Object actual = this.adapter.get();
        String expectedVal = content.getExpectedFailureValue();
        cell.addToBody(Fixture.gray("= " + String.valueOf(actual)));

        if (adapter.equals(actual, adapter.parse(expectedVal))) {
          fixture.wrong(cell);
        } else {
          fixture.right(cell);
        }
      } else {
        super.doCell(fixture, cell);
      }
    } catch (Throwable t) {
      fixture.exception(cell, t);
    }
  }