Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.ValidationConstraintGenerator


        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer five = 5;
        FormSupport fs = mockFormSupport();

        Map<String, Validator> map = singletonMap("minLength", validator);

        train_getConstraintType(validator, Integer.class);
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", "regexp=^([a-zA-Z0-9]{2,4})+$"));

        verify();
    }
View Full Code Here

        train_getAnnotation(conduit, Validate.class, validate);

        replay();

        ValidationConstraintGenerator gen = new ValidateAnnotationConstraintGenerator();

        assertEquals(gen.buildConstraints(null, conduit),
                Arrays.asList("regexp=^([a]{50,125}[0-9]{2,4})+$","required", "567matcher", "regexp=a\\,b", "regexp=a{1,}"));

        verify();
    }
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

    @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

        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

TOP

Related Classes of org.apache.tapestry5.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.