Changeset 18690 in josm for trunk/test/functional/org
- Timestamp:
- 2023-03-13T21:59:27+01:00 (2 years ago)
- Location:
- trunk/test/functional/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r18203 r18690 16 16 import java.io.PrintWriter; 17 17 import java.nio.charset.StandardCharsets; 18 import java.nio.file.Files; 18 19 import java.security.SecureRandom; 19 20 import java.text.MessageFormat; … … 52 53 */ 53 54 @SuppressFBWarnings(value = "CRLF_INJECTION_LOGS") 54 @Timeout(value = 60, unit = TimeUnit.SECONDS)55 @Timeout(value = 1, unit = TimeUnit.MINUTES) 55 56 class MultiFetchServerObjectReaderTest { 56 57 private static final Logger logger = Logger.getLogger(MultiFetchServerObjectReader.class.getName()); … … 191 192 try ( 192 193 PrintWriter pw = new PrintWriter( 193 new OutputStreamWriter( new FileOutputStream(dataSetCacheOutputFile), StandardCharsets.UTF_8)194 new OutputStreamWriter(Files.newOutputStream(dataSetCacheOutputFile.toPath()), StandardCharsets.UTF_8) 194 195 )) { 195 196 logger.info(MessageFormat.format("caching test data set in ''{0}'' ...", dataSetCacheOutputFile.toString())); -
trunk/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java
r18437 r18690 240 240 void testTooMuchRedirects() throws IOException { 241 241 mockRedirects(false, 3); 242 assertThrows(IOException.class, () -> HttpClient.create(url("/relative-redirect/3")).setMaxRedirects(2).connect(progress)); 242 final HttpClient client = HttpClient.create(url("/relative-redirect/3")).setMaxRedirects(2); 243 try { 244 assertThrows(IOException.class, () -> client.connect(progress)); 245 } finally { 246 client.disconnect(); 247 } 243 248 } 244 249 … … 370 375 void testTakesTooLong() throws IOException { 371 376 mockDelay(1); 372 assertThrows(IOException.class, () -> HttpClient.create(url("/delay/1")).setReadTimeout(500).connect(progress)); 377 final HttpClient client = HttpClient.create(url("/delay/1")).setReadTimeout(500); 378 try { 379 assertThrows(IOException.class, () -> client.connect(progress)); 380 } finally { 381 client.disconnect(); 382 } 373 383 } 374 384 … … 387 397 388 398 /** 389 * Test of {@link Response#uncompress} method with Gzip compression. 399 * Test of {@link Response#uncompress(boolean)} method with Gzip compression. 390 400 * @throws IOException if any I/O error occurs 391 401 */ … … 407 417 408 418 /** 409 * Test of {@link Response#uncompress} method with Bzip compression. 419 * Test of {@link Response#uncompress(boolean)} method with Bzip compression. 410 420 * @throws IOException if any I/O error occurs 411 421 */ … … 427 437 428 438 /** 429 * Test of {@link Response#uncompress} method with Bzip compression. 439 * Test of {@link Response#uncompress(boolean)} method with Bzip compression. 430 440 * @throws IOException if any I/O error occurs 431 441 */
Note:
See TracChangeset
for help on using the changeset viewer.