diff options
author | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2014-08-12 21:56:44 +0200 |
commit | ea346a785dc1b3f7c156f6fc33da634e1f1a627b (patch) | |
tree | af67530553d20b6e82ad60fd79593e9c4abf5565 /misc/openlayers/tests/Format/WMSDescribeLayer.html | |
parent | 59741cd535c47f25971bf8c32b25da25ceadc6d5 (diff) | |
download | postrunner-ea346a785dc1b3f7c156f6fc33da634e1f1a627b.zip |
Adding jquery, flot and openlayers to be included with the GEM.v0.0.4
Diffstat (limited to 'misc/openlayers/tests/Format/WMSDescribeLayer.html')
-rw-r--r-- | misc/openlayers/tests/Format/WMSDescribeLayer.html | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/misc/openlayers/tests/Format/WMSDescribeLayer.html b/misc/openlayers/tests/Format/WMSDescribeLayer.html new file mode 100644 index 0000000..7a53269 --- /dev/null +++ b/misc/openlayers/tests/Format/WMSDescribeLayer.html @@ -0,0 +1,65 @@ +<html> +<head> + <script src="../OLLoader.js"></script> + <script type="text/javascript"> + + function test_read_WMSDescribeLayer(t) { + t.plan(10); + + var parser = new OpenLayers.Format.WMSDescribeLayer(); + + var text = + '<WMS_DescribeLayerResponse version="1.1.1">' + + ' <LayerDescription name="topp:states" wfs="http://geo.openplans.org:80/geoserver/wfs/WfsDispatcher?">' + + ' <Query typeName="topp:states"/>' + + ' </LayerDescription>' + + '</WMS_DescribeLayerResponse>'; + + var res = parser.read(text); + + t.eq(res.layerDescriptions.length, 1, + "Only one LayerDescription in data, so only one parsed"); + + t.eq(res.layerDescriptions[0].owsType, "WFS", + "Properly parses owsType as WFS"); + + t.eq(res.layerDescriptions[0].owsURL, "http://geo.openplans.org:80/geoserver/wfs/WfsDispatcher?", + "Properly parses owsURL"); + + t.eq(res.layerDescriptions[0].typeName, "topp:states", + "Properly parses typeName"); + + t.eq(res.layerDescriptions[0].layerName, "topp:states", + "Properly parses name"); + + //TODO remove the 5 tests below when we deprecate the old structure + t.eq(res.length, 1, + "Only one LayerDescription in data, so only one parsed"); + t.eq(res[0].owsType, "WFS", + "Properly parses owsType as WFS"); + t.eq(res[0].owsURL, "http://geo.openplans.org:80/geoserver/wfs/WfsDispatcher?", + "Properly parses owsURL"); + t.eq(res[0].typeName, "topp:states", + "Properly parses typeName"); + t.eq(res[0].layerName, "topp:states", + "Properly parses name"); + + } + + function test_read_exception(t) { + t.plan(1); + var text = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' + + '<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd">' + + '<ServiceExceptionReport version="1.1.1" > <ServiceException code="LayerNotDefined">' + + 'geonode:_map_107_annotations: no such layer on this server' + + '</ServiceException></ServiceExceptionReport>'; + var format = new OpenLayers.Format.WMSDescribeLayer(); + var obj = format.read(text); + t.ok(!!obj.error, "Error reported correctly"); + } + + </script> +</head> +<body> +</body> +</html> |