01: package org.vfny.geoserver.wms.responses.map.svg;
02:
03: import org.geoserver.data.test.MockData;
04: import org.geoserver.wms.WMSTestSupport;
05: import org.vfny.geoserver.config.WMSConfig;
06: import org.w3c.dom.Document;
07:
08: public class SVGTest extends WMSTestSupport {
09:
10: public void testBasicSvgGenerator() throws Exception {
11: getWMS().setSvgRenderer(WMSConfig.SVG_SIMPLE);
12: Document doc = getAsDOM("wms?request=getmap&service=wms&version=1.1.1"
13: + "&format="
14: + SvgMapProducerFactory.MIME_TYPE
15: + "&layers="
16: + MockData.BASIC_POLYGONS.getPrefix()
17: + ":"
18: + MockData.BASIC_POLYGONS.getLocalPart()
19: + "&styles="
20: + MockData.BASIC_POLYGONS.getLocalPart()
21: + "&height=1024&width=1024&bbox=-180,-90,180,90&srs=EPSG:4326"
22: + "&featureid=BasicPolygons.1107531493643");
23: // print(doc);
24:
25: assertEquals(1, doc.getElementsByTagName("svg").getLength());
26: assertEquals(1, doc.getElementsByTagName("g").getLength());
27: }
28:
29: public void testBatikSvgGenerator() throws Exception {
30: getWMS().setSvgRenderer(WMSConfig.SVG_BATIK);
31: Document doc = getAsDOM("wms?request=getmap&service=wms&version=1.1.1"
32: + "&format="
33: + SvgMapProducerFactory.MIME_TYPE
34: + "&layers="
35: + MockData.BASIC_POLYGONS.getPrefix()
36: + ":"
37: + MockData.BASIC_POLYGONS.getLocalPart()
38: + "&styles="
39: + MockData.BASIC_POLYGONS.getLocalPart()
40: + "&height=1024&width=1024&bbox=-180,-90,180,90&srs=EPSG:4326"
41: + "&featureid=BasicPolygons.1107531493643");
42: // print(doc);
43:
44: assertEquals(1, doc.getElementsByTagName("svg").getLength());
45: assertTrue(doc.getElementsByTagName("g").getLength() > 1);
46: }
47:
48: }
|