Examples of FieldNotFoundException


Examples of org.powermock.reflect.exceptions.FieldNotFoundException

    return expectedFieldType.equals(field.getType());
  }

  @Override
  public void notFound(Class<?> type) throws FieldNotFoundException {
    throw new FieldNotFoundException("No field of type \"" + expectedFieldType.getName() + "\" could be found in the class hierarchy of "
        + type.getName() + ".");
  }
View Full Code Here

Examples of org.powermock.reflect.exceptions.FieldNotFoundException

    try {
      field = where.getDeclaredField(fieldName);
      field.setAccessible(true);
      return (T) field.get(object);
    } catch (NoSuchFieldException e) {
      throw new FieldNotFoundException("Field '" + fieldName + "' was not found in class " + where.getName()
          + ".");
    } catch (Exception e) {
      throw new RuntimeException("Internal error: Failed to get field in method getInternalState.", e);
    }
  }
View Full Code Here

Examples of org.powermock.reflect.exceptions.FieldNotFoundException

    }
  }

  public static void throwExceptionIfFieldWasNotFound(Class<?> type, String fieldName, Field field) {
    if (field == null) {
      throw new FieldNotFoundException("No field was found with name '" + fieldName + "' in class "
          + getUnmockedType(type).getName());
    }
  }
View Full Code Here

Examples of org.powermock.reflect.exceptions.FieldNotFoundException

      }
    }

    final Field[] fieldArray = fields.toArray(new Field[fields.size()]);
    if (fieldArray.length == 0) {
      throw new FieldNotFoundException(String.format(
          "No fields matching the name(s) %s were found in the class hierarchy of %s.",
          concatenateStrings(fieldNames), getType(clazz)));
    }
    return fieldArray;
  }
View Full Code Here

Examples of org.powermock.reflect.exceptions.FieldNotFoundException

    Field field = null;
    try {
      field = where.getDeclaredField(fieldName);
      field.setAccessible(true);
    } catch (NoSuchFieldException e) {
      throw new FieldNotFoundException("Field '" + fieldName + "' was not found in class " + where.getName()
          + ".");
    }
    return field;
  }
View Full Code Here

Examples of org.powermock.reflect.exceptions.FieldNotFoundException

        field = currentField;
        break;
      }
    }
    if (field == null) {
      throw new FieldNotFoundException("Cannot find a field of type " + fieldType + "in where.");
    }
    return field;
  }
View Full Code Here

Examples of rocket.generator.rebind.field.FieldNotFoundException

  }

  public Field getField(final String name) {
    final Field method = this.findField(name);
    if (null == method) {
      throw new FieldNotFoundException("Unable to find a field called \"" + name + "\" within " + this.getName());
    }
    return method;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.