Changeset 12224 in josm for trunk/test


Ignore:
Timestamp:
2017-05-21T17:56:42+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #14825 - Support WMTS Dimensions

Location:
trunk/test
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java

    r11257 r12224  
    3636    private ImageryInfo testImageryWALLONIE = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Wallonie.xml");
    3737    private ImageryInfo testImageryOntario = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Ontario.xml");
     38    private ImageryInfo testImageryGeoAdminCh = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-GeoAdminCh.xml");
    3839    private ImageryInfo testImagery12168 = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12168-WMTSCapabilities.xml");
    3940    private ImageryInfo testLotsOfLayers = getImagery(TestUtils.getTestDataRoot() + "wmts/getCapabilities-lots-of-layers.xml");
     
    245246        WMTSTileSource testSource = new WMTSTileSource(testLotsOfLayers);
    246247        testSource.initProjection(Main.getProjection());
    247 
    248248    }
    249249
     
    279279                "http://188.253.0.155:6080/arcgis/rest/services/Mashhad_BaseMap_1/MapServer/WMTS/tile/1.0.0/Mashhad_BaseMap_1"
    280280                        + "/default/default028mm/1/3/2",
     281                testSource.getTileUrl(1, 2, 3)
     282                );
     283    }
     284
     285    /**
     286     * Test WMTS dimension.
     287     * @throws IOException if any I/O error occurs
     288     */
     289    @Test
     290    public void testDimension() throws IOException {
     291        Main.setProjection(Projections.getProjectionByCode("EPSG:21781"));
     292        ImageryInfo info = new ImageryInfo(testImageryGeoAdminCh);
     293        Collection<DefaultLayer> defaultLayers = new ArrayList<>(1);
     294        defaultLayers.add(new WMTSDefaultLayer("ch.are.agglomerationen_isolierte_staedte", "21781_26"));
     295        info.setDefaultLayers(defaultLayers);
     296        WMTSTileSource testSource = new WMTSTileSource(info);
     297        testSource.initProjection(Main.getProjection());
     298        assertEquals(
     299                "http://wmts.geo.admin.ch/1.0.0/ch.are.agglomerationen_isolierte_staedte/default/20140101/21781/1/3/2.png",
    281300                testSource.getTileUrl(1, 2, 3)
    282301                );
Note: See TracChangeset for help on using the changeset viewer.