error handling in WFSDescribeFeatureType format

This commit is contained in:
Bart van den Eijnden
2012-03-30 23:04:03 +02:00
parent 9a5364f309
commit 2e83863e90
2 changed files with 23 additions and 2 deletions

View File

@@ -374,8 +374,24 @@
// GeoServer example above
}
function test_read_exception(t) {
t.plan(1);
var text =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<ows:ExceptionReport version="1.0.0"' +
' xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"' +
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">' +
' <ows:Exception exceptionCode="NoApplicableCode">' +
' <ows:ExceptionText>Could not find type: {http://geonode.org/}_map_4_annotations</ows:ExceptionText>' +
' </ows:Exception>' +
'</ows:ExceptionReport>';
var format = new OpenLayers.Format.WFSDescribeFeatureType();
var obj = format.read(text);
t.ok(!!obj.error, "Error reported correctly");
}
</script>
</head>
<body>
</body>
</html>
</html>