Ignore:
Timestamp:
2018-12-05T00:59:31+01:00 (5 years ago)
Author:
Don-vip
Message:

see #16073 - improve test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java

    r14507 r14512  
    8181            throws IOException {
    8282        TileXY xy = tileSource.latLonToTileXY(center, zoom);
    83         checkUrl(info, tileSource.getTileUrl(zoom, xy.getXIndex(), xy.getYIndex()));
     83        for (int i = 0; i < 3; i++) {
     84            try {
     85                checkUrl(info, tileSource.getTileUrl(zoom, xy.getXIndex(), xy.getYIndex()));
     86                return;
     87            } catch (IOException e) {
     88                // Try up to three times max to allow Bing source to initialize itself
     89                // and avoid random network errors
     90                Logging.trace(e);
     91                if (i == 2) {
     92                    throw e;
     93                }
     94                try {
     95                    Thread.sleep(500);
     96                } catch (InterruptedException ex) {
     97                    Logging.warn(ex);
     98                }
     99            }
     100        }
    84101    }
    85102
     
    118135        switch (info.getImageryType()) {
    119136            case BING:
    120                 return new BingAerialTileSource();
     137                return new BingAerialTileSource(info);
    121138            case SCANEX:
    122139                return new ScanexTileSource(info);
Note: See TracChangeset for help on using the changeset viewer.