Package grails.validation

Examples of grails.validation.TestClass


        Constraint constraint = getConstraint("testBigDecimal", scale);
        assertEquals(new BigDecimal(result), proceedValidation(constraint, new BigDecimal(value)));
    }

    private Object proceedValidation(Constraint constraint, Object value) {
        BeanWrapper constrainedBean = new BeanWrapperImpl(new TestClass());
        constrainedBean.setPropertyValue(constraint.getPropertyName(), value);
        Errors errors = new BindException(constrainedBean.getWrappedInstance(), constrainedBean.getWrappedClass().getName());
        assertFalse(errors.hasErrors());
        constraint.validate(constrainedBean.getWrappedInstance(), value, errors);
        return constrainedBean.getPropertyValue(constraint.getPropertyName());
View Full Code Here

TOP

Related Classes of grails.validation.TestClass

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.