Ignore:
Timestamp:
2020-10-28T22:46:55+01:00 (3 years ago)
Author:
Don-vip
Message:

see #16567 - fix obvious test errors + upgrade tests dependencies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java

    r17275 r17276  
    2828import javax.imageio.ImageIO;
    2929
    30 import org.junit.jupiter.api.BeforeEach;
    31 import org.junit.jupiter.api.Test;
    3230import org.junit.jupiter.api.extension.RegisterExtension;
    33 import org.junit.runner.RunWith;
    34 import org.junit.runners.Parameterized;
    35 import org.junit.runners.Parameterized.Parameters;
     31import org.junit.jupiter.params.ParameterizedTest;
     32import org.junit.jupiter.params.provider.MethodSource;
    3633import org.openstreetmap.josm.TestUtils;
    3734import org.openstreetmap.josm.data.Bounds;
     
    5552 * @author Michael Zangl
    5653 */
    57 @RunWith(Parameterized.class)
    5854public class MapCSSRendererTest {
    5955    private static final String TEST_DATA_BASE = "/renderer/";
     
    7167    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
    7268
    73     private final TestConfig testConfig;
    74 
    7569    // development flag - set to true in order to update all reference images
    7670    private static final boolean UPDATE_ALL = false;
     
    8175     * @return The parameters.
    8276     */
    83     @Parameters(name = "{1}")
    8477    public static Collection<Object[]> runs() {
    8578        return Stream.of(
     
    169162
    170163    /**
     164     * Run the test using {@code testConfig}
    171165     * @param testConfig The config to use for this test.
    172166     * @param ignored The name to print it nicely
     167     * @throws Exception if an error occurs
    173168     */
    174     public MapCSSRendererTest(TestConfig testConfig, String ignored) {
    175         this.testConfig = testConfig;
    176     }
    177 
    178     /**
    179      * This test only runs on OpenJDK.
    180      * It is ignored for other Java versions since they differ slightly in their rendering engine.
    181      * @since 11691
    182      */
    183     @BeforeEach
    184     public void forOpenJDK() {
     169    @ParameterizedTest(name = "{1}")
     170    @MethodSource("runs")
     171    void testRender(TestConfig testConfig, String ignored) throws Exception {
     172        // This test only runs on OpenJDK.
     173        // It is ignored for other Java versions since they differ slightly in their rendering engine.
    185174        String javaHome = System.getProperty("java.home");
    186175        assumeTrue(javaHome != null && javaHome.toLowerCase(Locale.ENGLISH).contains("openjdk"), "Test requires openJDK");
     
    190179            assumeTrue(fonts.contains(font), "Test requires font: " + font);
    191180        }
    192     }
    193 
    194     /**
    195      * Run the test using {@link #testConfig}
    196      * @throws Exception if an error occurs
    197      */
    198     @Test
    199     void testRender() throws Exception {
     181
    200182        // Force reset of preferences
    201183        StyledMapRenderer.PREFERENCE_ANTIALIASING_USE.put(true);
Note: See TracChangeset for help on using the changeset viewer.