Changeset 36433 in osm for applications/viewer/jmapviewer/test
- Timestamp:
- 2025-04-25T18:34:30+02:00 (8 months ago)
- Location:
- applications/viewer/jmapviewer
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
test/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSourceTest.java (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer
-
Property ReleaseVersion
changed from
2.24to2.25
-
Property ReleaseVersion
changed from
-
applications/viewer/jmapviewer/test/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSourceTest.java
r36223 r36433 30 30 * triple of: 31 31 * * baseUrl 32 * * expected tile url for zoom= 1, x=2, y=332 * * expected tile url for zoom=4, x=5, y=6 33 33 * * expected tile url for zoom=3, x=2, y=1 34 34 */ … … 39 39 new String[] { 40 40 "http://imagico.de/map/osmim_tiles.php?layer=S2A_R136_N41_20150831T093006&z={zoom}&x={x}&y={-y}", 41 "http://imagico.de/map/osmim_tiles.php?layer=S2A_R136_N41_20150831T093006&z= 1&x=2&y=-2",41 "http://imagico.de/map/osmim_tiles.php?layer=S2A_R136_N41_20150831T093006&z=4&x=5&y=9", 42 42 "http://imagico.de/map/osmim_tiles.php?layer=S2A_R136_N41_20150831T093006&z=3&x=2&y=6" 43 43 } … … 51 51 checkGetTileUrl( 52 52 "http://localhost/{z}/{x}/{y}", 53 "http://localhost/ 1/2/3",53 "http://localhost/4/5/6", 54 54 "http://localhost/3/1/2" 55 55 ); … … 63 63 checkGetTileUrl( 64 64 "http://localhost/{zoom+5}/{x}/{y}", 65 "http://localhost/ 6/2/3",65 "http://localhost/9/5/6", 66 66 "http://localhost/8/1/2" 67 67 ); … … 75 75 checkGetTileUrl( 76 76 "http://localhost/{zoom-5}/{x}/{y}", 77 "http://localhost/- 4/2/3",77 "http://localhost/-1/5/6", 78 78 "http://localhost/-2/1/2" 79 79 ); … … 87 87 checkGetTileUrl( 88 88 "http://localhost/{5-zoom}/{x}/{y}", 89 "http://localhost/ 4/2/3",89 "http://localhost/1/5/6", 90 90 "http://localhost/2/1/2" 91 91 ); … … 99 99 checkGetTileUrl( 100 100 "http://localhost/{10-zoom-5}/{x}/{y}", 101 "http://localhost/ 4/2/3",101 "http://localhost/1/5/6", 102 102 "http://localhost/2/1/2" 103 103 ); … … 112 112 TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", "http://localhost/{zoom}/{x}/{y}?token={apikey}&foo=bar", "id1"); 113 113 TemplatedTMSTileSource ts = new TemplatedTMSTileSource(testImageryTMS); 114 assertEquals("http://localhost/ 1/2/3?token=wololo&foo=bar", ts.getTileUrl(1, 2, 3));114 assertEquals("http://localhost/4/5/6?token=wololo&foo=bar", ts.getTileUrl(4, 5, 6)); 115 115 } 116 116 … … 161 161 checkGetTileUrl( 162 162 "http://localhost/{z}/{x}/{!y}", 163 "http://localhost/ 1/2/-3",163 "http://localhost/4/5/1", 164 164 "http://localhost/3/1/1" 165 165 ); … … 171 171 checkGetTileUrl( 172 172 "http://localhost/{z}/{x}/{-y}", 173 "http://localhost/ 1/2/-2",173 "http://localhost/4/5/9", 174 174 "http://localhost/3/1/5" 175 ); 176 177 } 178 179 @Test 180 void testGetTileUrl_quad() { 181 checkGetTileUrl( 182 "http://localhost/{quad}", 183 "http://localhost/0321", 184 "http://localhost/021" 175 185 ); 176 186 … … 180 190 TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", url, "id1"); 181 191 TemplatedTMSTileSource ts = new TemplatedTMSTileSource(testImageryTMS); 182 assertEquals(expected123, ts.getTileUrl( 1, 2, 3));192 assertEquals(expected123, ts.getTileUrl(4, 5, 6)); 183 193 assertEquals(expected312, ts.getTileUrl(3, 1, 2)); 184 194 } … … 192 202 TileSourceInfo testImageryTMS = new TileSourceInfo("test imagery", test[0], "id1"); 193 203 TemplatedTMSTileSource ts = new TemplatedTMSTileSource(testImageryTMS); 194 assertEquals(test[1], ts.getTileUrl( 1, 2, 3));204 assertEquals(test[1], ts.getTileUrl(4, 5, 6)); 195 205 assertEquals(test[2], ts.getTileUrl(3, 2, 1)); 196 206 } … … 202 212 TemplatedTMSTileSource ts = new TemplatedTMSTileSource(testImageryTMS); 203 213 System.out.println(MessageFormat.format("new String[]{\"{0}\", \"{1}\", \"{2}\"},", 204 url, ts.getTileUrl( 1, 2, 3), ts.getTileUrl(3, 2, 1)));214 url, ts.getTileUrl(4, 5, 6), ts.getTileUrl(3, 2, 1))); 205 215 } 206 216 }
Note:
See TracChangeset
for help on using the changeset viewer.
