Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
WouterVisscher committed Jul 6, 2020
1 parent d794162 commit 4df0c54
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/wfs200/describefeaturetype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestParseBodyDescribeFeatureType(t *testing.T) {
{Name: xml.Name{Space: "xmlns", Local: "kadastralekaartv4"}, Value: "http://kadastralekaartv4.geonovum.nl"},
{Name: xml.Name{Space: "http://www.w3.org/2001/XMLSchema-instance", Local: "schemaLocation"}, Value: "http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://inspire.ec.europa.eu/schemas/inspire_dls/1.0 http://inspire.ec.europa.eu/schemas/inspire_dls/1.0/inspire_dls.xsd http://inspire.ec.europa.eu/schemas/common/1.0 http://inspire.ec.europa.eu/schemas/common/1.0/common.xsd"}}}}},
// Unknown XML document
1: {Body: []byte("<Unknown/>"), Error: &WFSException{ExceptionText: "expected element type <DescribeFeatureType> but have <Unknown>"}},
1: {Body: []byte("<Unknown/>"), Error: &WFSException{ExceptionText: "This service does not know the operation: expected element type <DescribeFeatureType> but have <Unknown>"}},
// no XML document
2: {Body: []byte("no XML document, just a string"), Error: &WFSException{ExceptionText: "Could not process XML, is it XML?"}},
// document at all
Expand Down
2 changes: 1 addition & 1 deletion pkg/wfs200/exception.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (r WFSExceptionReport) Report(errors []ows.Exception) []byte {
r.Xsi = `http://www.w3.org/2001/XMLSchema-instance`
r.Version = Version
r.Language = `en`
r.Exception = err
r.Exception = errors

si, _ := xml.MarshalIndent(r, "", " ")
return append([]byte(xml.Header), si...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/wfs200/getcapabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestParseBodyGetCapabilities(t *testing.T) {
{Name: xml.Name{Space: "xmlns", Local: "kadastralekaartv4"}, Value: "http://kadastralekaartv4.geonovum.nl"},
{Name: xml.Name{Space: "http://www.w3.org/2001/XMLSchema-instance", Local: "schemaLocation"}, Value: "http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://inspire.ec.europa.eu/schemas/inspire_dls/1.0 http://inspire.ec.europa.eu/schemas/inspire_dls/1.0/inspire_dls.xsd http://inspire.ec.europa.eu/schemas/common/1.0 http://inspire.ec.europa.eu/schemas/common/1.0/common.xsd"}}}},
// Unknown XML document
1: {Body: []byte("<Unknown/>"), Error: &WFSException{ExceptionText: "expected element type <GetCapabilities> but have <Unknown>"}},
1: {Body: []byte("<Unknown/>"), Error: &WFSException{ExceptionText: "This service does not know the operation: expected element type <GetCapabilities> but have <Unknown>"}},
// no XML document
2: {Body: []byte("no XML document, just a string"), Error: &WFSException{ExceptionText: "Could not process XML, is it XML?"}},
// document at all
Expand Down
2 changes: 1 addition & 1 deletion pkg/wms130/exception.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type WMSServiceExceptionReport struct {

// Report returns WMSServiceExceptionReport
func (r WMSServiceExceptionReport) Report(errors []ows.Exception) []byte {
r.ServiceException = err
r.ServiceException = errors
si, _ := xml.MarshalIndent(r, "", " ")
return append([]byte(xml.Header), si...)
}
Expand Down

0 comments on commit 4df0c54

Please sign in to comment.