Java Code Examples for sun.util.locale.provider.LocaleProviderAdapter#forJRE()

The following examples show how to use sun.util.locale.provider.LocaleProviderAdapter#forJRE() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Bug8167143.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * checks that locales nn-NO  and nb-NO should be present in list of supported locales for
 * all Providers for COMPAT.
 */
private static void testImplicitCompatLocales() {
    LocaleProviderAdapter jre = LocaleProviderAdapter.forJRE();
    checkPresenceCompat("BreakIteratorProvider",
        jre.getBreakIteratorProvider().getAvailableLocales());
    checkPresenceCompat("CollatorProvider",
        jre.getCollatorProvider().getAvailableLocales());
    checkPresenceCompat("DateFormatProvider",
        jre.getDateFormatProvider().getAvailableLocales());
    checkPresenceCompat("DateFormatSymbolsProvider",
        jre.getDateFormatSymbolsProvider().getAvailableLocales());
    checkPresenceCompat("DecimalFormatSymbolsProvider",
        jre.getDecimalFormatSymbolsProvider().getAvailableLocales());
    checkPresenceCompat("NumberFormatProvider",
        jre.getNumberFormatProvider().getAvailableLocales());
    checkPresenceCompat("CurrencyNameProvider",
        jre.getCurrencyNameProvider().getAvailableLocales());
    checkPresenceCompat("LocaleNameProvider",
        jre.getLocaleNameProvider().getAvailableLocales());
    checkPresenceCompat("TimeZoneNameProvider",
        jre.getTimeZoneNameProvider().getAvailableLocales());
    checkPresenceCompat("CalendarDataProvider",
        jre.getCalendarDataProvider().getAvailableLocales());
    checkPresenceCompat("CalendarNameProvider",
        jre.getCalendarNameProvider().getAvailableLocales());
    checkPresenceCompat("CalendarProvider",
        jre.getCalendarProvider().getAvailableLocales());
}
 
Example 2
Source File: Bug8167273.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Tests that locale nb should be supported by JRELocaleProvider .
 */
private static void testCompatSupportedLocale() {
    LocaleProviderAdapter jre = LocaleProviderAdapter.forJRE();
    checkPresenceCompat("BreakIteratorProvider",
            jre.getBreakIteratorProvider().getAvailableLocales());
    checkPresenceCompat("CollatorProvider",
            jre.getCollatorProvider().getAvailableLocales());
    checkPresenceCompat("DateFormatProvider",
            jre.getDateFormatProvider().getAvailableLocales());
    checkPresenceCompat("DateFormatSymbolsProvider",
            jre.getDateFormatSymbolsProvider().getAvailableLocales());
    checkPresenceCompat("DecimalFormatSymbolsProvider",
            jre.getDecimalFormatSymbolsProvider().getAvailableLocales());
    checkPresenceCompat("NumberFormatProvider",
            jre.getNumberFormatProvider().getAvailableLocales());
    checkPresenceCompat("CurrencyNameProvider",
            jre.getCurrencyNameProvider().getAvailableLocales());
    checkPresenceCompat("LocaleNameProvider",
            jre.getLocaleNameProvider().getAvailableLocales());
    checkPresenceCompat("TimeZoneNameProvider",
            jre.getTimeZoneNameProvider().getAvailableLocales());
    checkPresenceCompat("CalendarDataProvider",
            jre.getCalendarDataProvider().getAvailableLocales());
    checkPresenceCompat("CalendarNameProvider",
            jre.getCalendarNameProvider().getAvailableLocales());
    checkPresenceCompat("CalendarProvider",
            jre.getCalendarProvider().getAvailableLocales());
}
 
Example 3
Source File: Bug8038436.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void availableLocalesTests() {
    LocaleProviderAdapter jre = LocaleProviderAdapter.forJRE();

    checkAvailableLocales("BreakIteratorProvider",
        jre.getBreakIteratorProvider().getAvailableLocales(), bipLocs);
    checkAvailableLocales("CollatorProvider",
        jre.getCollatorProvider().getAvailableLocales(), cpLocs);
    checkAvailableLocales("DateFormatProvider",
        jre.getDateFormatProvider().getAvailableLocales(), dfpLocs);
    checkAvailableLocales("DateFormatSymbolsProvider",
        jre.getDateFormatSymbolsProvider().getAvailableLocales(), datefspLocs);
    checkAvailableLocales("DecimalFormatSymbolsProvider",
        jre.getDecimalFormatSymbolsProvider().getAvailableLocales(), decimalfspLocs);
    checkAvailableLocales("NumberFormatProvider",
        jre.getNumberFormatProvider().getAvailableLocales(), nfpLocs);
    checkAvailableLocales("CurrencyNameProvider",
        jre.getCurrencyNameProvider().getAvailableLocales(), currencynpLocs);
    checkAvailableLocales("LocaleNameProvider",
        jre.getLocaleNameProvider().getAvailableLocales(), lnpLocs);
    checkAvailableLocales("TimeZoneNameProvider",
        jre.getTimeZoneNameProvider().getAvailableLocales(), tznpLocs);
    checkAvailableLocales("CalendarDataProvider",
        jre.getCalendarDataProvider().getAvailableLocales(), caldpLocs);
    checkAvailableLocales("CalendarNameProvider",
        jre.getCalendarNameProvider().getAvailableLocales(), calnpLocs);
    checkAvailableLocales("CalendarProvider",
        jre.getCalendarProvider().getAvailableLocales(), calpLocs);
}