Changeset 15098 in josm for trunk/test
- Timestamp:
- 2019-05-20T01:20:35+02:00 (6 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
r15095 r15098 8 8 import java.util.ArrayList; 9 9 import java.util.List; 10 import java.util.stream.Collectors;11 10 12 11 import org.junit.BeforeClass; … … 35 34 */ 36 35 @RunWith(ParallelParameterized.class) 37 public class MapPaintPreferenceTestIT {36 public class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { 38 37 39 38 /** … … 43 42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 44 43 public static JOSMTestRules test = new JOSMTestRules().https().timeout(15000*60).parameters(); 45 46 /** Entry to test */47 private final ExtendedSourceEntry source;48 private final List<String> ignoredErrors = new ArrayList<>();49 private static final List<String> errorsToIgnore = new ArrayList<>();50 44 51 45 /** … … 66 60 public static List<Object[]> data() throws Exception { 67 61 ImageProvider.clearCache(); 68 return new MapPaintPreference.MapPaintSourceEditor().loadAndGetAvailableSources().stream() 69 .map(x -> new Object[] {x.getDisplayName(), x.url, x}).collect(Collectors.toList()); 62 return getTestParameters(new MapPaintPreference.MapPaintSourceEditor().loadAndGetAvailableSources()); 70 63 } 71 64 … … 77 70 */ 78 71 public MapPaintPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) { 79 this.source = source;72 super(source); 80 73 } 81 74 … … 116 109 assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty()); 117 110 } 118 119 private static boolean isIgnoredSubstring(String substring) {120 return errorsToIgnore.parallelStream().anyMatch(x -> substring.contains(x));121 }122 111 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java
r15097 r15098 7 7 8 8 import java.io.IOException; 9 import java.util.ArrayList;10 9 import java.util.Collection; 11 10 import java.util.HashSet; … … 17 16 import java.util.concurrent.TimeUnit; 18 17 import java.util.concurrent.TimeoutException; 19 import java.util.stream.Collectors;20 18 21 19 import org.junit.BeforeClass; … … 41 39 */ 42 40 @RunWith(Parameterized.class) 43 public class TaggingPresetPreferenceTestIT {41 public class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { 44 42 45 43 /** … … 49 47 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 50 48 public static JOSMTestRules test = new JOSMTestRules().https().timeout(10000*60).parameters(); 51 52 /** Entry to test */53 private final ExtendedSourceEntry source;54 private final List<String> ignoredErrors = new ArrayList<>();55 private static final List<String> errorsToIgnore = new ArrayList<>();56 49 57 50 /** … … 77 70 public static List<Object[]> data() throws Exception { 78 71 ImageProvider.clearCache(); 79 return new TaggingPresetPreference.TaggingPresetSourceEditor().loadAndGetAvailableSources().stream() 80 .map(x -> new Object[] {x.getDisplayName(), x.url, x}).collect(Collectors.toList()); 72 return getTestParameters(new TaggingPresetPreference.TaggingPresetSourceEditor().loadAndGetAvailableSources()); 81 73 } 82 74 … … 88 80 */ 89 81 public TaggingPresetPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) { 90 this.source = source;82 super(source); 91 83 } 92 84 … … 113 105 assertTrue(errors.toString(), errors.isEmpty()); 114 106 assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty()); 115 }116 117 private void handleException(Exception e, Set<String> errors) {118 e.printStackTrace();119 String s = source.url + " => " + e.toString();120 if (isIgnoredSubstring(s)) {121 ignoredErrors.add(s);122 } else {123 errors.add(s);124 }125 107 } 126 108 … … 152 134 } 153 135 } 154 155 private static boolean isIgnoredSubstring(String substring) {156 return errorsToIgnore.parallelStream().anyMatch(x -> substring.contains(x));157 }158 136 }
Note:
See TracChangeset
for help on using the changeset viewer.