Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.MessageFormatter


        return String.format("[[missing key: %s]]", key);
    }

    public MessageFormatter getFormatter(final String key)
    {
        MessageFormatter result = _barrier.withRead(new Invokable<MessageFormatter>()
        {
            public MessageFormatter invoke()
            {
                return _cache.get(key);
            }
        });

        if (result != null) return result;

        final MessageFormatter newFormatter = buildMessageFormatter(key);

        _barrier.withWrite(new Runnable()
        {
            public void run()
            {
View Full Code Here


        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();

        Map<String, Validator> map = singletonMap("required", validator);
View Full Code Here

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();

        Map<String, Validator> map = singletonMap("required", validator);
View Full Code Here

        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();

        Map<String, Validator> map = singletonMap("minlength", validator);
View Full Code Here

        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();

        Map<String, Validator> map = singletonMap("required", validator);
View Full Code Here

        Validator required = mockValidator();
        Validator minLength = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter requiredFormatter = mockMessageFormatter();
        MessageFormatter minLengthFormatter = mockMessageFormatter();
        Object inputValue = "input value";
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer fifteen = 15;
View Full Code Here

        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        Integer five = 5;
View Full Code Here

{
    @Test
    public void null_value()
    {
        Field field = newFieldWithLabel("My Field");
        MessageFormatter formatter = newMessageFormatter();

        train_format(formatter, "{message}", "My Field");

        replay();
View Full Code Here

    }

    @Test
    public void blank_value()
    {
        MessageFormatter formatter = newMessageFormatter();
        Field field = newFieldWithLabel("My Field");

        train_format(formatter, "{message}", "My Field");

        replay();
View Full Code Here

    }

    @Test
    public void non_blank_value() throws Exception
    {
        MessageFormatter formatter = newMessageFormatter();
        Field field = newField();

        replay();

        new Required().validate(field, null, formatter, "not null");
View Full Code Here

TOP

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