Examples of recordValidationViolation()


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

     */
    @Test
    public void testValidateMatchingFieldFailWithRightNull() {
        TestObject testObject = new TestObject("a", null);
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "a", "TestObject.a.matchingField", "a");
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
View Full Code Here

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

     */
    @Test
    public void testValidateMatchingFieldFailWithLeftNull() {
        TestObject testObject = new TestObject(null, "b");
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "a", "TestObject.a.matchingField", null);
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
View Full Code Here

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

    @Test
    public void testCompositeDateValidationFail() {
        ThreePartDateDMY testObject = new ThreePartDateDMY("4", "13", "2008");
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "month", "ThreePartDateDMY.month.invalidDatePart", "13");
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
View Full Code Here

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

     */
    @Test
    public void testRequiredStringFailOnEmptyString() {
        TestObject testObject = new TestObject(new Integer(1), "");
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "string", "TestObject.string.required", "");
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
View Full Code Here

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

     */
    @Test
    public void testRequiredStringFailOnNullString() {
        TestObject testObject = new TestObject(new Integer(1), null);
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "string", "TestObject.string.required", null);
        replay(result);
        AnnotatedObjectValidator.validate(testObject, result);
        verify(result);
    }
View Full Code Here

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

     */
    @Test
    public void testRequiredObjectFail() {
        TestObject testObject = new TestObject(null, "String");
        ValidationResult result = createMock(ValidationResult.class);
        result.recordValidationViolation(
                "integer", "TestObject.integer.required", null);
        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.