Package fit.exception

Examples of fit.exception.FitFailureException


      }
      //System.out.println("Map is: " + commandMap);
    }
    catch (InvalidParamSequence ips)
    {
      throw new FitFailureException(ips.toString());
    }
  }
View Full Code Here


      DBCollection collection = mongo.getDB("local").getCollection("oplog.rs");
      cursor = collection.find().skip((int) collection.count() - howMany);
      parameters.add(keyToSave, JSON.serialize(cursor.next().get("ts"))
              .replaceAll("[\" ]", ""));
    } catch (MongoException problem) {
      throw new FitFailureException(problem.getMessage());
    } finally {
      cursor.close();
    }
    return true;
  }
View Full Code Here

      stream.addToBody("<pre/>" + out.toString() + "</pre>");
    } else if (STDERR.equalsIgnoreCase(consoleStream)) {
      stream.addToBody("<hr/>" + label("Console Error") + "<hr/>");
      stream.addToBody("<pre/>" + err.toString() + "</pre>");
    } else {
      throw new FitFailureException("Don't know how to process "
          + consoleStream
          + ", valid values are: <pre>stdout, stderr</pre>");
    }
  }
View Full Code Here

    if (STDOUT.equalsIgnoreCase(streamName)) {
      return out.toString().contains(text);
    } else if (STDERR.equalsIgnoreCase(streamName)) {
      return err.toString().contains(text);
    } else {
      throw new FitFailureException("Don't know how to process "
          + streamName
          + ", valid values are: <pre>stdout, stderr</pre>");
    }
  }
View Full Code Here

  protected Parse firstRow;

  public void doRows(Parse rows) {
    firstRow = rows;
    if (rows == null)
      throw new FitFailureException("There are no rows in this table");
    doStaticTable(rows.size());
  }
View Full Code Here

  public static class RecallBinding extends Binding {
    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));
View Full Code Here

      return new Unparseable();
    }

    private void tryRelationalMatch() {
      Class<?> adapterType = typeAdapter.type;
      FitFailureException cantParseException = new CouldNotParseFitFailureException(cell.text(), adapterType
        .getName());
      if (result != null) {
        FitMatcher matcher = new FitMatcher(cell.text(), result);
        try {
          if (matcher.matches())
View Full Code Here

  // Actions //////////////////////////////////

  public void start() throws Throwable {
    Parse fixture = cells.more;
    if (fixture == null)
      throw new FitFailureException("You must specify a fixture to start.");
    actor = loadFixture(fixture.text());
  }
View Full Code Here

  public void enter() throws Exception {
    Method method = method(1);
    Class<?> type = method.getParameterTypes()[0];
    final Parse argumentCell = cells.more.more;
    if (argumentCell == null)
      throw new FitFailureException("You must specify an argument.");
    String text = argumentCell.text();
    Object[] args;
    try {
      args = new Object[]{TypeAdapter.on(actor, type).parse(text)};
    }
View Full Code Here

    Class<?> type = theMethod.getReturnType();
    try {
      adapter = TypeAdapter.on(actor, theMethod);
    }
    catch (Throwable e) {
      throw new FitFailureException("Can not parse return type: " + type.getName());
    }
    Parse checkValueCell = cells.more.more;
    if (checkValueCell == null)
      throw new FitFailureException("You must specify a value to check.");

    check(checkValueCell, adapter);
  }
View Full Code Here

TOP

Related Classes of fit.exception.FitFailureException

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.