Ignore:
Timestamp:
2020-10-31T01:21:14+01:00 (3 years ago)
Author:
Don-vip
Message:

see #16567 - fix integration tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java

    r17275 r17288  
    1010import java.util.List;
    1111
    12 import org.junit.ClassRule;
    1312import 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;
     13import org.junit.jupiter.api.extension.RegisterExtension;
     14import org.junit.jupiter.params.ParameterizedTest;
     15import org.junit.jupiter.params.provider.MethodSource;
    1716import org.openstreetmap.josm.TestUtils;
    1817import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry;
     
    2625import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    2726import org.openstreetmap.josm.testutils.JOSMTestRules;
    28 import org.openstreetmap.josm.testutils.ParallelParameterized;
    2927import org.openstreetmap.josm.tools.ImageProvider;
    3028
     
    3432 * Integration tests of {@link MapPaintPreference} class.
    3533 */
    36 @RunWith(ParallelParameterized.class)
    3734class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
    3835
     
    4037     * Setup rule
    4138     */
    42     @ClassRule
     39    @RegisterExtension
    4340    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    4441    public static JOSMTestRules test = new JOSMTestRules().https().timeout(15000*60).parameters();
     
    5855     * @throws Exception if an error occurs
    5956     */
    60     @Parameters(name = "{0} - {1}")
    6157    public static List<Object[]> data() throws Exception {
    6258        ImageProvider.clearCache();
     
    6561
    6662    /**
    67      * Constructs a new {@code MapPaintPreferenceTestIT}
     63     * Test that map paint style is valid.
    6864     * @param displayName displayed name
    6965     * @param url URL
    7066     * @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.
    7867     * @throws Exception in case of error
    7968     */
    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));
    8373        StyleSource style = MapPaintStyles.addStyle(source);
    8474        if (style instanceof MapCSSStyleSource) {
     
    10090        }
    10191
     92        List<String> ignoredErrors = new ArrayList<>();
    10293        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);
    10495        errors.removeIf(e -> ignoredErrors.contains(e.getMessage()));
    10596
    10697        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);
    10899        warnings.removeAll(ignoredErrors);
    109100
Note: See TracChangeset for help on using the changeset viewer.