// @Test public void testWmsUrlTransformer4GetLegend() { initialize(); // No Spring in a GWT unit test. String getLegendUrl = wmsService.getLegendGraphicUrl(wmsConfig); // assertEquals(VALUE_URL, getLegendUrl.substring(0, getLegendUrl.indexOf('?'))); // assertTrue(hasParameter(getLegendUrl, "service", "WMS")); wmsService.setWmsUrlTransformer(toHelloWorld); getLegendUrl = wmsService.getLegendGraphicUrl(wmsConfig); // assertEquals(URL.encode(HELLOWORLD), getLegendUrl); }
// @Test public void testWmsUrlTransformer4GetMap() { initialize(); // No Spring in a GWT unit test. // assertNull(wmsService.getWmsUrlTransformer()); String getLegendUrl = wmsService.getLegendGraphicUrl(wmsConfig); // assertEquals(VALUE_URL, getLegendUrl.substring(0, getLegendUrl.indexOf('?'))); // assertTrue(hasParameter(getLegendUrl, "service", "WMS")); wmsService.setWmsUrlTransformer(toHelloWorld); Bbox bounds = new Bbox(0, 1, 100, 100); String getMapUrl = wmsService.getMapUrl(wmsConfig, VALUE_CRS2, bounds, VALUE_SIZE, VALUE_SIZE); // assertEquals(URL.encode(HELLOWORLD), getMapUrl); }
// @Test public void testGetLegendUrl() { initialize(); // No Spring in a GWT unit test. String getLegendUrl = wmsService.getLegendGraphicUrl(wmsConfig); // assertEquals(VALUE_URL, getLegendUrl.substring(0, getLegendUrl.indexOf('?'))); // assertTrue(hasParameter(getLegendUrl, "service", "WMS")); // assertTrue(hasParameter(getLegendUrl, "layer", wmsConfig.getLayers())); // assertTrue(hasParameter(getLegendUrl, "request", "GetLegendGraphic")); // assertTrue(hasParameter(getLegendUrl, "format", wmsConfig.getFormat())); // assertTrue(hasParameter(getLegendUrl, "width", wmsConfig.getLegendConfig().getIconWidth() + // "")); // assertTrue(hasParameter(getLegendUrl, "height", wmsConfig.getLegendConfig().getIconHeight() // + "")); }
// @Test public void testGetMapUrlInvertedAxis() { initialize(); // No Spring in a GWT unit test. Bbox bounds = new Bbox(0, 1, 100, 100); String getMapUrl = wmsService.getMapUrl(wmsConfig, VALUE_CRS, bounds, VALUE_SIZE, VALUE_SIZE); // assertEquals(VALUE_URL, getMapUrl.substring(0, getMapUrl.indexOf('?'))); // assertTrue(hasParameter(getMapUrl, "service", "WMS")); // assertTrue(hasParameter(getMapUrl, "layers", wmsConfig.getLayers())); // assertTrue(hasParameter(getMapUrl, "width", VALUE_SIZE + "")); // assertTrue(hasParameter(getMapUrl, "height", VALUE_SIZE + "")); // assertTrue(hasParameter(getMapUrl, "bbox", "1.0,0.0,101.0,100.0")); // assertTrue(hasParameter(getMapUrl, "format", wmsConfig.getFormat())); // assertTrue(hasParameter(getMapUrl, "version", wmsConfig.getVersion().toString())); // assertTrue(hasParameter(getMapUrl, "crs", VALUE_CRS)); // assertTrue(hasParameter(getMapUrl, "styles", wmsConfig.getStyles())); // assertTrue(hasParameter(getMapUrl, "transparent", wmsConfig.isTransparent() + "")); // assertTrue(hasParameter(getMapUrl, "request", "GetMap")); }
// @Test public void testWmsUrlTransformer1() { initialize(); // No Spring in a GWT unit test. // assertNull(wmsService.getWmsUrlTransformer()); wmsService.setWmsUrlTransformer(toHelloWorld); // assertEquals(toHelloWorld, wmsService.getWmsUrlTransformer()); }