Examples of IntrospectionError


Examples of org.assertj.core.util.introspection.IntrospectionError

    try {
      return clazz.cast(javaBeanDescriptor.invokeReadMethod(descriptor, target));
    } catch (ClassCastException e) {
      String msg = format("Unable to obtain the value of the property <'%s'> from <%s> - wrong property type specified <%s>",
                          propertyName, target, clazz);
      throw new IntrospectionError(msg, e);
    } catch (Throwable unexpected) {
      String msg = format("Unable to obtain the value of the property <'%s'> from <%s>", propertyName, target);
      throw new IntrospectionError(msg, unexpected);
    }
  }
View Full Code Here

Examples of org.assertj.core.util.introspection.IntrospectionError

      } catch (IntrospectionError propertyIntrospectionError) {
        // no field nor property found with given name, it is considered as an error
        String message = format(
            "\nCan't find any field or property with name '%s'.\nError when introspecting fields was :\n- %s \nError when introspecting properties was :\n- %s",
            propertyOrFieldName, fieldIntrospectionError.getMessage(), propertyIntrospectionError.getMessage());
        throw new IntrospectionError(message);
      }
    }
  }
View Full Code Here

Examples of org.assertj.core.util.introspection.IntrospectionError

    return propertySupport.propertyValueOf(fieldName, Object.class, a);
    } catch (IntrospectionError e2) {
    // this time, we really fail
    String msg = format("Unable to obtain the value of <'%s'> field/property from <%s>, expecting a public field or getter",
                        fieldName, a);
    throw new IntrospectionError(msg);
    }
  }
  }
View Full Code Here

Examples of org.assertj.core.util.introspection.IntrospectionError

      } catch (IntrospectionError propertyIntrospectionError) {
        // no field nor property found with given name, it is considered as an error
        String message = format(
            "\nCan't find any field or property with name '%s'.\nError when introspecting fields was :\n- %s \nError when introspecting properties was :\n- %s",
            propertyOrFieldName, fieldIntrospectionError.getMessage(), propertyIntrospectionError.getMessage());
        throw new IntrospectionError(message);
      }
    }
  }
View Full Code Here

Examples of org.assertj.core.util.introspection.IntrospectionError

    try {
      return clazz.cast(javaBeanDescriptor.invokeReadMethod(descriptor, target));
    } catch (ClassCastException e) {
      String msg = format("Unable to obtain the value of the property <'%s'> from <%s> - wrong property type specified <%s>",
          propertyName, target, clazz);
      throw new IntrospectionError(msg, e);
    } catch (Throwable unexpected) {
      String msg = format("Unable to obtain the value of the property <'%s'> from <%s>", propertyName, target);
      throw new IntrospectionError(msg, unexpected);
    }
  }
View Full Code Here

Examples of org.assertj.core.util.introspection.IntrospectionError

  private Field findField(String fieldName, Set<Field> fields, Class<?> clazz) {
    if (fieldName == null) return null;
    for (Field field : fields) {
      if (fieldName.equals(field.getName())) return field;
    }
    throw new IntrospectionError(format("No field '%s' in %s", fieldName, clazz));
  }
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.