Package com.jayway.awaitility.reflect.exception

Examples of com.jayway.awaitility.reflect.exception.FieldNotFoundException


        private Field foundField;

        public NameFieldSupplier() {
            foundField = WhiteboxImpl.getFieldAnnotatedWith(object, expectedAnnotation);
            if (!foundField.getType().isAssignableFrom(expectedFieldType)) {
                throw new FieldNotFoundException(String.format(
                        "Couldn't find a field of type %s annotated with %s in %s.", expectedFieldType.getClass()
                                .getName(), expectedAnnotation.getClass().getName(), WhiteboxImpl.getType(object)
                                .getName()
                ));
            }
View Full Code Here


         */
        public Callable<T> andAnnotatedWith(final Class<? extends Annotation> annotationType) {
            assertNotNullParameter(annotationType, "annotationType");
            Field field = WhiteboxImpl.getFieldAnnotatedWith(object, annotationType);
            if (!field.getName().equals(expectedFieldName)) {
                throw new FieldNotFoundException(String.format(
                        "Couldn't find a field with name %s annotated with %s in %s.", expectedFieldName,
                        annotationType.getClass().getName(), WhiteboxImpl.getType(object).getName()));
            }
            expectedAnnotation = annotationType;
            return this;
View Full Code Here

     * @param fieldName the field name
     * @param field     the field
     */
    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 "
                    + type.getName() + ".");
        }
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public void notFound(Class<?> type, boolean isInstanceField) throws FieldNotFoundException {
        throw new FieldNotFoundException(String.format(
                "No %s field named \"%s\" could be found in the class hierarchy of %s.", isInstanceField ? "instance"
                        : "static", fieldName, type.getName()));
    }
View Full Code Here

    }

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

    }

    /** {@inheritDoc} */
    @Override
    public void notFound(Class<?> type, boolean isInstanceField) throws FieldNotFoundException {
        throw new FieldNotFoundException(String.format(
                "No %s field with name \"%s\" and type \"%s\" could be found in the class hierarchy of %s.",
                isInstanceField ? "instance" : "static", fieldName, fieldType.getName(), type.getName()));
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public void notFound(Class<?> type, boolean isInstanceField) throws FieldNotFoundException {
        throw new FieldNotFoundException(String.format(
                "No %s field of type \"%s\" could be found in the class hierarchy of %s.", isInstanceField ? "instance"
                        : "static", expectedFieldType.getName(), type.getName()));
    }
View Full Code Here

TOP

Related Classes of com.jayway.awaitility.reflect.exception.FieldNotFoundException

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.