Changeset 14694 in josm


Ignore:
Timestamp:
2019-01-13T15:19:55+01:00 (5 weeks ago)
Author:
Don-vip
Message:

see #16073 - allow to ignore error only based on its last part

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererTest.java

    r14202 r14694  
    66
    77import org.junit.Test;
     8import org.openstreetmap.josm.TestUtils;
    89import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.StyleRecord;
    910
     
    8586    @Test
    8687    public void testEqualsContract() {
     88        TestUtils.assumeWorkingEqualsVerifier();
    8789        EqualsVerifier.forClass(StyleRecord.class).usingGetClass()
    8890            .suppress(Warning.NONFINAL_FIELDS)
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java

    r14616 r14694  
    7676public class ImageryPreferenceTestIT {
    7777
     78    private static final String ERROR_SEP = " -> ";
    7879    private static final LatLon GREENWICH = new LatLon(51.47810, -0.00170);
    7980    private static final int DEFAULT_ZOOM = 12;
     
    157158        if (notIgnoredErrors.contains(errorMsg))
    158159            notIgnoredErrors.remove(errorMsg);
    159         return addError(errorsToIgnore.contains(errorMsg) ? ignoredErrors : errors, info, errorMsg);
     160        return addError(isIgnoredError(errorMsg) ? ignoredErrors : errors, info, errorMsg);
     161    }
     162
     163    private boolean isIgnoredError(String errorMsg) {
     164        int idx = errorMsg.lastIndexOf(ERROR_SEP);
     165        return errorsToIgnore.contains(errorMsg) || (idx > -1 && errorsToIgnore.contains(errorMsg.substring(idx + ERROR_SEP.length())));
    160166    }
    161167
     
    190196                } catch (IOException e) {
    191197                    if (response.getResponseCode() < 300) {
    192                         addError(info, url + " -> " + e);
     198                        addError(info, url + ERROR_SEP + e);
    193199                    }
    194200                } finally {
     
    196202                }
    197203            } catch (IOException e) {
    198                 addError(info, url + " -> " + e);
     204                addError(info, url + ERROR_SEP + e);
    199205            }
    200206        }
     
    244250
    245251    private static String zoomMarker(int zoom) {
    246         return " -> zoom " + zoom + " -> ";
     252        return " -> zoom " + zoom + ERROR_SEP;
    247253    }
    248254
     
    338344            }
    339345        } catch (IOException | RuntimeException | WMSGetCapabilitiesException | WMTSGetCapabilitiesException e) {
    340             addError(info, info.getUrl() + " -> " + e.toString());
     346            addError(info, info.getUrl() + ERROR_SEP + e.toString());
    341347        }
    342348
     
    347353
    348354    private static boolean isZoomError(String error) {
    349         String[] parts = error.split(" -> ");
     355        String[] parts = error.split(ERROR_SEP);
    350356        String lastPart = parts.length > 0 ? parts[parts.length - 1].toLowerCase(Locale.ENGLISH) : "";
    351357        return lastPart.contains("bbox")
Note: See TracChangeset for help on using the changeset viewer.