Changeset 17276 in josm for trunk/test/functional/org
- Timestamp:
- 2020-10-28T22:46:55+01:00 (4 years ago)
- Location:
- trunk/test/functional/org/openstreetmap/josm
- Files:
-
- 2 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); -
trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r17275 r17276 23 23 import java.util.Random; 24 24 import java.util.TreeSet; 25 import java.util.concurrent.TimeUnit; 25 26 import java.util.logging.Logger; 26 27 … … 28 29 import org.junit.jupiter.api.BeforeEach; 29 30 import org.junit.jupiter.api.Test; 31 import org.junit.jupiter.api.Timeout; 30 32 import org.junit.jupiter.api.extension.RegisterExtension; 31 import org.junit.rules.Timeout;32 33 import org.openstreetmap.josm.JOSMFixture; 33 34 import org.openstreetmap.josm.TestUtils; … … 51 52 */ 52 53 @SuppressFBWarnings(value = "CRLF_INJECTION_LOGS") 54 @Timeout(value = 60, unit = TimeUnit.SECONDS) 53 55 class MultiFetchServerObjectReaderTest { 54 56 private static final Logger logger = Logger.getLogger(MultiFetchServerObjectReader.class.getName()); … … 60 62 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 61 63 public JOSMTestRules test = new JOSMTestRules().preferences(); 62 63 /**64 * Global timeout applied to all test methods.65 */66 @RegisterExtension67 public Timeout globalTimeout = Timeout.seconds(60);68 64 69 65 /**
Note:
See TracChangeset
for help on using the changeset viewer.