Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.MessageFormatter


    @Test
    public void short_value() throws Exception
    {
        String label = "My Field";
        Field field = mockFieldWithLabel(label);
        MessageFormatter formatter = mockMessageFormatter();
        String value = "Now the student has become the master.";
        String message = "{message}";
        Integer constraint = value.length() + 1;

        train_format(formatter, message, constraint, label);
View Full Code Here


{
    @Test
    public void small_enough() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Long constraint = 50L;

        replay();

        Max validator = new Max(null);
View Full Code Here

    @Test
    public void value_too_large() throws Exception
    {
        String label = "My Field";
        Field field = mockFieldWithLabel(label);
        MessageFormatter formatter = mockMessageFormatter();
        String message = "{message}";
        Long constraint = 100l;
        Number value = 101;

        train_format(formatter, message, constraint, label);
View Full Code Here

{
    @Test
    public void short_enough() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        String value = "Now the student has become the master.";

        replay();

        MaxLength validator = new MaxLength(null);
View Full Code Here

    @Test
    public void long_value() throws Exception
    {
        String label = "My Field";
        Field field = mockFieldWithLabel(label);
        MessageFormatter formatter = mockMessageFormatter();
        String value = "Now the student has become the master.";
        String message = "{message}";
        Integer constraint = value.length() - 1;

        train_format(formatter, message, constraint, label);
View Full Code Here

        String formValidationid = formSupport.getFormValidationId();

        Object coercedConstraintValue = computeConstraintValue(validatorType, validator, spec.getConstraintValue(),
                formValidationid, overrideId, overrideMessages);

        MessageFormatter formatter = findMessageFormatter(formValidationid, overrideId, overrideMessages, validatorType,
                validator);

        return new FieldValidatorImpl(field, coercedConstraintValue, formatter, validator, formSupport);
    }
View Full Code Here

    {
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages globalMessages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
        ValidatorMacro macro = mockValidatorMacro();
View Full Code Here

    public void component_messages_overrides_validator_messages() throws Exception
    {
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
        ValidatorMacro macro = mockValidatorMacro();
View Full Code Here

    public void component_messages_overrides_validator_messages_per_form() throws Exception
    {
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
        ValidatorMacro macro = mockValidatorMacro();
View Full Code Here

    public void constraint_value_from_message_catalog_per() throws Exception
    {
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Messages globalMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.MessageFormatter

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.