Search in sources :

Example 6 with PersistentLocale

use of org.apache.tapestry5.services.PersistentLocale in project tapestry-5 by apache.

the class LocalizationSetterImplTest method unknown_locale_uses_locale_from_request.

@Test
public void unknown_locale_uses_locale_from_request() {
    PersistentLocale pl = mockPersistentLocale();
    ThreadLocale tl = mockThreadLocale();
    Request request = mockRequest();
    tl.setLocale(Locale.FRENCH);
    train_getLocale(request, Locale.CANADA_FRENCH);
    replay();
    LocalizationSetterImpl setter = new LocalizationSetterImpl(request, pl, tl, "en,fr");
    assertFalse(setter.setLocaleFromLocaleName("unknown"));
    verify();
}
Also used : PersistentLocale(org.apache.tapestry5.services.PersistentLocale) ThreadLocale(org.apache.tapestry5.ioc.services.ThreadLocale) Request(org.apache.tapestry5.http.services.Request) Test(org.testng.annotations.Test)

Aggregations

PersistentLocale (org.apache.tapestry5.services.PersistentLocale)6 Test (org.testng.annotations.Test)6 Request (org.apache.tapestry5.http.services.Request)5 ThreadLocale (org.apache.tapestry5.ioc.services.ThreadLocale)5 PerthreadManagerImpl (org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl)1 LocalizationSetter (org.apache.tapestry5.services.LocalizationSetter)1