01: package org.vfny.geoserver.wms.responses.map.png;
02:
03: import java.net.URL;
04:
05: import javax.servlet.ServletResponse;
06:
07: import org.geoserver.data.test.MockData;
08: import org.geoserver.wms.RemoteOWSTestSupport;
09: import org.geoserver.wms.WMSTestSupport;
10: import org.geoserver.wms.kvp.GetMapKvpRequestReader;
11:
12: public class GetMapTest extends WMSTestSupport {
13:
14: public void testRemoteOWSGet() throws Exception {
15: if (!RemoteOWSTestSupport.isRemoteStatesAvailable())
16: return;
17:
18: ServletResponse response = getAsServletResponse("wms?request=getmap&service=wms&version=1.1.1"
19: + "&format=image/png"
20: + "&layers="
21: + RemoteOWSTestSupport.TOPP_STATES
22: + ","
23: + MockData.BASIC_POLYGONS.getPrefix()
24: + ":"
25: + MockData.BASIC_POLYGONS.getLocalPart()
26: + "&styles=Population,"
27: + MockData.BASIC_POLYGONS.getLocalPart()
28: + "&remote_ows_type=WFS"
29: + "&remote_ows_url="
30: + RemoteOWSTestSupport.WFS_SERVER_URL
31: + "&height=1024&width=1024&bbox=-180,-90,180,90&srs=EPSG:4326");
32:
33: assertEquals("image/png", response.getContentType());
34: }
35:
36: public void testRemoteOWSUserStyleGet() throws Exception {
37: if (!RemoteOWSTestSupport.isRemoteStatesAvailable())
38: return;
39:
40: URL url = GetMapTest.class.getResource("remoteOws.sld");
41:
42: ServletResponse response = getAsServletResponse("wms?request=getmap&service=wms&version=1.1.1"
43: + "&format=image/png"
44: + "&sld="
45: + url.toString()
46: + "&height=1024&width=1024&bbox=-180,-90,180,90&srs=EPSG:4326");
47:
48: assertEquals("image/png", response.getContentType());
49: }
50:
51: }
|