Changeset 9174 in josm for trunk/test/unit/org/openstreetmap/josm/tools
- Timestamp:
- 2015-12-27T00:07:00+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
r8857 r9174 86 86 public void testOpenUrlGzip() throws IOException { 87 87 Main.initApplicationPreferences(); 88 try (BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/1613906/data"), true)) { 88 final URL url = new URL("https://www.openstreetmap.org/trace/1613906/data"); 89 try (BufferedReader x = HttpClient.create(url).connect().uncompress(true).getContentReader()) { 89 90 Assert.assertTrue(x.readLine().startsWith("<?xml version=")); 90 91 } … … 98 99 public void testOpenUrlBzip() throws IOException { 99 100 Main.initApplicationPreferences(); 100 try (BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/785544/data"), true)) { 101 final URL url = new URL("https://www.openstreetmap.org/trace/785544/data"); 102 try (BufferedReader x = HttpClient.create(url).connect().uncompress(true).getContentReader()) { 103 Assert.assertTrue(x.readLine().startsWith("<?xml version=")); 104 } 105 } 106 107 /** 108 * Test of {@link Utils#openURLReaderAndDecompress} method with Bzip compression. 109 * @throws IOException if any I/O error occurs 110 */ 111 @Test 112 public void testTicket9660() throws IOException { 113 Main.initApplicationPreferences(); 114 final URL url = new URL("http://www.openstreetmap.org/trace/1350010/data"); 115 try (BufferedReader x = HttpClient.create(url).connect() 116 .uncompress(true).uncompressAccordingToContentDisposition(true).getContentReader()) { 101 117 Assert.assertTrue(x.readLine().startsWith("<?xml version=")); 102 118 }
Note:
See TracChangeset
for help on using the changeset viewer.