Package org.hibernate.validator.internal.constraintvalidators.bv

Examples of org.hibernate.validator.internal.constraintvalidators.bv.DecimalMinValidatorForNumber.initialize()


    descriptor.setValue( "message", "{validator.min}" );
    DecimalMin m = AnnotationFactory.create( descriptor );

    DecimalMinValidatorForNumber constraint = new DecimalMinValidatorForNumber();
    try {
      constraint.initialize( m );
      fail();
    }
    catch ( IllegalArgumentException e ) {
      // success
    }
View Full Code Here


    descriptor.setValue( "value", "1500E-2" );
    descriptor.setValue( "message", "{validator.min}" );
    DecimalMin m = AnnotationFactory.create( descriptor );

    DecimalMinValidatorForNumber constraint = new DecimalMinValidatorForNumber();
    constraint.initialize( m );
    testMinValidator( constraint, true );
  }

  @Test
  public void testInitializeDecimalMaxWithInvalidValue() {
View Full Code Here

    descriptor.setValue( "message", "{validator.min}" );
    DecimalMin m = AnnotationFactory.create( descriptor );

    DecimalMinValidatorForNumber constraint = new DecimalMinValidatorForNumber();
    try {
      constraint.initialize( m );
      fail();
    }
    catch ( IllegalArgumentException e ) {
      // success
    }
View Full Code Here

    descriptor.setValue( "inclusive", inclusive );
    descriptor.setValue( "message", "{validator.min}" );
    DecimalMin m = AnnotationFactory.create( descriptor );

    DecimalMinValidatorForNumber constraint = new DecimalMinValidatorForNumber();
    constraint.initialize( m );
    testMinValidator( constraint, inclusive );
  }

  private void testMinValidator(ConstraintValidator<?, Number> constraint, boolean inclusive) {
    byte b = 1;
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.