Changeset 17288 in josm for trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/AbstractExtendedSourceEntryTestCase.java
- Timestamp:
- 2020-10-31T01:21:14+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/AbstractExtendedSourceEntryTestCase.java
r15100 r17288 20 20 protected static final List<String> errorsToIgnore = new ArrayList<>(); 21 21 22 /** Entry to test */23 protected final ExtendedSourceEntry source;24 protected final List<String> ignoredErrors = new ArrayList<>();25 26 protected AbstractExtendedSourceEntryTestCase(ExtendedSourceEntry source) {27 this.source = source;28 }29 30 22 protected static List<Object[]> getTestParameters(Collection<ExtendedSourceEntry> entries) throws Exception { 31 23 return entries.stream().map(x -> new Object[] {x.getDisplayName(), cleanUrl(x.url), x}).collect(Collectors.toList()); … … 48 40 } 49 41 50 protected final void handleException(Exception e, Set<String> errors) { 42 protected final void handleException(ExtendedSourceEntry source, Exception e, Set<String> errors, List<String> ignoredErrors) { 51 43 e.printStackTrace(); 52 44 String s = source.url + " => " + e.toString(); 53 if (isIgnoredSubstring(s)) { 45 if (isIgnoredSubstring(source, s)) { 54 46 ignoredErrors.add(s); 55 47 } else { … … 58 50 } 59 51 60 protected boolean isIgnoredSubstring(String substring) { 52 protected boolean isIgnoredSubstring(ExtendedSourceEntry source, String substring) { 61 53 return errorsToIgnore.parallelStream().anyMatch(x -> substring.contains(x) || source.url.contains(x)); 62 54 }
Note:
See TracChangeset
for help on using the changeset viewer.
