Ticket #426: geoext-426.patch

File geoext-426.patch, 2.5 KB (added by bartvde, 6 years ago)
  • tests/lib/GeoExt/data/WMSCapabilitiesReader.html

     
    3131                 fields.items[3].name == 'bar',
    3232                 'field values set from configuration are correct');
    3333        }
     34
     35        function test_read_exception(t) {
     36            t.plan(1);
     37            var reader = new GeoExt.data.WMSCapabilitiesReader({}, []);
     38            try {
     39                var records = reader.read({responseXML: exceptionsDoc});
     40            } catch(e) {
     41                t.ok(true, "Exception thrown when getting a service exception");
     42            }
     43        }
     44
    3445        function test_read(t) {
    3546            t.plan(40);
    3647
  • tests/lib/GeoExt/data/WMSCapabilitiesReader.js

     
     1var exception = [];
     2exception.push('<?xml version="1.0" encoding="UTF-8" standalone="no" ?>',
     3'<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd">',
     4'<ServiceExceptionReport version="1.1.1"><ServiceException> Plain text message about an error. </ServiceException>',
     5'</ServiceExceptionReport>');
     6var exceptionsDoc = (new OpenLayers.Format.XML()).read(exception.join(" "));
     7
    18var wmscaps = [];
    29wmscaps.push('<?xml version="1.0" encoding="UTF-8"?>' ,
    310    '<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd">' ,
     
    47824789      '</Capability>' ,
    47834790    '</WMT_MS_Capabilities>'
    47844791);
    4785 var doc = (new OpenLayers.Format.XML).read(wmscaps.join(" "));
     4792var doc = (new OpenLayers.Format.XML()).read(wmscaps.join(" "));
  • lib/GeoExt/data/WMSCapabilitiesReader.js

     
    165165        if(typeof data === "string" || data.nodeType) {
    166166            data = this.meta.format.read(data);
    167167        }
     168        if (!!data.error) {
     169            throw new Ext.data.DataReader.Error("invalid-response", data.error);
     170        }
    168171        var version = data.version;
    169172        var capability = data.capability || {};
    170173        var url = capability.request && capability.request.getmap &&