Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.ValidationConstraintGenerator


    @Test
    public void invokes_all_constraint_generators() throws Exception
    {
        getMocksControl().checkOrder(true);

        ValidationConstraintGenerator gen = mockValidationConstraintGenerator();
        FieldValidator fv1 = mockFieldValidator();
        FieldValidator fv2 = mockFieldValidator();
        FieldValidatorSource source = mockFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = mockAnnotationProvider();
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void validator_with_constraint() throws Exception
    {
        ValidationConstraintGenerator gen = mockValidationConstraintGenerator();
        FieldValidator fv = mockFieldValidator();
        FieldValidatorSource source = mockFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = mockAnnotationProvider();
        String overrideId = "overrideId";
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void no_validators_at_all() throws Exception
    {
        ValidationConstraintGenerator gen = mockValidationConstraintGenerator();
        FieldValidatorSource source = mockFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = mockAnnotationProvider();
        String overrideId = "overrideId";
        Messages overrideMessages = mockMessages();
View Full Code Here

        train_getAnnotation(conduit, Validate.class, null);

        replay();

        ValidationConstraintGenerator gen = new ValidateAnnotationConstraintGenerator();

        assertNull(gen.buildConstraints(Object.class, conduit));

        verify();
    }
View Full Code Here

        train_getAnnotation(conduit, Validate.class, validate);

        replay();

        ValidationConstraintGenerator gen = new ValidateAnnotationConstraintGenerator();

        assertEquals(gen.buildConstraints(Object.class, conduit), Arrays.asList("required"));

        verify();
    }
View Full Code Here

        train_getAnnotation(conduit, Validate.class, validate);

        replay();

        ValidationConstraintGenerator gen = new ValidateAnnotationConstraintGenerator();

        assertEquals(gen.buildConstraints(null, conduit), Arrays.asList("required", "minlength=3"));

        verify();
    }
View Full Code Here

    @Test
    public void invokes_all_constraint_generators() throws Exception
    {
        getMocksControl().checkOrder(true);

        ValidationConstraintGenerator gen = mockValidationConstraintGenerator();
        FieldValidator fv1 = mockFieldValidator();
        FieldValidator fv2 = mockFieldValidator();
        FieldValidatorSource source = mockFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = mockAnnotationProvider();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void validator_with_constraint() throws Exception
    {
        ValidationConstraintGenerator gen = mockValidationConstraintGenerator();
        FieldValidator fv = mockFieldValidator();
        FieldValidatorSource source = mockFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = mockAnnotationProvider();
        String overrideId = "overrideId";
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void no_validators_at_all() throws Exception
    {
        ValidationConstraintGenerator gen = mockValidationConstraintGenerator();
        FieldValidatorSource source = mockFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = mockAnnotationProvider();
        String overrideId = "overrideId";
        Messages overrideMessages = mockMessages();
View Full Code Here

        train_getAnnotation(conduit, Validate.class, null);

        replay();

        ValidationConstraintGenerator gen = new ValidateAnnotationConstraintGenerator();

        assertNull(gen.buildConstraints(Object.class, conduit));

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.ValidationConstraintGenerator

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.