Package backtype.storm

Examples of backtype.storm.ConfigValidation$FieldValidator


        train_isRequired(validator, false);

        replay();

        FieldValidator fv = new FieldValidatorImpl(field, null, formatter, validator, null);

        fv.validate(null);

        verify();
    }
View Full Code Here


        train_isRequired(validator, false);

        replay();

        FieldValidator fv = new FieldValidatorImpl(field, null, formatter, validator, null);

        fv.validate("");

        verify();
    }
View Full Code Here

        train_isRequired(validator, true);
        train_getValueType(validator, String.class);

        replay();

        FieldValidator fv = new FieldValidatorImpl(field, null, formatter, validator, null);

        fv.validate(value);

        verify();
    }
View Full Code Here

        validator.validate(field, null, formatter, null);

        replay();

        FieldValidator fv = new FieldValidatorImpl(field, null, formatter, validator, null);

        fv.validate(null);

        verify();
    }
View Full Code Here

    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();
        String overrideId = "overrideId";
        Messages overrideMessages = mockMessages();
        Field field = mockField();
        Locale locale = Locale.ENGLISH;
        String value = "*VALUE*";

        train_buildConstraints(gen, propertyType, provider, "cons1", "cons2");

        train_createValidator(
                source,
                field,
                "cons1",
                null,
                overrideId,
                overrideMessages,
                locale,
                fv1);

        train_createValidator(
                source,
                field,
                "cons2",
                null,
                overrideId,
                overrideMessages,
                locale,
                fv2);

        fv1.validate(value);
        fv2.validate(value);

        replay();

        FieldValidatorDefaultSource fieldValidatorSource = new FieldValidatorDefaultSourceImpl(gen,
                                                                                               source);

        FieldValidator composite = fieldValidatorSource.createDefaultValidator(
                field,
                overrideId,
                overrideMessages,
                locale,
                propertyType,
                provider);

        composite.validate(value);

        verify();
    }
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";
        Messages overrideMessages = mockMessages();
        Field field = mockField();
        Locale locale = Locale.ENGLISH;

        train_buildConstraints(gen, propertyType, provider, "foo=bar");

        train_createValidator(source, field, "foo", "bar", overrideId, overrideMessages, locale, fv);

        replay();

        FieldValidatorDefaultSource fieldValidatorSource = new FieldValidatorDefaultSourceImpl(gen,
                                                                                               source);

        FieldValidator composite = fieldValidatorSource.createDefaultValidator(
                field,
                overrideId,
                overrideMessages,
                locale,
                propertyType,
View Full Code Here

        replay();

        FieldValidatorDefaultSource fieldValidatorSource = new FieldValidatorDefaultSourceImpl(gen,
                                                                                               source);

        FieldValidator composite = fieldValidatorSource.createDefaultValidator(
                field,
                overrideId,
                overrideMessages,
                locale,
                propertyType,
                provider);

        composite.validate(value);

        verify();
    }
View Full Code Here

        replay();

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

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

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        replay();

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

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

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        replay();

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

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

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

TOP

Related Classes of backtype.storm.ConfigValidation$FieldValidator

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.