Changeset 19697 in josm for trunk/test/unit/org
- Timestamp:
- 2026-11-21T17:35:19+01:00 (18 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java
r18799 r19697 4 4 import static java.util.Collections.singleton; 5 5 import static org.junit.jupiter.api.Assertions.assertEquals; 6 import static org.junit.jupiter.api.Assertions.assertFalse; 6 7 import static org.junit.jupiter.api.Assertions.assertNull; 7 8 import static org.junit.jupiter.api.Assertions.assertTrue; … … 51 52 52 53 /** 53 * Test of {@link Territories#initializeExternalData} - nominal case54 * Test of {@link Territories#initializeExternalData} with ISO codes represented as arrays. 54 55 */ 55 56 @Test 56 void testTaginfoGeofabrik_ nominal() {57 void testTaginfoGeofabrik_arrays() { 57 58 Territories.initializeExternalData("foo", TestUtils.getTestDataRoot() + "/taginfo/geofabrik-index-v1-nogeom.json"); 58 59 Map<String, TaginfoRegionalInstance> cache = Territories.taginfoGeofabrikCache; … … 67 68 assertEquals(1, regionalTaginfo.size()); 68 69 checkTaginfoInstance(regionalTaginfo.iterator().next(), singleton("AL"), "https://taginfo.geofabrik.de/europe/albania/"); 70 } 71 72 /** 73 * Test of {@link Territories#initializeExternalData} with ISO codes represented as strings. 74 */ 75 @Test 76 void testTaginfoGeofabrik_strings() { 77 Territories.initializeExternalData("foo", TestUtils.getTestDataRoot() + "/taginfo/geofabrik-index-v1-nogeom-strings.json"); 78 Map<String, TaginfoRegionalInstance> cache = Territories.taginfoGeofabrikCache; 79 assertEquals(3, cache.size()); 80 assertFalse(cache.containsKey("CA-AB"), "ISO3166-1 must take precedence over ISO3166-2"); 81 assertFalse(cache.containsKey(""), "Empty ISO codes must not be cached"); 82 checkTaginfoInstance(cache.get("AL"), singleton("AL"), "https://taginfo.geofabrik.de/europe/albania/"); 83 Set<String> guernseyAndJersey = new HashSet<>(Arrays.asList("GG", "JE")); 84 checkTaginfoInstance(cache.get("GG"), guernseyAndJersey, "https://taginfo.geofabrik.de/europe/guernsey-jersey/"); 85 checkTaginfoInstance(cache.get("JE"), guernseyAndJersey, "https://taginfo.geofabrik.de/europe/guernsey-jersey/"); 69 86 } 70 87
Note:
See TracChangeset
for help on using the changeset viewer.
