Calling callback in WMS capabilities tests
This commit is contained in:
@@ -11,7 +11,7 @@ describe('ol.parser.ogc.wmscapabilities_v1_0_0', function() {
|
|||||||
var parser = new ol.parser.ogc.WMSCapabilities();
|
var parser = new ol.parser.ogc.WMSCapabilities();
|
||||||
|
|
||||||
describe('test read', function() {
|
describe('test read', function() {
|
||||||
it('Test read', function() {
|
it('Test read', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_0_0.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_0_0.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj;
|
var obj;
|
||||||
@@ -27,6 +27,7 @@ describe('ol.parser.ogc.wmscapabilities_v1_0_0', function() {
|
|||||||
expect(getmap.formats[0]).to.eql('GIF');
|
expect(getmap.formats[0]).to.eql('GIF');
|
||||||
expect(obj.capability.layers[64].keywords.length).to.eql(2);
|
expect(obj.capability.layers[64].keywords.length).to.eql(2);
|
||||||
expect(obj.capability.layers[64].keywords[0].value).to.eql('Geometer');
|
expect(obj.capability.layers[64].keywords[0].value).to.eql('Geometer');
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,18 +5,19 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
var parser = new ol.parser.ogc.WMSCapabilities();
|
var parser = new ol.parser.ogc.WMSCapabilities();
|
||||||
|
|
||||||
describe('test read exception', function() {
|
describe('test read exception', function() {
|
||||||
it('Error reported correctly', function() {
|
it('Error reported correctly', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/' +
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/' +
|
||||||
'exceptionsample.xml';
|
'exceptionsample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj = parser.read(xml);
|
var obj = parser.read(xml);
|
||||||
expect(!!obj.error).to.be.ok();
|
expect(!!obj.error).to.be.ok();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test read', function() {
|
describe('test read', function() {
|
||||||
it('Test read', function() {
|
it('Test read', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, capability, getmap, describelayer, getfeatureinfo, layer;
|
var obj, capability, getmap, describelayer, getfeatureinfo, layer;
|
||||||
@@ -59,12 +60,13 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
expect(layer.styles[0].legend.href).to.eql(legend);
|
expect(layer.styles[0].legend.href).to.eql(legend);
|
||||||
expect(layer.styles[0].legend.format).to.eql('image/png');
|
expect(layer.styles[0].legend.format).to.eql('image/png');
|
||||||
expect(layer.queryable).to.be.ok();
|
expect(layer.queryable).to.be.ok();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test layers', function() {
|
describe('test layers', function() {
|
||||||
it('Test layers', function() {
|
it('Test layers', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
||||||
@@ -110,12 +112,13 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
expect(layers['ozone_image'].fixedHeight).to.eql(256);
|
expect(layers['ozone_image'].fixedHeight).to.eql(256);
|
||||||
expect(layers['ozone_image'].opaque).to.be.ok();
|
expect(layers['ozone_image'].opaque).to.be.ok();
|
||||||
expect(layers['ozone_image'].noSubsets).to.be.ok();
|
expect(layers['ozone_image'].noSubsets).to.be.ok();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test dimensions', function() {
|
describe('test dimensions', function() {
|
||||||
it('Test dimensions', function() {
|
it('Test dimensions', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, capability, layers = {}, time, elevation;
|
var obj, capability, layers = {}, time, elevation;
|
||||||
@@ -137,12 +140,13 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
expect(elevation.multipleVal).to.not.be();
|
expect(elevation.multipleVal).to.not.be();
|
||||||
expect(elevation.values).to.eql(
|
expect(elevation.values).to.eql(
|
||||||
['0', '1000', '3000', '5000', '10000']);
|
['0', '1000', '3000', '5000', '10000']);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test contact info', function() {
|
describe('test contact info', function() {
|
||||||
it('Test contact info', function() {
|
it('Test contact info', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/' +
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/' +
|
||||||
'ogcsample.xml';
|
'ogcsample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
@@ -168,12 +172,13 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
expect(contactinfo.phone).to.eql('+1 301 286-1569');
|
expect(contactinfo.phone).to.eql('+1 301 286-1569');
|
||||||
expect(contactinfo.fax).to.eql('+1 301 286-1777');
|
expect(contactinfo.fax).to.eql('+1 301 286-1777');
|
||||||
expect(contactinfo.email).to.eql('delabeau@iniki.gsfc.nasa.gov');
|
expect(contactinfo.email).to.eql('delabeau@iniki.gsfc.nasa.gov');
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Test fees and constraints', function() {
|
describe('Test fees and constraints', function() {
|
||||||
it('Test fees and constraints', function() {
|
it('Test fees and constraints', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, service;
|
var obj, service;
|
||||||
@@ -181,12 +186,13 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
service = obj.service;
|
service = obj.service;
|
||||||
expect('fees' in service).to.not.be();
|
expect('fees' in service).to.not.be();
|
||||||
expect('accessConstraints' in service).to.not.be();
|
expect('accessConstraints' in service).to.not.be();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Test requests', function() {
|
describe('Test requests', function() {
|
||||||
it('Test requests', function() {
|
it('Test requests', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/gssample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, request, exception, userSymbols;
|
var obj, request, exception, userSymbols;
|
||||||
@@ -208,12 +214,13 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
expect(userSymbols.userLayer).to.be.ok();
|
expect(userSymbols.userLayer).to.be.ok();
|
||||||
expect(userSymbols.userStyle).to.be.ok();
|
expect(userSymbols.userStyle).to.be.ok();
|
||||||
expect(userSymbols.remoteWFS).to.be.ok();
|
expect(userSymbols.remoteWFS).to.be.ok();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test ogc', function() {
|
describe('test ogc', function() {
|
||||||
it('Test ogc', function() {
|
it('Test ogc', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1/ogcsample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, capability, attribution, keywords, metadataURLs;
|
var obj, capability, attribution, keywords, metadataURLs;
|
||||||
@@ -240,6 +247,7 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1', function() {
|
|||||||
expect(Math.round(capability.layers[0].maxScale)).to.eql(1000);
|
expect(Math.round(capability.layers[0].maxScale)).to.eql(1000);
|
||||||
expect(capability.layers[1].minScale).to.be(undefined);
|
expect(capability.layers[1].minScale).to.be(undefined);
|
||||||
expect(capability.layers[1].maxScale).to.be(undefined);
|
expect(capability.layers[1].maxScale).to.be(undefined);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1_wmsc', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('test read', function() {
|
describe('test read', function() {
|
||||||
it('Test read', function() {
|
it('Test read', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/wmsc.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/wmsc.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, tilesets, tileset;
|
var obj, tilesets, tileset;
|
||||||
@@ -35,18 +35,20 @@ describe('ol.parser.ogc.wmscapabilities_v1_1_1_wmsc', function() {
|
|||||||
0.009330691928043961, 0.004665345964021981];
|
0.009330691928043961, 0.004665345964021981];
|
||||||
expect(tileset.resolutions).to.eql(resolutions);
|
expect(tileset.resolutions).to.eql(resolutions);
|
||||||
expect(tileset.styles).to.eql('');
|
expect(tileset.styles).to.eql('');
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test fallback', function() {
|
describe('test fallback', function() {
|
||||||
it('Test fallback', function() {
|
it('Test fallback', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/' +
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_1_1_WMSC/' +
|
||||||
'fallback.xml';
|
'fallback.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj;
|
var obj;
|
||||||
obj = parser.read(xml);
|
obj = parser.read(xml);
|
||||||
expect(obj.capability.layers.length).to.eql(2);
|
expect(obj.capability.layers.length).to.eql(2);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,19 +5,20 @@ describe('ol.parser.ogc.wmscapabilities_v1_3_0', function() {
|
|||||||
var parser = new ol.parser.ogc.WMSCapabilities();
|
var parser = new ol.parser.ogc.WMSCapabilities();
|
||||||
|
|
||||||
describe('test read exception', function() {
|
describe('test read exception', function() {
|
||||||
it('Error reported correctly', function() {
|
it('Error reported correctly', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/' +
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/' +
|
||||||
'exceptionsample.xml';
|
'exceptionsample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var result;
|
var result;
|
||||||
result = parser.read(xml);
|
result = parser.read(xml);
|
||||||
expect(!!result.error).to.be(true);
|
expect(!!result.error).to.be(true);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test read', function() {
|
describe('test read', function() {
|
||||||
it('Test read', function() {
|
it('Test read', function(done) {
|
||||||
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/ogcsample.xml';
|
var url = 'spec/ol/parser/ogc/xml/wmscapabilities_v1_3_0/ogcsample.xml';
|
||||||
afterLoadXml(url, function(xml) {
|
afterLoadXml(url, function(xml) {
|
||||||
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
var obj, capability, layers = {}, rootlayer, identifiers, authorities;
|
||||||
@@ -131,6 +132,7 @@ describe('ol.parser.ogc.wmscapabilities_v1_3_0', function() {
|
|||||||
expect(obj.service.layerLimit).to.eql(16);
|
expect(obj.service.layerLimit).to.eql(16);
|
||||||
expect(obj.service.maxHeight).to.eql(2048);
|
expect(obj.service.maxHeight).to.eql(2048);
|
||||||
expect(obj.service.maxWidth).to.eql(2048);
|
expect(obj.service.maxWidth).to.eql(2048);
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user