Changeset 17275 in josm for trunk/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java
- Timestamp:
- 2020-10-28T20:41:00+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java
r13412 r17275 2 2 package org.openstreetmap.josm.data; 3 3 4 import static org.junit. Assert.assertEquals;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.io.InputStream; … … 11 11 import java.util.stream.Collectors; 12 12 13 import org.junit. Rule;14 import org.junit. Test;13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.extension.RegisterExtension; 15 15 import org.openstreetmap.josm.data.osm.DataSet; 16 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 24 24 * Test of boundaries OSM file. 25 25 */ 26 publicclass BoundariesTestIT {26 class BoundariesTestIT { 27 27 28 28 private static final List<String> RETIRED_ISO3166_1_CODES = Arrays.asList( … … 50 50 * Setup test. 51 51 */ 52 @R ule52 @RegisterExtension 53 53 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 54 54 public JOSMTestRules test = new JOSMTestRules().preferences(); … … 59 59 */ 60 60 @Test 61 publicvoid testBoundariesFile() throws Exception {61 void testBoundariesFile() throws Exception { 62 62 try (InputStream is = getClass().getResourceAsStream("/data/boundaries.osm")) { 63 63 DataSet ds = OsmReader.parseDataSet(is, null); … … 67 67 for (String code : iso31661a2) { 68 68 if (!RETIRED_ISO3166_1_CODES.contains(code)) { 69 assertEquals( code, 1, tagged.stream().filter(SearchCompiler.compile("ISO3166-1\\:alpha2="+code)).count());69 assertEquals(1, tagged.stream().filter(SearchCompiler.compile("ISO3166-1\\:alpha2="+code)).count(), code); 70 70 } 71 71 } … … 73 73 for (OsmPrimitive p : tagged.stream().filter(SearchCompiler.compile("ISO3166-1\\:alpha2")).collect(Collectors.toList())) { 74 74 String code = p.get("ISO3166-1:alpha2"); 75 assertTrue( code, iso31661a2.contains(code) || EXCEPTIONNALY_RESERVED_ISO3166_1_CODES.contains(code));75 assertTrue(iso31661a2.contains(code) || EXCEPTIONNALY_RESERVED_ISO3166_1_CODES.contains(code), code); 76 76 } 77 77 // Check presence of all ISO-3166-2 codes for USA, Canada, Australia (for speed limits) 78 78 for (String code : ISO3166_2_CODES) { 79 assertEquals( code, 1, tagged.stream().filter(SearchCompiler.compile("ISO3166-2="+code)).count());79 assertEquals(1, tagged.stream().filter(SearchCompiler.compile("ISO3166-2="+code)).count(), code); 80 80 } 81 81 }
Note:
See TracChangeset
for help on using the changeset viewer.