Ignore:
Timestamp:
2020-07-14T20:19:40+02:00 (4 years ago)
Author:
simon04
Message:

fix #19449 ImageProviderTest.testGetPadded has slow startup, and a race condition (patch by johsin18, modified)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java

    r15539 r16768  
    1313import java.util.List;
    1414import java.util.Locale;
    15 import java.util.Objects;
    1615import java.util.Set;
    17 import java.util.concurrent.ExecutionException;
    18 import java.util.concurrent.TimeUnit;
    19 import java.util.concurrent.TimeoutException;
    2016
    2117import org.junit.BeforeClass;
     
    2925import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
    3026import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader;
     27import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetsTest;
    3128import org.openstreetmap.josm.gui.tagging.presets.items.Link;
    3229import org.openstreetmap.josm.spi.preferences.Config;
     
    116113        Collection<TaggingPreset> presets = TaggingPresetReader.readAll(source.url, true);
    117114        assertFalse(presets.isEmpty());
    118         // wait for asynchronous icon loading
    119         presets.parallelStream().map(TaggingPreset::getIconLoadingTask).filter(Objects::nonNull).forEach(t -> {
    120             try {
    121                 t.get(30, TimeUnit.SECONDS);
    122             } catch (InterruptedException | ExecutionException | TimeoutException e) {
    123                 Logging.error(e);
    124             }
    125         });
     115        TaggingPresetsTest.waitForIconLoading(presets);
    126116        // check that links are correct and not redirections
    127117        presets.parallelStream().flatMap(x -> x.data.stream().filter(i -> i instanceof Link).map(i -> ((Link) i).getUrl())).forEach(u -> {
Note: See TracChangeset for help on using the changeset viewer.