Loading...
Searching...
No Matches
exportdb.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief testing exportdb service
4
5 <h4> SAS Macros </h4>
6 @li mp_assertdsobs.sas
7 @li mx_execute.sas
8
9**/
10
11
12%let _program=&appLoc/services/admin/exportdb;
13
14/* test 1 - PGSQL flavour */
15data work.params;
16 length name $32 value $1000;
17 name='flavour';value='PGSQL';output;
18 name='schema';value='public';output;
19run;
20%mx_execute(&_program,
21 viyacontext=&defaultcontext,
22 inputparams=work.params,
23 outref=webout,
24 viyaresult=WEBOUT_TXT,
25 mdebug=&sasjs_mdebug
26)
27
28data work.results;
29 infile webout;
30 input;
31 putlog _infile_;
32 if index(upcase(_infile_),'CREATE TABLE') then do;
33 putlog 'test passed';
34 output;
35 stop;
36 end;
37run;
38
39%mp_assertdsobs(work.results,
40 desc=PGSQL flavour DDL file is successfully returned,
41 test=EQUALS 1,
42 outds=work.test_results
43)
44
45/* test 2 - default (SAS) flavour with inserts */
46data work.params;
47 length name $32 value $1000;
48 name='flavour';value='';output;
49 name='schema';value='';output;
50run;
51%mx_execute(&_program,
52 viyacontext=&defaultcontext,
53 inputparams=work.params,
54 outref=web2,
55 viyaresult=WEBOUT_TXT,
56 mdebug=&sasjs_mdebug
57)
58
59data work.results2;
60 infile web2;
61 input;
62 putlog _infile_;
63 if index(upcase(_infile_),'INSERT INTO') then do;
64 putlog 'test passed';
65 output;
66 stop;
67 end;
68run;
69
70%mp_assertdsobs(work.results2,
71 desc=SAS flavour DDL file with inserts is successfully returned,
72 test=EQUALS 1,
73 outds=work.test_results
74)