Examples of recordValidationViolation()


Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

  @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

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

  @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

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

  @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

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

  @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

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

    @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

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

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

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

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

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

    @Test
    public void testDateCompareWithCompositeFailOnInvalidDatePart() {
        TestObjectWithComposite testObject =
            new TestObjectWithComposite("04/07/2008", "32", "07", "2008");
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation("day",
                "TestObjectWithComposite.day.invalidDatePart", "32");
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
View Full Code Here

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

        calendar.add(Calendar.DAY_OF_MONTH, 1);
        calendar.add(Calendar.YEAR, 1);
        TestObjectWithCurrentDate testObject =
            new TestObjectWithCurrentDate(calendar.getTime());
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "firstDate",
                "TestObjectWithCurrentDate.firstDate.dateCompare",
                calendar.getTime());
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
View Full Code Here

Examples of net.sourceforge.annovalidator.validation.ValidationResult.recordValidationViolation()

     */
    @Test
    public void testValidateMatchingFieldFail() {
        TestObject testObject = new TestObject("a", "b");
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "a", "TestObject.a.matchingField", "a");
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
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.