Search in sources :

Example 1 with PerthreadManagerImpl

use of org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl in project tapestry-5 by apache.

the class PersistentLocaleImplTest method set_to_unsupported_locale.

/**
 * TAP5-537
 */
@Test
public void set_to_unsupported_locale() {
    PersistentLocale pl = new PersistentLocaleImpl(new PerthreadManagerImpl(null), "en,fr");
    try {
        pl.set(Locale.CHINESE);
        unreachable();
    } catch (IllegalArgumentException ex) {
        assertEquals(ex.getMessage(), "Locale 'zh' is not supported by this application. Supported locales are 'en,fr'; this is configured via the tapestry.supported-locales symbol.");
    }
}
Also used : PersistentLocale(org.apache.tapestry5.services.PersistentLocale) PerthreadManagerImpl(org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl) Test(org.testng.annotations.Test)

Aggregations

PerthreadManagerImpl (org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl)1 PersistentLocale (org.apache.tapestry5.services.PersistentLocale)1 Test (org.testng.annotations.Test)1