Changeset 17360 in josm for trunk


Ignore:
Timestamp:
2020-11-25T13:40:57+01:00 (4 years ago)
Author:
Don-vip
Message:

see #16567 - print parameterized tests display name in failure messages

Location:
trunk/test/unit/org/openstreetmap/josm/gui/preferences
Files:
3 edited

Legend:

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

    r17275 r17360  
    384384    }
    385385
    386     private static String format(Map<String, Map<ImageryInfo, List<String>>> map) {
    387         return map.toString().replaceAll("\\}, ", "\n\\}, ").replaceAll(", ImageryInfo\\{", "\n      ,ImageryInfo\\{");
     386    private static String format(String id, Map<String, Map<ImageryInfo, List<String>>> map) {
     387        // #16567 - Shouldn't be necessary to print id if Ant worked properly
     388        // See https://josm.openstreetmap.de/ticket/16567#comment:53
     389        // See https://bz.apache.org/bugzilla/show_bug.cgi?id=64564
     390        // See https://github.com/apache/ant/pull/121
     391        return id + " => " + map.toString().replaceAll("\\}, ", "\n\\}, ").replaceAll(", ImageryInfo\\{", "\n      ,ImageryInfo\\{");
    388392    }
    389393
     
    398402    void testImageryEntryValidity(String id, ImageryInfo info) {
    399403        checkEntry(info);
    400         assertTrue(errors.isEmpty(), format(errors));
     404        assertTrue(errors.isEmpty(), format(id, errors));
    401405        assertFalse(workingURLs.isEmpty());
    402         assumeTrue(ignoredErrors.isEmpty(), format(ignoredErrors));
     406        assumeTrue(ignoredErrors.isEmpty(), format(id, ignoredErrors));
    403407    }
    404408}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java

    r17288 r17360  
    9999        warnings.removeAll(ignoredErrors);
    100100
    101         assertTrue(errors.isEmpty() && warnings.isEmpty(), errors.toString() + '\n' + warnings.toString());
     101        // #16567 - Shouldn't be necessary to print displayName if Ant worked properly
     102        // See https://josm.openstreetmap.de/ticket/16567#comment:53
     103        // See https://bz.apache.org/bugzilla/show_bug.cgi?id=64564
     104        // See https://github.com/apache/ant/pull/121
     105        assertTrue(errors.isEmpty() && warnings.isEmpty(), displayName + " => " + errors + '\n' + warnings);
    102106        assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty());
    103107    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java

    r17288 r17360  
    9898            handleException(source, e, errors, ignoredErrors);
    9999        }
    100         assertTrue(errors.isEmpty(), errors::toString);
     100        // #16567 - Shouldn't be necessary to print displayName if Ant worked properly
     101        // See https://josm.openstreetmap.de/ticket/16567#comment:53
     102        // See https://bz.apache.org/bugzilla/show_bug.cgi?id=64564
     103        // See https://github.com/apache/ant/pull/121
     104        assertTrue(errors.isEmpty(), displayName + " => " + errors);
    101105        assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty());
    102106    }
Note: See TracChangeset for help on using the changeset viewer.