Changeset 16734 in josm for trunk/test/unit


Ignore:
Timestamp:
2020-07-06T17:44:17+02:00 (4 years ago)
Author:
simon04
Message:

fix #19483 - Remote control /imagery: parse extended URL (parse imagery type from URL)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java

    r16618 r16734  
    104104        assertEquals("XA", imageryInfo.getCountryCode());
    105105    }
     106
     107    /**
     108     * Non-regression test for bug #19483.
     109     * @throws Exception if any error occurs
     110     */
     111    @Test
     112    public void testTicket19483() throws Exception {
     113        String url = "https://localhost/imagery?url=" +
     114                "tms[3-7]%3Ahttps%3A%2F%2Fservices.digitalglobe.com%2Fearthservice%2Ftmsaccess%2F" +
     115                "tms%2F1.0.0%2FDigitalGlobe%3AImageryTileService%40EPSG%3A3857%40jpg%2F%7Bz%7D%2F%7Bx%7D%2F%7B-y%7D.jpg%3F" +
     116                "connectId%3D0123456789";
     117        ImageryInfo imageryInfo = newHandler(url).buildImageryInfo();
     118        assertEquals(ImageryInfo.ImageryType.TMS, imageryInfo.getImageryType());
     119        assertEquals("https://services.digitalglobe.com/earthservice/tmsaccess/tms/1.0.0/DigitalGlobe:ImageryTileService" +
     120                "@EPSG:3857@jpg/{z}/{x}/{-y}.jpg?connectId=0123456789", imageryInfo.getUrl());
     121        assertEquals("tms[3,7]:https://services.digitalglobe.com/earthservice/tmsaccess/tms/1.0.0/DigitalGlobe:ImageryTileService" +
     122                "@EPSG:3857@jpg/{z}/{x}/{-y}.jpg?connectId=0123456789", imageryInfo.getExtendedUrl());
     123        assertEquals(3, imageryInfo.getMinZoom());
     124        assertEquals(7, imageryInfo.getMaxZoom());
     125    }
    106126}
Note: See TracChangeset for help on using the changeset viewer.