Changeset 32001 in osm for applications/editors/josm/plugins/wikipedia/test/unit/org
- Timestamp:
- 2016-01-18T12:43:17+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/test/unit/org/wikipedia/WikipediaAppTest.java
r31907 r32001 13 13 import java.util.Collection; 14 14 import java.util.List; 15 import java.util.Locale; 15 16 import java.util.Map; 16 17 … … 25 26 public void setUp() throws Exception { 26 27 Main.initApplicationPreferences(); 28 } 29 30 @Test 31 public void testMediawikiLocale() throws Exception { 32 assertThat(WikipediaApp.getMediawikiLocale(Locale.GERMANY), is("de-de")); 33 assertThat(WikipediaApp.getMediawikiLocale(Locale.GERMAN), is("de")); 34 assertThat(WikipediaApp.getMediawikiLocale(Locale.UK), is("en-gb")); 35 assertThat(WikipediaApp.getMediawikiLocale(Locale.CANADA), is("en-ca")); 27 36 } 28 37 … … 146 155 @Test 147 156 public void testGetLabelForWikidata() throws Exception { 148 assertThat(WikipediaApp.getLabelForWikidata("Q1741", "de"), is("Wien"));149 assertThat(WikipediaApp.getLabelForWikidata("Q1741", "en"), is("Vienna"));150 assertThat(WikipediaApp.getLabelForWikidata("Q" + Long.MAX_VALUE, "en"), nullValue());157 assertThat(WikipediaApp.getLabelForWikidata("Q1741", Locale.GERMAN), is("Wien")); 158 assertThat(WikipediaApp.getLabelForWikidata("Q1741", Locale.ENGLISH), is("Vienna")); 159 assertThat(WikipediaApp.getLabelForWikidata("Q" + Long.MAX_VALUE, Locale.ENGLISH), nullValue()); 151 160 } 152 161 153 162 @Test(expected = RuntimeException.class) 154 163 public void testGetLabelForWikidataInvalidId() throws Exception { 155 WikipediaApp.getLabelForWikidata("Qxyz", "en");164 WikipediaApp.getLabelForWikidata("Qxyz", Locale.ENGLISH); 156 165 } 157 166
Note:
See TracChangeset
for help on using the changeset viewer.