Changeset 17276 in josm for trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
- Timestamp:
- 2020-10-28T22:46:55+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
r17275 r17276 28 28 import javax.imageio.ImageIO; 29 29 30 import org.junit.jupiter.api.BeforeEach;31 import org.junit.jupiter.api.Test;32 30 import 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; 31 import org.junit.jupiter.params.ParameterizedTest; 32 import org.junit.jupiter.params.provider.MethodSource; 36 33 import org.openstreetmap.josm.TestUtils; 37 34 import org.openstreetmap.josm.data.Bounds; … … 55 52 * @author Michael Zangl 56 53 */ 57 @RunWith(Parameterized.class)58 54 public class MapCSSRendererTest { 59 55 private static final String TEST_DATA_BASE = "/renderer/"; … … 71 67 public JOSMTestRules test = new JOSMTestRules().preferences().projection(); 72 68 73 private final TestConfig testConfig;74 75 69 // development flag - set to true in order to update all reference images 76 70 private static final boolean UPDATE_ALL = false; … … 81 75 * @return The parameters. 82 76 */ 83 @Parameters(name = "{1}")84 77 public static Collection<Object[]> runs() { 85 78 return Stream.of( … … 169 162 170 163 /** 164 * Run the test using {@code testConfig} 171 165 * @param testConfig The config to use for this test. 172 166 * @param ignored The name to print it nicely 167 * @throws Exception if an error occurs 173 168 */ 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. 185 174 String javaHome = System.getProperty("java.home"); 186 175 assumeTrue(javaHome != null && javaHome.toLowerCase(Locale.ENGLISH).contains("openjdk"), "Test requires openJDK"); … … 190 179 assumeTrue(fonts.contains(font), "Test requires font: " + font); 191 180 } 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 200 182 // Force reset of preferences 201 183 StyledMapRenderer.PREFERENCE_ANTIALIASING_USE.put(true);
Note:
See TracChangeset
for help on using the changeset viewer.