@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."); } }
public void set(Locale locale) { assert locale != null; if (!localeNames.contains(locale.toString().toLowerCase())) { String message = String .format("Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.", locale, supportedLocales, SymbolConstants.SUPPORTED_LOCALES); throw new IllegalArgumentException(message); } localeValue.set(locale); }
PersistentLocaleImpl implements PersistentLocale { public void set(Locale locale) { assert locale != null; if (!localeNames.contains(locale.toString().toLowerCase())) { String message = String .format("Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.", locale, supportedLocales, SymbolConstants.SUPPORTED_LOCALES); throw new IllegalArgumentException(message); } localeValue.set(locale); } }
PersistentLocaleImpl implements PersistentLocale { public void set(Locale locale) { assert locale != null; if (!localeNames.contains(locale.toString().toLowerCase())) { String message = String .format("Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.", locale, supportedLocales, SymbolConstants.SUPPORTED_LOCALES); throw new IllegalArgumentException(message); } localeValue.set(locale); } PersistentLocaleImpl(PerthreadManager perThreadManager,

    @Symbol(SymbolConstants.SUPPORTED_LOCALES)
    String supportedLocales); }
PersistentLocaleImpl implements PersistentLocale { public void set(Locale locale) { assert locale != null; if (!localeNames.contains(locale.toString().toLowerCase())) { String message = String .format("Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.", locale, supportedLocales, SymbolConstants.SUPPORTED_LOCALES); throw new IllegalArgumentException(message); } localeValue.set(locale); } PersistentLocaleImpl(PerthreadManager perThreadManager,

    @Symbol(SymbolConstants.SUPPORTED_LOCALES)
    String supportedLocales); void set(Locale locale); Locale get(); boolean isSet(); }
PersistentLocaleImpl implements PersistentLocale { public void set(Locale locale) { assert locale != null; if (!localeNames.contains(locale.toString().toLowerCase())) { String message = String .format("Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.", locale, supportedLocales, SymbolConstants.SUPPORTED_LOCALES); throw new IllegalArgumentException(message); } localeValue.set(locale); } PersistentLocaleImpl(PerthreadManager perThreadManager,

    @Symbol(SymbolConstants.SUPPORTED_LOCALES)
    String supportedLocales); void set(Locale locale); Locale get(); boolean isSet();  }