Package javax.validation.constraints

Examples of javax.validation.constraints.DecimalMax


  public void testIsValidDecimalMax() {

    AnnotationDescriptor<DecimalMax> descriptor = new AnnotationDescriptor<DecimalMax>( DecimalMax.class );
    descriptor.setValue( "value", "15.0E0" );
    descriptor.setValue( "message", "{validator.max}" );
    DecimalMax m = AnnotationFactory.create( descriptor );

    DecimalMaxValidatorForCharSequence constraint = new DecimalMaxValidatorForCharSequence();
    constraint.initialize( m );
    testMaxValidator( constraint, true );
  }
View Full Code Here


  public void testInitializeDecimalMaxWithInvalidValue() {

    AnnotationDescriptor<DecimalMax> descriptor = new AnnotationDescriptor<DecimalMax>( DecimalMax.class );
    descriptor.setValue( "value", "foobar" );
    descriptor.setValue( "message", "{validator.max}" );
    DecimalMax m = AnnotationFactory.create( descriptor );

    DecimalMaxValidatorForNumber constraint = new DecimalMaxValidatorForNumber();
    try {
      constraint.initialize( m );
      fail();
View Full Code Here

    boolean inclusive = false;
    AnnotationDescriptor<DecimalMax> descriptor = new AnnotationDescriptor<DecimalMax>( DecimalMax.class );
    descriptor.setValue( "value", "15.0E0" );
    descriptor.setValue( "inclusive", inclusive );
    descriptor.setValue( "message", "{validator.max}" );
    DecimalMax m = AnnotationFactory.create( descriptor );

    DecimalMaxValidatorForCharSequence constraint = new DecimalMaxValidatorForCharSequence();
    constraint.initialize( m );
    testMaxValidator( constraint, inclusive );
  }
View Full Code Here

  @Test
  public void testIsValidDecimalMax() {
    AnnotationDescriptor<DecimalMax> descriptor = new AnnotationDescriptor<DecimalMax>( DecimalMax.class );
    descriptor.setValue( "value", "15.0E0" );
    descriptor.setValue( "message", "{validator.max}" );
    DecimalMax m = AnnotationFactory.create( descriptor );

    DecimalMaxValidatorForNumber constraint = new DecimalMaxValidatorForNumber();
    constraint.initialize( m );
    testMaxValidator( constraint, true );
  }
View Full Code Here

  @Test
  public void testInitializeDecimalMaxWithInvalidValue() {
    AnnotationDescriptor<DecimalMax> descriptor = new AnnotationDescriptor<DecimalMax>( DecimalMax.class );
    descriptor.setValue( "value", "foobar" );
    descriptor.setValue( "message", "{validator.max}" );
    DecimalMax m = AnnotationFactory.create( descriptor );

    DecimalMaxValidatorForNumber constraint = new DecimalMaxValidatorForNumber();
    try {
      constraint.initialize( m );
      fail();
View Full Code Here

    boolean inclusive = false;
    AnnotationDescriptor<DecimalMax> descriptor = new AnnotationDescriptor<DecimalMax>( DecimalMax.class );
    descriptor.setValue( "value", "15.0E0" );
    descriptor.setValue( "inclusive", inclusive );
    descriptor.setValue( "message", "{validator.max}" );
    DecimalMax m = AnnotationFactory.create( descriptor );

    DecimalMaxValidatorForNumber constraint = new DecimalMaxValidatorForNumber();
    constraint.initialize( m );
    testMaxValidator( constraint, inclusive );
  }
View Full Code Here

TOP

Related Classes of javax.validation.constraints.DecimalMax

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.