Package fit.exception

Examples of fit.exception.FitFailureException


  // Utility //////////////////////////////////

  protected Method method(int args) throws NoSuchMethodException {
    final Parse methodCell = cells.more;
    if (methodCell == null)
      throw new FitFailureException("You must specify a method.");
    return method(camel(methodCell.text()), args);
  }
View Full Code Here


    return method(camel(methodCell.text()), args);
  }

  protected Method method(String test, int args) throws NoSuchMethodException {
    if (actor == null)
      throw new FitFailureException("You must start a fixture using the 'start' keyword.");
    Method methods[] = actor.getClass().getMethods();
    Method result = null;
    for (int i = 0; i < methods.length; i++) {
      Method m = methods[i];
      if (m.getName().equals(test) && m.getParameterTypes().length == args) {
        if (result == null) {
          result = m;
        } else {
          throw new FitFailureException("You can only have one " + test + "(arg) method in your fixture.");
        }
      }
    }
    if (result == null) {
      throw new NoSuchMethodFitFailureException(test);
View Full Code Here

  private String parsePropertyMethodName;

  public void doRows(Parse rows) {
    Parse first = rows.parts;
    if (first == null) {
      throw new FitFailureException("You must specify a method.");
    }
    findMethod(first);
    Parse rest = rows.more;
    if (rest == null || rest.parts == null) {
      throw new RuntimeException("No test case is found!");
View Full Code Here

  protected void findMethod(Parse cell) {
    String methodname = cell.text();
    methodname = StringHelper.camel(methodname);
    Parse argument = cell.more;
    if (StringHelper.isBlankOrNull(methodname)) {
      throw new FitFailureException("You must specify a method.");
    }
    try {
      if (argument == null) {
        this.accessor = MethodHelper.findMethodByArgCount(this, methodname, 1);
        this.dtoClazz = this.accessor.getMethod().getParameterTypes()[0];
View Full Code Here

   */
  Parse currentRow = null;

  public void doRows(Parse rows) {
    if (rows == null || rows.parts == null) {
      throw new FitFailureException("You must specify identified name of stored dto.");
    }
    dto = findDto(rows.parts);
    index = 0;
    Parse rest = rows.more;
    if (rest == null || rest.parts == null) {
View Full Code Here

    }

    @Override
    public void exception(CellWrapper<Parse> cell, String exceptionMessage) {
        Parse wrapped = cell.getWrapped();
        fixture.exception(wrapped, new FitFailureException(exceptionMessage));
    }
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.