Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.FieldValidatorSource


        train_getValueType(validator, Object.class);
        validator.validate(field, null, formatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map);

        FieldValidator fieldValidator = source.createValidator(field, "required", null);

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here


        train_getValueType(validator, Object.class);
        validator.validate(field, 5, formatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map);

        FieldValidator fieldValidator = source.createValidators(field, "minlength");

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        train_contains(containerMessages, "fred-minlength", false);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map);

        try
        {
            source.createValidators(field, "minlength");
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

        train_getValueType(validator, Object.class);
        validator.validate(field, null, formatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map);

        FieldValidator fieldValidator = source.createValidators(field, "required");

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        train_getValueType(minLength, String.class);
        minLength.validate(field, fifteen, minLengthFormatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map);

        FieldValidator fieldValidator = source.createValidators(field, "required,minLength=15");

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        train_getValueType(validator, Object.class);
        validator.validate(field, five, formatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map);

        FieldValidator fieldValidator = source.createValidator(field, "minLength", "5");

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

    };

    @Test
    public void not_a_field()
    {
        FieldValidatorSource source = newFieldValidatorSource();
        ComponentResources container = newComponentResources();
        ComponentResources component = newComponentResources();
        Component instance = newComponent();
        Location l = newLocation();
View Full Code Here

    @Test
    public void success()
    {

        FieldValidatorSource source = newFieldValidatorSource();
        ComponentResources container = newComponentResources();
        ComponentResources component = newComponentResources();
        FieldComponent instance = newMock(FieldComponent.class);
        Location l = newLocation();
        FieldValidator validator = newFieldValidator();

        String expression = "required,minLength=5";

        train_getComponent(component, instance);

        expect(source.createValidators(instance, expression)).andReturn(validator);

        replay();

        BindingFactory factory = new ValidateBindingFactory(source);
View Full Code Here

        getMocksControl().checkOrder(true);

        ValidationConstraintGenerator gen = newValidationConstraintGenerator();
        FieldValidator fv1 = newFieldValidator();
        FieldValidator fv2 = newFieldValidator();
        FieldValidatorSource source = newFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = newAnnotationProvider();
        String overrideId = "overrideId";
        Messages overrideMessages = newMessages();
        Field field = newField();
View Full Code Here

    @Test
    public void validator_with_constraint() throws Exception
    {
        ValidationConstraintGenerator gen = newValidationConstraintGenerator();
        FieldValidator fv = newFieldValidator();
        FieldValidatorSource source = newFieldValidatorSource();
        Class propertyType = Integer.class;
        AnnotationProvider provider = newAnnotationProvider();
        String overrideId = "overrideId";
        Messages overrideMessages = newMessages();
        Field field = newField();
View Full Code Here

TOP

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

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.