more tests and typedefs.
Once feature editing is more stable, this format can be extended with Update, Delete and Insert
This commit is contained in:
@@ -15,9 +15,80 @@ describe('ol.parser.ogc.WFS', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out GetFeature with a handle', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/GetFeature.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var output = p.writers[p.defaultNamespaceURI]['GetFeature'].
|
||||
apply(p, [{
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featureTypes: ['states'],
|
||||
featurePrefix: 'topp',
|
||||
handle: 'handle_g',
|
||||
maxFeatures: 1,
|
||||
outputFormat: 'json'
|
||||
}
|
||||
]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out Transaction with a handle', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/Transaction.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var output = p.writers[p.defaultNamespaceURI]['Transaction'].
|
||||
apply(p, [{
|
||||
options: {handle: 'handle_t'}
|
||||
}
|
||||
]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out Native', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/Native.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var output = p.write(null, {
|
||||
nativeElements: [{
|
||||
vendorId: 'ORACLE',
|
||||
safeToIgnore: true,
|
||||
value: 'ALTER SESSION ENABLE PARALLEL DML'
|
||||
}, {
|
||||
vendorId: 'ORACLE',
|
||||
safeToIgnore: false,
|
||||
value: 'Another native line goes here'
|
||||
}]
|
||||
});
|
||||
expect(goog.dom.xml.loadXml(output)).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing out GetFeature with > 1 typename', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1/GetFeatureMultiple.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_0_0();
|
||||
var output = p.writers[p.defaultNamespaceURI]['GetFeature'].
|
||||
apply(p, [{
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featureTypes: ['states', 'cities'],
|
||||
featurePrefix: 'topp'
|
||||
}
|
||||
]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('ol.parser.ogc.WFS');
|
||||
goog.require('ol.parser.ogc.WFS_v1_0_0');
|
||||
goog.require('ol.parser.ogc.WFS_v1_1_0');
|
||||
|
||||
Reference in New Issue
Block a user