17filename ft15f001 temp;
19 %put Initialising sendObj: ;
24 %
if %symexist(sasjs_tables) %then %
do i=1 %to %sysfunc(countw(&sasjs_tables));
25 %let table=%scan(&sasjs_tables,&i);
26 %webout(OBJ,&table,missing=STRING)
28 %
else %
do i=1 %to &_webin_file_count;
29 %webout(OBJ,&&_webin_name&i,missing=STRING)
34%mx_createwebservice(path=&mcTestAppLoc/services,name=sendObj)
38 desc=No errors after service creation,
39 outds=work.test_results
45data work.somedata1 work.somedata2;
54%mx_execute(&mcTestAppLoc/services/sendObj,
55 inputdatasets=work.somedata1 work.somedata2,
62 set testlib1.somedata1;
63 if x=1 and y=' t
"w"o' and z=
"Z" and y2=' two' then call symputx('test1
','PASS');
69 set testlib1.somedata2;
70 if x=1 and y=' t
"w"o' and z=
"Z" and y2=' two' then call symputx('test2
','PASS');
77 desc=somedata1 created correctly,
78 outds=work.test_results
82 desc=somedata2 created correctly,
83 outds=work.test_results
89proc datasets lib=work nolist nowarn;
92%mx_execute(&mcTestAppLoc/services/sendObj,
93 inputdatasets=work.somedata1,
99 iftrue=(%sysfunc(exist(work.childlog))=0),
100 desc=Test 2 - no log dataset is written unless outlogds is asked for,
101 outds=work.test_results
107%mx_execute(&mcTestAppLoc/services/sendObj,
108 inputdatasets=work.somedata1,
111 outlogds=work.childlog
123 if exist('work.childlog') then do;
126 dsid=open('work.childlog');
127 n=attrn(dsid,'NOBS');
129 if n>0 then do until(eof);
130 set work.childlog(keep=line) end=eof;
132 if index(line,'Initialising sendObj') then found=1;
135 call symputx('loglines',n);
136 if
"&mcTestPlatform"=
"SASMETA" then do;
139 call symputx('logcase',ifc(n=0,'PASS
','FAIL'));
140 call symputx('logsize
','PASS');
143 call symputx('logcase',ifc(found,'PASS
','FAIL'));
146 call symputx('logsize',ifc(n>50,'PASS
','FAIL'));
151 iftrue=(
"&logcase"=
"PASS"),
152 desc=Test 3 - the child log is captured when outlogds is supplied,
153 outds=work.test_results
157 iftrue=(
"&logsize"=
"PASS"),
158 desc=Test 3 - the captured log is the whole log not a fragment (&loglines lines),
159 outds=work.test_results
165%mx_execute(&mcTestAppLoc/services/sendObj,
166 inputdatasets=work.somedata1,
169 outstatus=work.status5
174 if not exist('work.status5') then stop;
176 call symputx('state5',state);
180 iftrue=(
"&state5"=
"completed"),
181 desc=Test 4 - a clean run reports state=completed,
182 outds=work.test_results
186 iftrue=(%sysfunc(exist(work.results))=0),
187 desc=Test 4 - no fixed-name table is left in the caller WORK,
188 outds=work.test_results
194filename ft15f002 temp;
199 put '%mp_abort(iftrue=(1=1),msg=Deliberate abort);';
203%mx_createwebservice(path=&mcTestAppLoc/services,name=abortObj,code=ft15f002)
205%mx_execute(&mcTestAppLoc/services/abortObj,
207 outstatus=work.status6
216 if
"&mcTestPlatform"=
"SASMETA" then expect='unknown';
217 else expect='canceled';
218 call symputx('expect6',expect);
219 if exist('work.status6') then do;
221 call symputx('state6',state);
222 call symputx('msg6',errmsg);
227 iftrue=(
"&state6"=
"&expect6"),
228 desc=Test 5 - an aborted child reports its outcome,
229 outds=work.test_results
234 if
"&mcTestPlatform"=
"SASMETA" then call symputx('msgcase
','PASS');
235 else if %index(
"&msg6",
"Deliberate abort")>0 then call symputx('msgcase
','PASS');
239 iftrue=(
"&msgcase"=
"PASS"),
240 desc=Test 5 - the abort message from the child is reported,
241 outds=work.test_results
251filename ft15f003 temp;
254 put '%mp_abort(iftrue=(1=1),msg=%nrstr(alpha
"quoted" beta));';
257%mx_createwebservice(path=&mcTestAppLoc/services,name=abortQuote,code=ft15f003)
259%mx_execute(&mcTestAppLoc/services/abortQuote,
261 outstatus=work.statusq
264filename ft15f004 temp;
268 big=repeat('a message that runs on ',20);
269 put '%mp_abort(iftrue=(1=1),msg=' big +(-1) ');';
272%mx_createwebservice(path=&mcTestAppLoc/services,name=abortLong,code=ft15f004)
274%mx_execute(&mcTestAppLoc/services/abortLong,
276 outstatus=work.statuslg
282filename ft15f005 temp;
285 put '%mp_abort(iftrue=(1=1),msg=%nrstr(alpha, beta 100% gamma));';
288%mx_createwebservice(path=&mcTestAppLoc/services,name=abortComma,code=ft15f005)
290%mx_execute(&mcTestAppLoc/services/abortComma,
292 outstatus=work.statuscm
299 if exist('work.statusq') then do;
301 if index(errmsg,'quoted
" beta')>0 then call symputx('quote6','PASS');
302 else call symputx('quote6','FAIL');
304 if exist('work.statuslg') then do;
306 call symputx('long6',length(errmsg));
308 if exist('work.statuscm') then do;
310 if index(errmsg,'alpha, beta 100% gamma')>0 then call symputx('comma6','PASS');
311 else call symputx('comma6','FAIL');
316 iftrue=(""e6
"="PASS
" or "&mcTestPlatform
"="SASMETA
"),
317 desc=Test 5b - a quote in the child message survives,
318 outds=work.test_results
322 iftrue=("&comma6
"="PASS
" or "&mcTestPlatform
"="SASMETA
"),
323 desc=Test 5b - a comma and a percent sign in the child message survive,
324 outds=work.test_results
328 iftrue=(&long6>256 or "&mcTestPlatform
"="SASMETA
"),
329 desc=Test 5b - a long child message is reported in full (&long6 bytes),
330 outds=work.test_results
336/* clear what Test 3 left, so the assertion below is about this call only */
337proc datasets lib=work nolist nowarn;
340%mx_execute(&mcTestAppLoc/services/sendObj,
341 inputdatasets=work.somedata1
346 desc=Test 6 - the default call runs without error,
347 outds=work.test_results
351 iftrue=(%sysfunc(exist(work.childlog))=0 and %sysfunc(exist(work.results))=0),
352 desc=Test 6 - the default call leaves no log or flow table behind,
353 outds=work.test_results