Changeset 9902 in josm for trunk/test


Ignore:
Timestamp:
2016-02-29T21:25:53+01:00 (9 years ago)
Author:
wiktorn
Message:

Final fix for #12573 - WMTS getCapabilities parser error.

Unit tests for case in #12573 and some edge case. Fix for edge case.

Closes: #12573

Location:
trunk/test
Files:
2 added
1 edited

Legend:

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

    r9820 r9902  
    3333    private ImageryInfo testImagery12168 = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12168-WMTSCapabilities.xml");
    3434    private ImageryInfo testLotsOfLayers = getImagery(TestUtils.getTestDataRoot() + "wmts/getCapabilities-lots-of-layers.xml");
     35    private ImageryInfo testDuplicateTags = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12573-wmts-identifier.xml");
     36    private ImageryInfo testMissingStyleIdentifer = getImagery(TestUtils.getTestDataRoot() + "wmts/bug12573-wmts-missing-style-identifier.xml");
    3537
    3638    /**
     
    243245    }
    244246
     247    @Test
     248    public void testPraserForDuplicateTags() throws Exception {
     249        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
     250        WMTSTileSource testSource = new WMTSTileSource(testDuplicateTags);
     251        testSource.initProjection(Main.getProjection());
     252        assertEquals(
     253                "http://tile.informatievlaanderen.be/ws/raadpleegdiensten/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=grb_bsk&"
     254                        + "STYLE=&FORMAT=image/png&tileMatrixSet=GoogleMapsVL&tileMatrix=1&tileRow=1&tileCol=1",
     255                testSource.getTileUrl(1, 1, 1)
     256                );
     257    }
     258
     259    @Test
     260    public void testPraserForMissingStyleIdentifier() throws Exception {
     261        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
     262        WMTSTileSource testSource = new WMTSTileSource(testMissingStyleIdentifer);
     263        testSource.initProjection(Main.getProjection());
     264    }
     265
    245266    private void verifyTile(LatLon expected, WMTSTileSource source, int x, int y, int z) {
    246267        LatLon ll = new LatLon(source.tileXYToLatLon(x, y, z));
Note: See TracChangeset for help on using the changeset viewer.