Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.PersistentLocale


    }

    @Test
    public void set_nonpersistent_locale()
    {
        PersistentLocale pl = mockPersistentLocale();
        ThreadLocale tl = mockThreadLocale();
        Request request = mockRequest();

        tl.setLocale(Locale.FRENCH);
View Full Code Here


    }
  
    @Test
    public void is_supported_locale_name()
    {
        PersistentLocale pl = mockPersistentLocale();
        ThreadLocale tl = mockThreadLocale();
        Request request = mockRequest();


        replay();
View Full Code Here

            {
                return name.equals("org.apache.tapestry5.locale") ? "fr" : null;
            }

        };
        PersistentLocale persistentLocale = new PersistentLocaleImpl(cookieSource);
        assertEquals(persistentLocale.get(), Locale.FRENCH);
    }
View Full Code Here

            {
                return null;
            }

        };
        PersistentLocale persistentLocale = new PersistentLocaleImpl(cookieSource);
        assertNull(persistentLocale.get());
    }
View Full Code Here

            {
                cookies.put(name, value);
            }

        };
        PersistentLocale persistentLocale = new PersistentLocaleImpl(cookieSource);
        persistentLocale.set(Locale.CANADA_FRENCH);
        assertEquals(cookies.size(), 1);
        assertEquals(cookies.get("org.apache.tapestry5.locale"), "fr_CA");
    }
View Full Code Here

    }

    @Test
    public void unknown_validator_type()
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void validator_with_no_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void component_messages_overrides_validator_messages() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
View Full Code Here

    }

    @Test
    public void component_messages_overrides_validator_messages_per_form() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
View Full Code Here

        MarkupWriter writer = factory.newPartialMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.PersistentLocale

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.