Changeset 16588 in josm for trunk/test/unit
- Timestamp:
- 2020-06-09T23:44:53+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java
r14138 r16588 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.io.remotecontrol.handler; 3 4 import static org.junit.Assert.assertEquals; 3 5 4 6 import org.junit.Rule; 5 7 import org.junit.Test; 6 8 import org.junit.rules.ExpectedException; 9 import org.openstreetmap.josm.data.imagery.ImageryInfo; 7 10 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException; 8 11 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 76 79 newHandler("https://localhost?url=foo").handle(); 77 80 } 81 82 /** 83 * Unit test for {@link ImageryHandler#buildImageryInfo()} 84 * @throws Exception if any error occurs 85 */ 86 @Test 87 public void testBuildImageryInfo() throws Exception { 88 String url = "https://localhost/imagery?title=osm" 89 + "&type=tms&min_zoom=3&max_zoom=23" 90 + "&url=https://a.tile.openstreetmap.org/%7Bzoom%7D/%7Bx%7D/%7By%7D.png"; 91 ImageryInfo imageryInfo = newHandler(url).buildImageryInfo(); 92 assertEquals("osm", imageryInfo.getName()); 93 assertEquals(ImageryInfo.ImageryType.TMS, imageryInfo.getImageryType()); 94 assertEquals("https://a.tile.openstreetmap.org/{zoom}/{x}/{y}.png", imageryInfo.getUrl()); 95 assertEquals(3, imageryInfo.getMinZoom()); 96 assertEquals(23, imageryInfo.getMaxZoom()); 97 } 78 98 }
Note:
See TracChangeset
for help on using the changeset viewer.