Changeset 16595 in josm for trunk/test
- Timestamp:
- 2020-06-11T08:40:11+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java
r16182 r16595 9 9 import java.util.Arrays; 10 10 import java.util.HashSet; 11 import java.util.List; 11 12 import java.util.Map; 12 13 import java.util.Set; 13 import java.util.TreeMap;14 14 15 15 import org.junit.Rule; … … 35 35 /** 36 36 * Tests that {@code Territories} satisfies utility class criteria. 37 * 37 38 * @throws ReflectiveOperationException if an error occurs 38 39 */ … … 61 62 @Test 62 63 public void testTaginfoGeofabrik_nominal() { 63 Map<String, TaginfoRegionalInstance> cache = new TreeMap<>();64 Territories.initializeExternalData(cache, "foo", TestUtils.getTestDataRoot() + "/taginfo/geofabrik-index-v1-nogeom.json");64 Territories.initializeExternalData("foo", TestUtils.getTestDataRoot() + "/taginfo/geofabrik-index-v1-nogeom.json"); 65 Map<String, TaginfoRegionalInstance> cache = Territories.taginfoGeofabrikCache; 65 66 assertEquals(5, cache.size()); 66 67 checkTaginfoInstance(cache.get("AF"), singleton("AF"), "https://taginfo.geofabrik.de/asia/afghanistan/"); … … 70 71 checkTaginfoInstance(cache.get("PS"), israelAndPalestine, "https://taginfo.geofabrik.de/asia/israel-and-palestine/"); 71 72 checkTaginfoInstance(cache.get("IL"), israelAndPalestine, "https://taginfo.geofabrik.de/asia/israel-and-palestine/"); 73 List<TaginfoRegionalInstance> regionalTaginfo = Territories.getRegionalTaginfoUrls(new LatLon(41.3268733, 19.8187913)); 74 assertEquals(1, regionalTaginfo.size()); 75 checkTaginfoInstance(regionalTaginfo.iterator().next(), singleton("AL"), "https://taginfo.geofabrik.de/europe/albania/"); 72 76 } 73 77 … … 83 87 @Test 84 88 public void testTaginfoGeofabrik_broken() { 85 Map<String, TaginfoRegionalInstance> cache = new TreeMap<>();86 89 Logging.clearLastErrorAndWarnings(); 87 Territories.initializeExternalData(cache, "foo", TestUtils.getTestDataRoot() + "taginfo/geofabrik-index-v1-nogeom-broken.json"); 90 Territories.initializeExternalData("foo", TestUtils.getTestDataRoot() + "taginfo/geofabrik-index-v1-nogeom-broken.json"); 91 Map<String, TaginfoRegionalInstance> cache = Territories.taginfoGeofabrikCache; 88 92 assertTrue(cache.isEmpty()); 89 93 String error = Logging.getLastErrorAndWarnings().get(0);
Note:
See TracChangeset
for help on using the changeset viewer.