Package org.hibernate.validator.testutil

Examples of org.hibernate.validator.testutil.MyCustomStringImpl


    assertTrue( constraint.isValid( "14.99", null ) );
    assertTrue( constraint.isValid( "-14.99", null ) );
    assertFalse( constraint.isValid( "20", null ) );

    // HV-502
    assertTrue( constraint.isValid( new MyCustomStringImpl( "10" ), null ) );

    //number format exception
    assertFalse( constraint.isValid( "15l", null ) );
  }
View Full Code Here


  }

  @Test
  @TestForIssue(jiraKey = "HV-502")
  public void testIsValidCharSequence() {
    assertTrue( constraint.isValid( new MyCustomStringImpl( "500.2" ), null ) );
  }
View Full Code Here

  public void testFailOnNonNumeric() throws Exception {
    LuhnCheckValidator validator = new LuhnCheckValidator();
    LuhnCheck modCheck = createLuhnCheckAnnotation( 0, Integer.MAX_VALUE, -1, false );
    validator.initialize( modCheck );

    assertFalse( validator.isValid( new MyCustomStringImpl( "A79927398713" ), null ) );
  }
View Full Code Here

  public void testIgnoreNonNumeric() throws Exception {
    LuhnCheckValidator validator = new LuhnCheckValidator();
    LuhnCheck modCheck = createLuhnCheckAnnotation( 0, Integer.MAX_VALUE, -1, true );
    validator.initialize( modCheck );

    assertTrue( validator.isValid( new MyCustomStringImpl( "A79927398713" ), null ) );
  }
View Full Code Here

  public void testInvalidMod10() throws Exception {
    LuhnCheckValidator validator = new LuhnCheckValidator();
    LuhnCheck modCheck = createLuhnCheckAnnotation( 0, Integer.MAX_VALUE, -1, false );
    validator.initialize( modCheck );

    assertFalse( validator.isValid( new MyCustomStringImpl( "79927398714" ), null ) );
  }
View Full Code Here

    assertFalse( constraint.isValid( "10", null ) );
    assertFalse( constraint.isValid( "14.99", null ) );
    assertFalse( constraint.isValid( "-14.99", null ) );

    // HV-502
    assertTrue( constraint.isValid( new MyCustomStringImpl( "20" ), null ) );

    //number format exception
    assertFalse( constraint.isValid( "15l", null ) );
  }
View Full Code Here

        '0',
        ProcessingDirection.RIGHT_TO_LEFT
    );
    validator.initialize( modCheck );

    assertFalse( validator.isValid( new MyCustomStringImpl( "Z54679542616" ), null ) );
  }
View Full Code Here

        '0',
        ProcessingDirection.RIGHT_TO_LEFT
    );
    validator.initialize( modCheck );

    assertTrue( validator.isValid( new MyCustomStringImpl( "Z54679542616" ), null ) );
  }
View Full Code Here

  public void testFailOnNonNumeric() throws Exception {
    Mod10CheckValidator validator = new Mod10CheckValidator();
    Mod10Check modCheck = createMod10CheckAnnotation( 0, Integer.MAX_VALUE, -1, false );
    validator.initialize( modCheck );

    assertFalse( validator.isValid( new MyCustomStringImpl( "A79927398712" ), null ) );
  }
View Full Code Here

  public void testIgnoreNonNumeric() throws Exception {
    Mod10CheckValidator validator = new Mod10CheckValidator();
    Mod10Check modCheck = createMod10CheckAnnotation( 0, Integer.MAX_VALUE, -1, true );
    validator.initialize( modCheck );

    assertTrue( validator.isValid( new MyCustomStringImpl( "A79927398712" ), null ) );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.testutil.MyCustomStringImpl

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.