Package org.springframework.validation.beanvalidation

Examples of org.springframework.validation.beanvalidation.SpringValidatorAdapter


  private BindException validate(SignupForm form) {
    BindException errors;
    errors = new BindException(form, "signupForm");
    LazyValidatorFactory lvf = new LazyValidatorFactory();
    Validator validator = new SpringValidatorAdapter(lvf.getValidator());
    ValidationUtils.invokeValidator(validator, form, errors);
    return errors;
  }
View Full Code Here


    createFoo("hi: hello\nname: foo\nbar: blah");
  }

  @Test(expected = BindException.class)
  public void testMissingPropertyCausesValidationError() throws Exception {
    this.validator = new SpringValidatorAdapter(Validation
        .buildDefaultValidatorFactory().getValidator());
    createFoo("bar: blah");
  }
View Full Code Here

    createFoo("bar: blah");
  }

  @Test
  public void testValidationErrorCanBeSuppressed() throws Exception {
    this.validator = new SpringValidatorAdapter(Validation
        .buildDefaultValidatorFactory().getValidator());
    setupFactory();
    this.factory.setExceptionIfInvalid(false);
    bindFoo("bar: blah");
  }
View Full Code Here

    createFoo("hi: hello\nname: foo\nbar: blah");
  }

  @Test(expected = BindException.class)
  public void missingPropertyCausesValidationError() throws Exception {
    this.validator = new SpringValidatorAdapter(Validation
        .buildDefaultValidatorFactory().getValidator());
    createFoo("bar: blah");
  }
View Full Code Here

TOP

Related Classes of org.springframework.validation.beanvalidation.SpringValidatorAdapter

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.