Package org.hibernate.validator.testutil

Examples of org.hibernate.validator.testutil.MyCustomStringImpl


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

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


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

    assertTrue( validator.isValid( new MyCustomStringImpl( "4 007630 00011 6" ), null ) );
    assertTrue( validator.isValid( new MyCustomStringImpl( "1 234567 89012 8" ), null ) );
  }
View Full Code Here

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

    assertTrue( validator.isValid( new MyCustomStringImpl( "0 40 07630 00011 6" ), null ) );
    assertTrue( validator.isValid( new MyCustomStringImpl( "3 07 12345 00001 0" ), null ) );
  }
View Full Code Here

  @TestForIssue(jiraKey = "HV-813")
  public void testValidEAN_14WithEAN_128() throws Exception {
    Mod10CheckValidator validator = new Mod10CheckValidator();
    Mod10Check modCheck = createMod10CheckAnnotation( 5, 22, -1, true );
    validator.initialize( modCheck );
    assertTrue( validator.isValid( new MyCustomStringImpl( "(01) 1 23 45678 90123 1" ), null ) );
  }
View Full Code Here

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

    assertTrue( validator.isValid( new MyCustomStringImpl( "978-85-61411-03-9" ), null ) );
    assertTrue( validator.isValid( new MyCustomStringImpl( "978-1-4302-1957-6" ), null ) );
  }
View Full Code Here

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

    assertTrue( validator.isValid( new MyCustomStringImpl( "56.310 243.031 3" ), 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.