Code example for Locale

Methods: getDisplayLanguage

0
        assertEquals("TRADITIONAL", unknown.getDisplayVariant());
        assertEquals("xx (YY,TRADITIONAL)", unknown.getDisplayName());
    } 
 
    public void test_getDisplayName_easy() throws Exception { 
        assertEquals("English", Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH));
        assertEquals("German", Locale.GERMAN.getDisplayLanguage(Locale.ENGLISH));
        assertEquals("Englisch", Locale.ENGLISH.getDisplayLanguage(Locale.GERMAN));
        assertEquals("Deutsch", Locale.GERMAN.getDisplayLanguage(Locale.GERMAN));
    } 
 
    public void test_getDisplayCountry_8870289() throws Exception { 
        assertEquals("Hong Kong", new Locale("", "HK").getDisplayCountry(Locale.US));
        assertEquals("Macau", new Locale("", "MO").getDisplayCountry(Locale.US));
        assertEquals("Palestine", new Locale("", "PS").getDisplayCountry(Locale.US));
 
        assertEquals("Cocos [Keeling] Islands", new Locale("", "CC").getDisplayCountry(Locale.US));
        assertEquals("Congo [DRC]", new Locale("", "CD").getDisplayCountry(Locale.US));
        assertEquals("Congo [Republic]", new Locale("", "CG").getDisplayCountry(Locale.US));
        assertEquals("Falkland Islands [Islas Malvinas]", new Locale("", "FK").getDisplayCountry(Locale.US));
        assertEquals("Macedonia [FYROM]", new Locale("", "MK").getDisplayCountry(Locale.US));