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.wms.responses.map.kml;
06:
07: import junit.framework.TestCase;
08:
09: public class KMLWriterTest extends TestCase {
10: public void testIntToHex() {
11: /*
12: * String result = KMLWriter.intToHex(0); assertTrue(
13: * result.equals("00")); // make sure that the zeros are prefixed
14: *
15: * result = KMLWriter.intToHex(90); assertTrue( result.equals("5a"));
16: */
17: }
18:
19: /*
20: * public void testSimpleRequest() throws Exception{ WebConversation
21: * conversation = new WebConversation(); String requestParams =
22: * "bbox=-130,24,-66,50&"+ "styles=population&"+ "request=GetMap&"+
23: * "layers=topp:states&"+ "width=550&height=250&"+ "srs=EPSG:4326&"+
24: * "Format=kml";
25: *
26: * WebRequest request = new
27: * GetMethodWebRequest(getBaseUrl()+"/wms?"+requestParams);
28: *
29: * WebResponse response = conversation.getResponse( request );
30: * assertNotNull(response);
31: *
32: * DOMParser parser = new DOMParser(); parser.parse(new
33: * InputSource(response.getInputStream()));
34: *
35: * Element e = parser.getDocument().getDocumentElement();
36: * //System.out.println(e.getLocalName()); assertEquals("kml",
37: * e.getLocalName()); }
38: *
39: * public void testRasterRequest() throws Exception{ WebConversation
40: * conversation = new WebConversation(); String requestParams =
41: * "bbox=-130,24,-66,50&"+ "styles=population&"+ "request=GetMap&"+
42: * "layers=topp:states&"+ "width=550&height=250&"+ "srs=EPSG:4326&"+
43: * "Format=kmz"+ "KMSCORE=0"; // set tolerance to zero. Guaranteed raster
44: * result
45: *
46: * WebRequest request = new
47: * GetMethodWebRequest(getBaseUrl()+"/wms?"+requestParams);
48: *
49: * WebResponse response = conversation.getResponse( request );
50: * assertNotNull(response); //System.out.println(response.getContentType());
51: * assertEquals("application/vnd.google-earth.kmz",response.getContentType());
52: * ZipInputStream z = new ZipInputStream(response.getInputStream());
53: * ZipEntry entry = z.getNextEntry(); //System.out.println(entry.getName());
54: * assertEquals("wms.kml", entry.getName()); }
55: */
56: }
|