Skip to content

Commit c38df4a

Browse files
fix UT
1 parent 4ebc1f5 commit c38df4a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/common/iServer/SurfaceAnalystServiceSpec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('../../../src/common/iServer/SurfaceAnalystService');
22
require('../../../src/common/util/FetchRequest');
3-
//require('../../resources/SurfaceAnalystServiceResult');
3+
require('../../../src/common/commontypes/Util');
44

55
var surfaceAnalystEventArgsSystem = null,
66
serviceFailedEventArgsSystem = null;
@@ -27,6 +27,7 @@ describe('SurfaceAnalystService', function () {
2727
beforeEach(function () {
2828
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
2929
jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;
30+
SuperMap.Util.lastSeqID = 0;
3031
});
3132
afterEach(function () {
3233
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
@@ -167,7 +168,7 @@ describe('SurfaceAnalystService', function () {
167168
spyOn(FetchRequest, 'commit').and.callFake(function (method, testUrl, params, options) {
168169
expect(method).toBe('POST');
169170
expect(testUrl).toBe(spatialAnalystURL + "/geometry/isoline.json?returnContent=true");
170-
var expectParams = "{'resolution':3000,'extractParameter':{'clipRegion':null,'datumValue':-3,'expectedZValues':null,'interval':0.5,'resampleTolerance':0.7,'smoothMethod':\"BSPLINE\",'smoothness':3},'resultSetting':{'expectCount':1,'dataset':null,'dataReturnMode':\"RECORDSET_ONLY\",'deleteExistResultDataset':true},'surfaceAnalystMethod':\"ISOLINE\",'points':[{'id':\"SuperMap.Geometry_2\",'bounds':null,'SRID':null,'x':-4000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_3\",'bounds':null,'SRID':null,'x':-4500,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_4\",'bounds':null,'SRID':null,'x':-3000,'y':3000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_5\",'bounds':null,'SRID':null,'x':-3000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_6\",'bounds':null,'SRID':null,'x':-2500,'y':2500,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_7\",'bounds':null,'SRID':null,'x':-2000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_8\",'bounds':null,'SRID':null,'x':-2000,'y':3000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_9\",'bounds':null,'SRID':null,'x':-2000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_10\",'bounds':null,'SRID':null,'x':2000,'y':4000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_11\",'bounds':null,'SRID':null,'x':0,'y':0,'tag':null,'type':\"Point\"}],'zValues':[-3,-2,0,-1,-3,0,1,0,1,1]}";
171+
var expectParams = "{'resolution':3000,'extractParameter':{'clipRegion':null,'datumValue':-3,'expectedZValues':null,'interval':0.5,'resampleTolerance':0.7,'smoothMethod':\"BSPLINE\",'smoothness':3},'resultSetting':{'expectCount':1,'dataset':null,'dataReturnMode':\"RECORDSET_ONLY\",'deleteExistResultDataset':true},'surfaceAnalystMethod':\"ISOLINE\",'points':[{'id':\"SuperMap.Geometry_1\",'bounds':null,'SRID':null,'x':-4000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_2\",'bounds':null,'SRID':null,'x':-4500,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_3\",'bounds':null,'SRID':null,'x':-3000,'y':3000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_4\",'bounds':null,'SRID':null,'x':-3000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_5\",'bounds':null,'SRID':null,'x':-2500,'y':2500,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_6\",'bounds':null,'SRID':null,'x':-2000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_7\",'bounds':null,'SRID':null,'x':-2000,'y':3000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_8\",'bounds':null,'SRID':null,'x':-2000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_9\",'bounds':null,'SRID':null,'x':2000,'y':4000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_10\",'bounds':null,'SRID':null,'x':0,'y':0,'tag':null,'type':\"Point\"}],'zValues':[-3,-2,0,-1,-3,0,1,0,1,1]}";
171172
expect(params).toBe(expectParams);
172173
expect(options).not.toBeNull();
173174
return Promise.resolve(new Response(surfaceAnalysis_Geometry_ISOLINE));
@@ -220,6 +221,8 @@ describe('SurfaceAnalystService', function () {
220221
spyOn(FetchRequest, 'commit').and.callFake(function (method, testUrl, params, options) {
221222
expect(method).toBe('POST');
222223
expect(testUrl).toBe(spatialAnalystURL + "/geometry/isoregion.json?returnContent=true");
224+
var expectParams = "{'resolution':3000,'extractParameter':{'clipRegion':null,'datumValue':-3,'expectedZValues':null,'interval':0.5,'resampleTolerance':0.7,'smoothMethod':\"BSPLINE\",'smoothness':3},'resultSetting':{'expectCount':1,'dataset':null,'dataReturnMode':\"RECORDSET_ONLY\",'deleteExistResultDataset':true},'surfaceAnalystMethod':\"ISOREGION\",'points':[{'id':\"SuperMap.Geometry_1\",'bounds':null,'SRID':null,'x':-4000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_2\",'bounds':null,'SRID':null,'x':-4500,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_3\",'bounds':null,'SRID':null,'x':-3000,'y':3000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_4\",'bounds':null,'SRID':null,'x':-3000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_5\",'bounds':null,'SRID':null,'x':-2500,'y':2500,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_6\",'bounds':null,'SRID':null,'x':-2000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_7\",'bounds':null,'SRID':null,'x':-2000,'y':3000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_8\",'bounds':null,'SRID':null,'x':-2000,'y':2000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_9\",'bounds':null,'SRID':null,'x':2000,'y':4000,'tag':null,'type':\"Point\"},{'id':\"SuperMap.Geometry_10\",'bounds':null,'SRID':null,'x':0,'y':0,'tag':null,'type':\"Point\"}],'zValues':[-3,0,10,20,13,8,5,20,10,15]}";
225+
expect(params).toBe(expectParams);
223226
expect(options).not.toBeNull();
224227
return Promise.resolve(new Response(surfaceAnalysis_Geometry_ISOREGION));
225228
});

0 commit comments

Comments
 (0)