Changeset 14708 in josm for trunk/test
- Timestamp:
- 2019-01-20T13:47:48+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/LanguageInfoTest.java
r14664 r14708 8 8 import java.util.stream.Stream; 9 9 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 10 import org.junit.Assert; 12 11 import org.junit.Rule; 13 12 import org.junit.Test; 14 13 import org.openstreetmap.josm.testutils.JOSMTestRules; 14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 15 16 16 17 /** … … 41 42 */ 42 43 @Test 43 public void getWikiLanguagePrefix() {44 test WikiLanguagePrefixes(LanguageInfo.LocaleType.DEFAULT,44 public void testWikiLanguagePrefix() { 45 testGetWikiLanguagePrefixes(LanguageInfo.LocaleType.DEFAULT, 45 46 "En:", "De:", "Pt_BR:", "Ca-Valencia:", "Zh_CN:", "Zh_TW:", "Ast:", "En_GB:", "Ru:", "Nb:"); 46 test WikiLanguagePrefixes(LanguageInfo.LocaleType.DEFAULTNOTENGLISH,47 testGetWikiLanguagePrefixes(LanguageInfo.LocaleType.DEFAULTNOTENGLISH, 47 48 null, "De:", "Pt_BR:", "Ca-Valencia:", "Zh_CN:", "Zh_TW:", "Ast:", "En_GB:", "Ru:", "Nb:"); 48 test WikiLanguagePrefixes(LanguageInfo.LocaleType.BASELANGUAGE,49 testGetWikiLanguagePrefixes(LanguageInfo.LocaleType.BASELANGUAGE, 49 50 null, null, "Pt:", null, "Zh:", "Zh:", null, null, null, null); 50 test WikiLanguagePrefixes(LanguageInfo.LocaleType.ENGLISH,51 testGetWikiLanguagePrefixes(LanguageInfo.LocaleType.ENGLISH, 51 52 "", "", "", "", "", "", "", "", "", ""); 52 test WikiLanguagePrefixes(LanguageInfo.LocaleType.OSM_WIKI,53 testGetWikiLanguagePrefixes(LanguageInfo.LocaleType.OSM_WIKI, 53 54 "", "DE:", "Pt:", "Ca:", "Zh-hans:", "Zh-hant:", "Ast:", "", "RU:", "No:"); 54 55 } 55 56 56 private static void test WikiLanguagePrefixes(LanguageInfo.LocaleType type, String...expected) {57 private static void testGetWikiLanguagePrefixes(LanguageInfo.LocaleType type, String...expected) { 57 58 final List<String> actual = Stream.of(EN_CA, DE_DE, PT_BR, CA_ES_VALENCIA, ZN_CN, ZN_TW, AST, EN_GB, RU, NB) 58 59 .map(locale -> LanguageInfo.getWikiLanguagePrefix(locale, type)) … … 65 66 */ 66 67 @Test 67 public void getJOSMLocaleCode() {68 public void testGetJOSMLocaleCode() { 68 69 Assert.assertEquals("de", LanguageInfo.getJOSMLocaleCode(DE_DE)); 69 70 Assert.assertEquals("pt_BR", LanguageInfo.getJOSMLocaleCode(PT_BR)); … … 75 76 */ 76 77 @Test 77 public void getJavaLocaleCode() {78 public void testGetJavaLocaleCode() { 78 79 Assert.assertEquals("ca__valencia", LanguageInfo.getJavaLocaleCode("ca@valencia")); 79 80 } … … 83 84 */ 84 85 @Test 85 public void getLanguageCodeXML() {86 public void testGetLanguageCodeXML() { 86 87 Assert.assertEquals("ca-valencia.", LanguageInfo.getLanguageCodeXML()); 87 88 } … … 91 92 */ 92 93 @Test 93 public void getLanguageCodeManifest() {94 public void testGetLanguageCodeManifest() { 94 95 Assert.assertEquals("ca-valencia_", LanguageInfo.getLanguageCodeManifest()); 95 96 } … … 99 100 */ 100 101 @Test 101 public void getLanguageCodes() {102 public void testGetLanguageCodes() { 102 103 Assert.assertEquals(Arrays.asList("ca_ES@valencia", "ca@valencia", "ca_ES", "ca"), LanguageInfo.getLanguageCodes(CA_ES_VALENCIA)); 103 104 }
Note:
See TracChangeset
for help on using the changeset viewer.