01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.requests.wms;
06:
07: import com.meterware.httpunit.GetMethodWebRequest;
08: import com.meterware.httpunit.WebConversation;
09: import com.meterware.httpunit.WebRequest;
10: import com.meterware.httpunit.WebResponse;
11: import org.apache.xerces.parsers.DOMParser;
12: import org.vfny.geoserver.AbstractGeoserverHttpTest;
13: import org.w3c.dom.Element;
14: import org.xml.sax.InputSource;
15:
16: public class CapabiltiesTestHttp extends AbstractGeoserverHttpTest {
17: public void testGetCapabilities() throws Exception {
18: if (isOffline()) {
19: return;
20: }
21:
22: WebConversation conversation = new WebConversation();
23: WebRequest request = new GetMethodWebRequest(getBaseUrl()
24: + "/wms?request=getCapabilities");
25:
26: WebResponse response = conversation.getResponse(request);
27: DOMParser parser = new DOMParser();
28: parser.parse(new InputSource(response.getInputStream()));
29:
30: Element e = parser.getDocument().getDocumentElement();
31: assertEquals("WMT_MS_Capabilities", e.getLocalName());
32: }
33: }
|