Changeset 14449 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2018-11-25T15:00:02+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java
r14235 r14449 8 8 import java.util.Collection; 9 9 import java.util.HashMap; 10 import java.util.HashSet;11 10 import java.util.Map; 11 import java.util.Objects; 12 12 import java.util.Set; 13 import java.util.TreeSet; 14 import java.util.concurrent.ExecutionException; 15 import java.util.concurrent.TimeUnit; 16 import java.util.concurrent.TimeoutException; 13 17 14 18 import org.junit.Rule; … … 50 54 Config.getPref().putInt("socket.timeout.connect", 30); 51 55 Config.getPref().putInt("socket.timeout.read", 60); 52 Map< Object, Throwable> allErrors = new HashMap<>();53 Set<String> allMessages = new HashSet<>();56 Map<String, Throwable> allErrors = new HashMap<>(); 57 Map<String, Set<String>> allMessages = new HashMap<>(); 54 58 for (ExtendedSourceEntry source : sources) { 55 59 System.out.println(source.url); … … 83 87 } 84 88 85 private static void testPresets( Set<String> allMessages, ExtendedSourceEntry source) throws SAXException, IOException {89 private static void testPresets(Map<String, Set<String>> allMessages, ExtendedSourceEntry source) throws SAXException, IOException { 86 90 Collection<TaggingPreset> presets = TaggingPresetReader.readAll(source.url, true); 87 91 assertFalse(presets.isEmpty()); 92 // wait for asynchronous icon loading 93 presets.stream().map(TaggingPreset::getIconLoadingTask).filter(Objects::nonNull).forEach(t -> { 94 try { 95 t.get(30, TimeUnit.SECONDS); 96 } catch (InterruptedException | ExecutionException | TimeoutException e) { 97 Logging.error(e); 98 } 99 }); 88 100 Collection<String> errorsAndWarnings = Logging.getLastErrorAndWarnings(); 89 101 boolean error = false; … … 93 105 // ignore https://github.com/yopaseopor/traffic_signs_preset_JOSM because of far too frequent missing icons errors 94 106 if (!source.url.contains("yopaseopor/traffic_signs")) { 95 allMessages. add(message);107 allMessages.computeIfAbsent(source.url, x -> new TreeSet<>()).add(message); 96 108 } 97 109 }
Note:
See TracChangeset
for help on using the changeset viewer.