diff --git a/sasjs-tests/.gitignore b/sasjs-tests/.gitignore index 4d29575..14ed0b3 100644 --- a/sasjs-tests/.gitignore +++ b/sasjs-tests/.gitignore @@ -21,3 +21,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +sasjsbuild +sasjsresults \ No newline at end of file diff --git a/sasjs-tests/.sasjslint b/sasjs-tests/.sasjslint new file mode 100644 index 0000000..a299472 --- /dev/null +++ b/sasjs-tests/.sasjslint @@ -0,0 +1,19 @@ +{ + "lineEndings": "off", + "noTrailingSpaces": true, + "noEncodedPasswords": true, + "hasDoxygenHeader": true, + "noSpacesInFileNames": true, + "lowerCaseFileNames": true, + "maxLineLength": 80, + "maxHeaderLineLength": 80, + "maxDataLineLength": 80, + "noTabIndentation": true, + "indentationMultiple": 2, + "hasMacroNameInMend": true, + "noNestedMacros": true, + "hasMacroParentheses": true, + "strictMacroDefinition": true, + "noGremlins": true, + "defaultHeader": "/**{lineEnding} @file{lineEnding} @brief {lineEnding}

SAS Macros

{lineEnding}**/" +} \ No newline at end of file diff --git a/sasjs-tests/README.md b/sasjs-tests/README.md index 075e220..cebec2c 100644 --- a/sasjs-tests/README.md +++ b/sasjs-tests/README.md @@ -65,6 +65,7 @@ The code below will work on ALL SAS platforms (Viya, SAS 9 EBI, SASjs Server). ```sas filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas"; %inc mc; +%let apploc=/Public/app/adapter-tests; filename ft15f001 temp lrecl=1000; parmcards4; %webout(FETCH) @@ -80,7 +81,7 @@ parmcards4; %mend; %x() %webout(CLOSE) ;;;; -%mx_createwebservice(path=/Public/app/common,name=sendObj) +%mx_createwebservice(path=&apploc/services/common,name=sendObj) parmcards4; %webout(FETCH) %webout(OPEN) @@ -95,7 +96,7 @@ parmcards4; %mend; %x() %webout(CLOSE) ;;;; -%mx_createwebservice(path=/Public/app/common,name=sendArr) +%mx_createwebservice(path=&apploc/services/common,name=sendArr) parmcards4; data work.macvars; set sashelp.vmacro; @@ -104,14 +105,14 @@ parmcards4; %webout(OBJ,macvars) %webout(CLOSE) ;;;; -%mx_createwebservice(path=/Public/app/common,name=sendMacVars) +%mx_createwebservice(path=&apploc/services/common,name=sendMacVars) parmcards4; If you can keep your head when all about you Are losing theirs and blaming it on you, If you can trust yourself when all men doubt you, But make allowance for their doubting too; ;;;; -%mx_createwebservice(path=/Public/app/common,name=makeErr) +%mx_createwebservice(path=&apploc/services/common,name=makeErr) parmcards4; %webout(OPEN) data _null_; @@ -120,7 +121,7 @@ data _null_; run; %webout(CLOSE) ;;;; -%mx_createwebservice(path=/Public/app/common,name=invalidJSON) +%mx_createwebservice(path=&apploc/services/common,name=invalidJSON) ``` You should now be able to access the tests in your browser at the deployed path on your server. diff --git a/sasjs-tests/package.json b/sasjs-tests/package.json index 5d2cafe..81e7803 100644 --- a/sasjs-tests/package.json +++ b/sasjs-tests/package.json @@ -45,4 +45,4 @@ "devDependencies": { "node-sass": "7.0.3" } -} +} \ No newline at end of file diff --git a/sasjs-tests/public/config.json b/sasjs-tests/public/config.json index 334150a..0521d21 100644 --- a/sasjs-tests/public/config.json +++ b/sasjs-tests/public/config.json @@ -3,10 +3,10 @@ "password": "", "sasJsConfig": { "serverUrl": "", - "appLoc": "/Public/app", - "serverType": "SASVIYA", + "appLoc": "/Public/app/adapter-tests", + "serverType": "SASJS", "debug": false, "contextName": "sasjs adapter compute context", "useComputeApi": true } -} +} \ No newline at end of file diff --git a/sasjs-tests/sasjs/common/invalidJSON.sas b/sasjs-tests/sasjs/common/invalidJSON.sas new file mode 100644 index 0000000..49dea67 --- /dev/null +++ b/sasjs-tests/sasjs/common/invalidJSON.sas @@ -0,0 +1,13 @@ +/** + @file + @brief Makes an invalid JSON file + +

SAS Macros

+**/ + +%webout(OPEN) +data _null_; + file _webout; + put ' the discovery channel '; +run; +%webout(CLOSE) diff --git a/sasjs-tests/sasjs/common/makeErr.sas b/sasjs-tests/sasjs/common/makeErr.sas new file mode 100644 index 0000000..3a9954e --- /dev/null +++ b/sasjs-tests/sasjs/common/makeErr.sas @@ -0,0 +1,11 @@ +/** + @file + @brief Makes an error + +

SAS Macros

+**/ + +If you can keep your head when all about you + Are losing theirs and blaming it on you, +If you can trust yourself when all men doubt you, + But make allowance for their doubting too; \ No newline at end of file diff --git a/sasjs-tests/sasjs/common/sendArr.sas b/sasjs-tests/sasjs/common/sendArr.sas new file mode 100644 index 0000000..edcf382 --- /dev/null +++ b/sasjs-tests/sasjs/common/sendArr.sas @@ -0,0 +1,21 @@ +/** + @file + @brief Returns JSON in Array format + +

SAS Macros

+**/ + +%webout(FETCH) +%webout(OPEN) +%macro x(); + %if %symexist(sasjs_tables) %then + %do i=1 %to %sysfunc(countw(&sasjs_tables)); + %let table=%scan(&sasjs_tables,&i); + %webout(ARR,&table,missing=STRING,showmeta=YES) + %end; + %else %do i=1 %to &_webin_file_count; + %webout(ARR,&&_webin_name&i,missing=STRING,showmeta=YES) + %end; +%mend x; +%x() +%webout(CLOSE) \ No newline at end of file diff --git a/sasjs-tests/sasjs/common/sendMacVars.sas b/sasjs-tests/sasjs/common/sendMacVars.sas new file mode 100644 index 0000000..e8386e4 --- /dev/null +++ b/sasjs-tests/sasjs/common/sendMacVars.sas @@ -0,0 +1,13 @@ +/** + @file + @brief Returns Macro Variables + +

SAS Macros

+**/ + +data work.macvars; + set sashelp.vmacro; +run; +%webout(OPEN) +%webout(OBJ,macvars) +%webout(CLOSE) \ No newline at end of file diff --git a/sasjs-tests/sasjs/common/sendObj.sas b/sasjs-tests/sasjs/common/sendObj.sas new file mode 100644 index 0000000..e1554fe --- /dev/null +++ b/sasjs-tests/sasjs/common/sendObj.sas @@ -0,0 +1,21 @@ +/** + @file + @brief Returns JSON in Object format + +

SAS Macros

+**/ + +%webout(FETCH) +%webout(OPEN) +%macro x(); + %if %symexist(sasjs_tables) %then + %do i=1 %to %sysfunc(countw(&sasjs_tables)); + %let table=%scan(&sasjs_tables,&i); + %webout(OBJ,&table,missing=STRING,showmeta=YES) + %end; + %else %do i=1 %to &_webin_file_count; + %webout(OBJ,&&_webin_name&i,missing=STRING,showmeta=YES) + %end; +%mend x; +%x() +%webout(CLOSE) \ No newline at end of file diff --git a/sasjs-tests/sasjs/doxy/Doxyfile b/sasjs-tests/sasjs/doxy/Doxyfile new file mode 100644 index 0000000..45ad8a4 --- /dev/null +++ b/sasjs-tests/sasjs/doxy/Doxyfile @@ -0,0 +1,40 @@ +ALPHABETICAL_INDEX = NO + +ENABLE_PREPROCESSING = NO +EXTENSION_MAPPING = sas=Java ddl=Java +EXTRACT_LOCAL_CLASSES = NO +FILE_PATTERNS = *.sas \ + *.ddl \ + *.dox +GENERATE_LATEX = NO +GENERATE_TREEVIEW = YES +HIDE_FRIEND_COMPOUNDS = YES +HIDE_IN_BODY_DOCS = YES +HIDE_SCOPE_NAMES = YES +HIDE_UNDOC_CLASSES = YES +HIDE_UNDOC_MEMBERS = YES +HTML_OUTPUT = $(DOXY_HTML_OUTPUT) +HTML_HEADER = $(HTML_HEADER) +HTML_EXTRA_FILES = $(HTML_EXTRA_FILES) +HTML_FOOTER = $(HTML_FOOTER) +HTML_EXTRA_STYLESHEET = $(HTML_EXTRA_STYLESHEET) +INHERIT_DOCS = NO +INLINE_INFO = NO +INPUT = $(DOXY_INPUT) +LAYOUT_FILE = $(LAYOUT_FILE) +USE_MDFILE_AS_MAINPAGE = README.md +MAX_INITIALIZER_LINES = 0 +PROJECT_NAME = $(PROJECT_NAME) +PROJECT_LOGO = $(PROJECT_LOGO) +PROJECT_BRIEF = $(PROJECT_BRIEF) +RECURSIVE = YES +REPEAT_BRIEF = NO +SHOW_NAMESPACES = NO +SHOW_USED_FILES = NO +SOURCE_BROWSER = YES +SOURCE_TOOLTIPS = NO +STRICT_PROTO_MATCHING = YES +STRIP_CODE_COMMENTS = NO +SUBGROUPING = NO +TAB_SIZE = 2 +VERBATIM_HEADERS = NO \ No newline at end of file diff --git a/sasjs-tests/sasjs/doxy/DoxygenLayout.xml b/sasjs-tests/sasjs/doxy/DoxygenLayout.xml new file mode 100644 index 0000000..ac13efb --- /dev/null +++ b/sasjs-tests/sasjs/doxy/DoxygenLayout.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sasjs-tests/sasjs/doxy/doxygen.svg b/sasjs-tests/sasjs/doxy/doxygen.svg new file mode 100644 index 0000000..46f4a19 --- /dev/null +++ b/sasjs-tests/sasjs/doxy/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sasjs-tests/sasjs/doxy/favicon.ico b/sasjs-tests/sasjs/doxy/favicon.ico new file mode 100644 index 0000000..d8c7dcb Binary files /dev/null and b/sasjs-tests/sasjs/doxy/favicon.ico differ diff --git a/sasjs-tests/sasjs/doxy/logo.png b/sasjs-tests/sasjs/doxy/logo.png new file mode 100644 index 0000000..e44a476 Binary files /dev/null and b/sasjs-tests/sasjs/doxy/logo.png differ diff --git a/sasjs-tests/sasjs/doxy/new_footer.html b/sasjs-tests/sasjs/doxy/new_footer.html new file mode 100644 index 0000000..81e1b47 --- /dev/null +++ b/sasjs-tests/sasjs/doxy/new_footer.html @@ -0,0 +1,33 @@ + + + + + + + + + + diff --git a/sasjs-tests/sasjs/doxy/new_header.html b/sasjs-tests/sasjs/doxy/new_header.html new file mode 100644 index 0000000..6f7dab9 --- /dev/null +++ b/sasjs-tests/sasjs/doxy/new_header.html @@ -0,0 +1,57 @@ + + + + + + + + + + $projectname: $title + + + + $title + + + + + $treeview $search $mathjax + + + $extrastylesheet + + +
+ + + +
+ + + + + + + + + + + + + + +
+
$projectname
+
$projectbrief
+
$searchbox
+
+ + +
+ + diff --git a/sasjs-tests/sasjs/doxy/new_stylesheet.css b/sasjs-tests/sasjs/doxy/new_stylesheet.css new file mode 100644 index 0000000..b7ec9a3 --- /dev/null +++ b/sasjs-tests/sasjs/doxy/new_stylesheet.css @@ -0,0 +1,4 @@ +#projectlogo img { + border: 0px none; + max-height: 70px; +} diff --git a/sasjs-tests/sasjs/sasjsconfig.json b/sasjs-tests/sasjs/sasjsconfig.json new file mode 100644 index 0000000..331a467 --- /dev/null +++ b/sasjs-tests/sasjs/sasjsconfig.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://cli.sasjs.io/sasjsconfig-schema.json", + "serviceConfig": { + "serviceFolders": [ + "sasjs/common" + ] + }, + "defaultTarget": "4gl", + "targets": [ + { + "name": "4gl", + "serverType": "SASJS", + "serverUrl": "https://sas9.4gl.io", + "appLoc": "/Public/app/adapter-tests" + } + ] +} \ No newline at end of file diff --git a/sasjs-tests/src/testSuites/Compute.ts b/sasjs-tests/src/testSuites/Compute.ts index 2f4f75f..8c0e962 100644 --- a/sasjs-tests/src/testSuites/Compute.ts +++ b/sasjs-tests/src/testSuites/Compute.ts @@ -48,7 +48,7 @@ export const computeTests = (adapter: SASjs, appLoc: string): TestSuite => ({ test: () => { const data: any = { table1: [{ col1: 'first col value' }] } return adapter.startComputeJob( - '/Public/app/common/sendArr', + '/Public/app/adapter-tests/services/common/sendArr', data, {}, undefined,