Package net.sourceforge.annovalidator.validation

Examples of net.sourceforge.annovalidator.validation.ValidationResult


   */
  @Test
  public void testTextPassesWithMaxLength() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.maxLengthString = "abcdefghij";
    ValidationResult result = createMock(ValidationResult.class);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
    verify(result);
  }
View Full Code Here


   */
  @Test
  public void testTextFailsWithMaxLength() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.maxLengthString = "abcdefghijk";
    ValidationResult result = createMock(ValidationResult.class);
    result.recordValidationViolation(
        "maxLengthString",
        "TextLengthTestObject.maxLengthString.textSize",
        testObject.maxLengthString);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
View Full Code Here

   */
  @Test
  public void testTextPassesWithMinLength() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.minLengthString = "abcdefghijk";
    ValidationResult result = createMock(ValidationResult.class);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
    verify(result);
  }
View Full Code Here

   */
  @Test
  public void testTextFailsWithMinLength() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.minLengthString = "abcdefghi";
    ValidationResult result = createMock(ValidationResult.class);
    result.recordValidationViolation(
        "minLengthString",
        "TextLengthTestObject.minLengthString.textSize",
        testObject.minLengthString);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
View Full Code Here

   */
  @Test
  public void testTextPassesWithMinAndMaxLengthUndersize() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.minAndMaxLengthString = "abcdef";
    ValidationResult result = createMock(ValidationResult.class);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
    verify(result);
  }
View Full Code Here

   */
  @Test
  public void testTextPassesWithMinAndMaxLengthWithExactLength() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.minAndMaxLengthString = "abcdefghij";
    ValidationResult result = createMock(ValidationResult.class);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
    verify(result);
  }
View Full Code Here

   */
  @Test
  public void testTextLengthFailsWithMinAndMaxLengthUnderLength() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.minAndMaxLengthString = "abcd";
    ValidationResult result = createMock(ValidationResult.class);
    result.recordValidationViolation(
        "minAndMaxLengthString",
        "TextLengthTestObject.minAndMaxLengthString.textSize",
        testObject.minAndMaxLengthString);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
View Full Code Here

   */
  @Test
  public void testTextLengthFailsWithMinAndMaxLengthOverLength() {
    TextLengthTestObject testObject = new TextLengthTestObject();
    testObject.minAndMaxLengthString = "abcdefghijklm";
    ValidationResult result = createMock(ValidationResult.class);
    result.recordValidationViolation(
        "minAndMaxLengthString",
        "TextLengthTestObject.minAndMaxLengthString.textSize",
        testObject.minAndMaxLengthString);
    replay(result);
    AnnotatedObjectValidator.validate(testObject, result);
View Full Code Here

   
    @Test
    public void testDateCompareTwoFieldsPass() {
        TestObjectTwoTextFields testObject =
            new TestObjectTwoTextFields("04/07/2008", "07/07/2008");
        ValidationResult result = createMock(ValidationResult.class);
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
View Full Code Here

   
    @Test
    public void testDateCompareTwoFieldsFail() {
        TestObjectTwoTextFields testObject =
            new TestObjectTwoTextFields("08/07/2008", "07/07/2008");
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "firstDate",
                "TestObjectTwoTextFields.firstDate.dateCompare", "08/07/2008");
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
View Full Code Here

TOP

Related Classes of net.sourceforge.annovalidator.validation.ValidationResult

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.