Merge pull request #378 from bartvde/wfsdft
error handling in WFSDescribeFeatureType format (r=@ahocevar,elemoine)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user