Changeset 17288 in josm for trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
- Timestamp:
- 2020-10-31T01:21:14+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
r17275 r17288 10 10 import java.util.List; 11 11 12 import org.junit.ClassRule;13 12 import org.junit.jupiter.api.BeforeAll; 14 import org.junit.jupiter.api. Test;15 import org.junit. runner.RunWith;16 import org.junit. runners.Parameterized.Parameters;13 import org.junit.jupiter.api.extension.RegisterExtension; 14 import org.junit.jupiter.params.ParameterizedTest; 15 import org.junit.jupiter.params.provider.MethodSource; 17 16 import org.openstreetmap.josm.TestUtils; 18 17 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry; … … 26 25 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 27 26 import org.openstreetmap.josm.testutils.JOSMTestRules; 28 import org.openstreetmap.josm.testutils.ParallelParameterized;29 27 import org.openstreetmap.josm.tools.ImageProvider; 30 28 … … 34 32 * Integration tests of {@link MapPaintPreference} class. 35 33 */ 36 @RunWith(ParallelParameterized.class)37 34 class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase { 38 35 … … 40 37 * Setup rule 41 38 */ 42 @ ClassRule39 @RegisterExtension 43 40 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 44 41 public static JOSMTestRules test = new JOSMTestRules().https().timeout(15000*60).parameters(); … … 58 55 * @throws Exception if an error occurs 59 56 */ 60 @Parameters(name = "{0} - {1}")61 57 public static List<Object[]> data() throws Exception { 62 58 ImageProvider.clearCache(); … … 65 61 66 62 /** 67 * Constructs a new {@code MapPaintPreferenceTestIT}63 * Test that map paint style is valid. 68 64 * @param displayName displayed name 69 65 * @param url URL 70 66 * @param source source entry to test 71 */72 MapPaintPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {73 super(source);74 }75 76 /**77 * Test that map paint style is valid.78 67 * @throws Exception in case of error 79 68 */ 80 @Test 81 void testStyleValidity() throws Exception { 82 assumeFalse(isIgnoredSubstring(source.url)); 69 @ParameterizedTest(name = "{0} - {1}") 70 @MethodSource("data") 71 void testStyleValidity(String displayName, String url, ExtendedSourceEntry source) throws Exception { 72 assumeFalse(isIgnoredSubstring(source, source.url)); 83 73 StyleSource style = MapPaintStyles.addStyle(source); 84 74 if (style instanceof MapCSSStyleSource) { … … 100 90 } 101 91 92 List<String> ignoredErrors = new ArrayList<>(); 102 93 List<Throwable> errors = new ArrayList<>(style.getErrors()); 103 errors.stream().map(Throwable::getMessage).filter( this::isIgnoredSubstring).forEach(ignoredErrors::add);94 errors.stream().map(Throwable::getMessage).filter(s -> isIgnoredSubstring(source, s)).forEach(ignoredErrors::add); 104 95 errors.removeIf(e -> ignoredErrors.contains(e.getMessage())); 105 96 106 97 List<String> warnings = new ArrayList<>(style.getWarnings()); 107 warnings.stream().filter( this::isIgnoredSubstring).forEach(ignoredErrors::add);98 warnings.stream().filter(s -> isIgnoredSubstring(source, s)).forEach(ignoredErrors::add); 108 99 warnings.removeAll(ignoredErrors); 109 100
Note:
See TracChangeset
for help on using the changeset viewer.