Generate Nearby list using Wikidata Query

Plus,
* remove duplicate location service manager
* add option to switch data sources of Nearby
* faster sorting of places
* minor coding style improvents
This commit is contained in:
Yusuke Matsubara 2017-04-13 18:40:36 +09:00
parent eb99350caf
commit 8731987385
11 changed files with 302 additions and 82 deletions

View file

@ -1,8 +1,8 @@
package fr.free.nrw.commons;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
public class UtilsTest {
@ -11,7 +11,7 @@ public class UtilsTest {
assertThat(Utils.fixExtension("SampleFile.jpeg", "jpeg"), is("SampleFile.jpg"));
}
@Test public void fixExtensionJPEGToJpg() {
@Test public void fixExtensionJpegToJpg() {
assertThat(Utils.fixExtension("SampleFile.JPEG", null), is("SampleFile.jpg"));
}
@ -46,4 +46,12 @@ public class UtilsTest {
@Test public void fixExtensionJpegNotExtension() {
assertThat(Utils.fixExtension("SAMPLE.jpeg.SAMPLE", "jpg"), is("SAMPLE.jpeg.SAMPLE.jpg"));
}
@Test public void stripLocalizedStringPass() {
assertThat(Utils.stripLocalizedString("Hello"), is("Hello"));
}
@Test public void stripLocalizedStringJa() {
assertThat(Utils.stripLocalizedString("\"こんにちは\"@ja"), is("こんにちは"));
}
}