Add reading of TransactionResponse
This commit is contained in:
16
test/spec/ol/format/wfs/TransactionResponse.xml
Normal file
16
test/spec/ol/format/wfs/TransactionResponse.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<wfs:TransactionResponse version="1.1.0" xmlns:ogc="http://www.opengis.net/ogc" xmlns:tiger="http://www.census.gov" xmlns:wfs="http://www.opengis.net/wfs" xmlns:topp="http://www.openplans.org/topp" xmlns:sf="http://www.openplans.org/spearfish" xmlns:ows="http://www.opengis.net/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<wfs:TransactionSummary>
|
||||
<wfs:totalInserted>0</wfs:totalInserted>
|
||||
<wfs:totalUpdated>1</wfs:totalUpdated>
|
||||
<wfs:totalDeleted>0</wfs:totalDeleted>
|
||||
</wfs:TransactionSummary>
|
||||
<wfs:TransactionResults/>
|
||||
<wfs:InsertResults>
|
||||
<wfs:Feature>
|
||||
<ogc:FeatureId fid="parcelle.40"/>
|
||||
</wfs:Feature>
|
||||
<wfs:Feature>
|
||||
<ogc:FeatureId fid="parcelle.41"/>
|
||||
</wfs:Feature>
|
||||
</wfs:InsertResults>
|
||||
</wfs:TransactionResponse>
|
||||
@@ -33,6 +33,28 @@ describe('ol.format.WFS', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('when parsing TransactionResponse', function() {
|
||||
var response;
|
||||
before(function(done) {
|
||||
afterLoadText('spec/ol/format/wfs/TransactionResponse.xml',
|
||||
function(xml) {
|
||||
try {
|
||||
response = new ol.format.WFS().readTransactionResponse(xml);
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('returns the correct TransactionResponse object', function() {
|
||||
expect(response.transactionSummary.totalDeleted).to.equal(0);
|
||||
expect(response.transactionSummary.totalInserted).to.equal(0);
|
||||
expect(response.transactionSummary.totalUpdated).to.equal(1);
|
||||
expect(response.insertIds).to.have.length(2);
|
||||
expect(response.insertIds[0]).to.equal('parcelle.40');
|
||||
});
|
||||
});
|
||||
|
||||
describe('when writing out a GetFeature request', function() {
|
||||
|
||||
it('creates the expected output', function() {
|
||||
|
||||
Reference in New Issue
Block a user