Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit 574b0db

Browse files
committed
#111 Convert shell tests to Roxy framework complete
1 parent 87ff333 commit 574b0db

15 files changed

+245
-153
lines changed

src/test/suites/e2e-rest-email/21-processmodel-create.xqy

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
xquery version "1.0-ml";
22

33
(: 21-processmodel-create :)
4-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
4+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
55
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
66
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
77
declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel";
88
declare namespace http = "xdmp:http";
99

10-
let $process := wrt:processmodel-create ($c:json-options, "022-email-test.bpmn")
10+
let $process := wrt:processmodel-create ($const:json-options, "022-email-test.bpmn")
1111
(: not working with XML ? :)
1212
return ( (:
1313
test:assert-equal('200', xs:string($process[1]/http:code)),
@@ -19,14 +19,14 @@ return ( (:
1919
);
2020

2121
(: 22-processmodel-publish :)
22-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
22+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
2323
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
2424
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
2525
declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel";
2626
declare namespace http = "xdmp:http";
2727

2828
(: not working with XML ? :)
29-
let $result := wrt:processmodel-publish($c:json-options, "022-email-test__1__0")
29+
let $result := wrt:processmodel-publish($const:json-options, "022-email-test__1__0")
3030
return ( (:
3131
test:assert-equal('200', xs:string($result[1]/http:code)),
3232
test:assert-equal('SUCCESS', xs:string($result[2]/ext:updateResponse/ext:outcome)),
@@ -37,14 +37,14 @@ return ( (:
3737
);
3838

3939
(: 23-process-create :)
40-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
40+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
4141
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
4242
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
4343
declare namespace ext = "http://marklogic.com/rest-api/resource/process";
4444
declare namespace http = "xdmp:http";
4545

4646
let $payload := doc("/raw/data/23-payload.xml")
47-
let $result := wrt:process-create($c:xml-options, $payload)
47+
let $result := wrt:process-create($const:xml-options, $payload)
4848
return (
4949
test:assert-equal('200', xs:string($result[1]/http:code)),
5050
test:assert-equal('SUCCESS', xs:string($result[2]/ext:createResponse/ext:outcome)),
@@ -54,113 +54,113 @@ return (
5454
);
5555

5656
(: 24-process-read :)
57-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
57+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
5858
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
5959
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
6060
declare namespace ext = "http://marklogic.com/rest-api/resource/process";
6161
declare namespace http = "xdmp:http";
6262

6363
let $pid := xs:string(doc("/test/processId.xml")/test/processId)
64-
let $result := wrt:process-read($c:xml-options, $pid)
64+
let $result := wrt:process-read($const:xml-options, $pid)
6565
return (
6666
test:assert-equal('200', xs:string($result[1]/http:code)),
6767
test:assert-equal('SUCCESS', xs:string($result[2]/ext:readResponse/ext:outcome)),
6868
test:assert-exists($result[2]/ext:readResponse/ext:document)
6969
);
7070

7171
(: 25-processsubscription-create :)
72-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
72+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
7373
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
7474
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
7575
declare namespace ext = "http://marklogic.com/rest-api/resource/processsubscription";
7676
declare namespace http = "xdmp:http";
7777

78-
let $result := wrt:test-25-processsubscription-create ($c:xml-options)
78+
let $result := wrt:test-25-processsubscription-create ($const:xml-options)
7979
return (
8080
test:assert-equal('200', xs:string($result[1]/http:code)),
8181
test:assert-equal('SUCCESS', xs:string($result[2]/ext:createResponse/ext:outcome)),
8282
test:assert-equal('/config/alerts/email-sub-test', xs:string($result[2]/ext:createResponse/ext:subscriptionId))
8383
);
8484

8585
(: 26-processsubscription-read :)
86-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
86+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
8787
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
8888
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
8989
declare namespace alert = "http://marklogic.com/xdmp/alert";
9090
declare namespace ext = "http://marklogic.com/rest-api/resource/processsubscription";
9191
declare namespace http = "xdmp:http";
9292

93-
let $result := wrt:test-26-processsubscription-read ($c:xml-options)
93+
let $result := wrt:test-26-processsubscription-read ($const:xml-options)
9494
return (
9595
test:assert-equal('200', xs:string($result[1]/http:code)),
9696
test:assert-equal('SUCCESS', xs:string($result[2]/ext:readResponse/ext:outcome)),
9797
test:assert-equal('/config/alerts/email-sub-test', xs:string($result[2]/ext:readResponse/ext:subscription/alert:config/alert:config-uri))
9898
);
9999

100100
(: 27-document-create :)
101-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
101+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
102102
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
103103
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
104104
declare namespace ext = "http://marklogic.com/rest-api/resource/processsubscription";
105105
declare namespace http = "xdmp:http";
106106

107-
let $result := wrt:test-27-document-create ($c:xml-options)
107+
let $result := wrt:test-27-document-create ($const:xml-options)
108108
return (
109109
test:assert-equal('201', xs:string($result[1]/http:code))
110110
);
111111

112112
(: Search needs to be immediately after - it executes too quick otherwise!!! (A blank result may mean processes already finished, not just haven't started) :)
113113
(: 28-processsearch-read :)
114-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
114+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
115115
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
116116
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
117117
declare namespace ext = "http://marklogic.com/rest-api/resource/processsearch";
118118
declare namespace http = "xdmp:http";
119119
declare namespace wf = "http://marklogic.com/workflow";
120120

121-
let $result := wrt:test-28-processsearch-read ($c:xml-options)
121+
let $result := wrt:test-28-processsearch-read ($const:xml-options)
122122
return (
123123
test:assert-equal('200', xs:string($result[1]/http:code)),
124124
test:assert-equal('SUCCESS', xs:string($result[2]/ext:readResponse/ext:outcome)),
125125
test:assert-exists($result[2]/ext:readResponse/wf:list)
126126
);
127127

128128
(: 29-processasset-create :)
129-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
129+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
130130
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
131131
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
132132
declare namespace ext = "http://marklogic.com/rest-api/resource/processasset";
133133
declare namespace http = "xdmp:http";
134134

135-
let $result := wrt:test-29-processasset-create ($c:xml-options)
135+
let $result := wrt:test-29-processasset-create ($const:xml-options)
136136
return (
137137
test:assert-equal('200', xs:string($result[1]/http:code)),
138138
test:assert-equal('SUCCESS', xs:string($result[2]/ext:createResponse/ext:outcome)),
139139
test:assert-equal('/workflowengine/assets/021-initiating-attachment/1/3/RejectedEmail.txt', xs:string($result[2]/ext:createResponse/ext:assetUri))
140140
);
141141

142142
(: 30-processasset-read :)
143-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
143+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
144144
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
145145
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
146146
declare namespace em = "URN:ietf:params:email-xml:";
147147
declare namespace http = "xdmp:http";
148148
declare namespace rf = "URN:ietf:params:rfc822:";
149149

150-
let $result := wrt:test-30-processasset-read ($c:xml-options)
150+
let $result := wrt:test-30-processasset-read ($const:xml-options)
151151
return (
152152
test:assert-equal('200', xs:string($result[1]/http:code)) (:,
153153
test:assert-equal('Document Rejected', xs:string($result[2]/em:Message/rf:subject)) :)
154154
);
155155

156156
(: 31-processasset-delete :)
157-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
157+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
158158
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
159159
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
160160
declare namespace ext = "http://marklogic.com/rest-api/resource/processasset";
161161
declare namespace http = "xdmp:http";
162162

163-
let $result := wrt:test-31-processasset-delete ($c:xml-options)
163+
let $result := wrt:test-31-processasset-delete ($const:xml-options)
164164
return (
165165
test:assert-equal('200', xs:string($result[1]/http:code)),
166166
test:assert-equal('SUCCESS', xs:string($result[2]/ext:deleteResponse/ext:outcome)),

src/test/suites/e2e-rest-email/suite-setup.xqy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
xquery version "1.0-ml";
22

33
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
4-
import module namespace deploy = "http://marklogic.com/roxy/deploy-rest-resources" at "/test/deploy-rest-resources.xqy";
4+
import module namespace deploy = "http://marklogic.com/roxy/deploy-rest-resources" at "/test/workflow-deploy-rest-resources.xqy";
55

66
let $_modules-import := deploy:deploy()
77

src/test/suites/e2e-rest-fork/32-create-fork.xqy

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
xquery version "1.0-ml";
22

33
(: 32-processmodel-create-fork-simple :)
4-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
4+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
55
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
66
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
77
declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel";
88
declare namespace http = "xdmp:http";
99

10-
let $process := wrt:processmodel-create ($c:json-options, "fork-simple.bpmn2")
10+
let $process := wrt:processmodel-create ($const:json-options, "fork-simple.bpmn2")
1111
(: not working with XML ? :)
1212
return ( (:
1313
test:assert-equal('200', xs:string($process[1]/http:code)),
@@ -19,13 +19,13 @@ return ( (:
1919
);
2020

2121
(: 33-processmodel-create-fork-conditional :)
22-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
22+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
2323
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
2424
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
2525
declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel";
2626
declare namespace http = "xdmp:http";
2727

28-
let $process := wrt:processmodel-create ($c:json-options, "fork-conditional.bpmn2")
28+
let $process := wrt:processmodel-create ($const:json-options, "fork-conditional.bpmn2")
2929
(: not working with XML ? :)
3030
return ( (:
3131
test:assert-equal('200', xs:string($process[1]/http:code)),
@@ -37,13 +37,13 @@ return ( (:
3737
);
3838

3939
(: 34-processmodel-create-fork-within-fork :)
40-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
40+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
4141
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
4242
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
4343
declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel";
4444
declare namespace http = "xdmp:http";
4545

46-
let $process := wrt:processmodel-create ($c:json-options, "fork-within-fork.bpmn2")
46+
let $process := wrt:processmodel-create ($const:json-options, "fork-within-fork.bpmn2")
4747
(: not working with XML ? :)
4848
return ( (:
4949
test:assert-equal('200', xs:string($process[1]/http:code)),
@@ -55,13 +55,13 @@ return ( (:
5555
);
5656

5757
(: 35-processmodel-publish-fork-simple : )
58-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
58+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
5959
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
6060
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
6161
declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel";
6262
declare namespace http = "xdmp:http";
6363
64-
let $process := wrt:processmodel-create ($c:json-options, "fork-simple.bpmn2")
64+
let $process := wrt:processmodel-create ($const:json-options, "fork-simple.bpmn2")
6565
( : not working with XML ? : )
6666
return ( ( :
6767
test:assert-equal('200', xs:string($process[1]/http:code)),
@@ -79,14 +79,14 @@ test:assert-equal('fork-simple__1__0', xs:string($process[2]/createResponse/mode
7979
(: All the below are final tests, to be executed at the end of all tests only :)
8080

8181
(: 91-processengine-read :)
82-
import module namespace c="http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
82+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
8383
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
8484
import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
8585
declare namespace ext = "http://marklogic.com/rest-api/resource/processengine";
8686
declare namespace http = "xdmp:http";
8787
declare namespace wf = "http://marklogic.com/workflow";
8888

89-
let $result := wrt:test-91-processengine-read($c:xml-options)
89+
let $result := wrt:test-91-processengine-read($const:xml-options)
9090
return (
9191
test:assert-equal('200', xs:string($result[1]/http:code)),
9292
test:assert-equal('SUCCESS', xs:string($result[2]/ext:readResponse/ext:outcome)),

src/test/suites/e2e-rest-fork/suite-setup.xqy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
xquery version "1.0-ml";
22

33
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
4-
import module namespace deploy = "http://marklogic.com/roxy/deploy-rest-resources" at "/test/deploy-rest-resources.xqy";
4+
import module namespace deploy = "http://marklogic.com/roxy/deploy-rest-resources" at "/test/workflow-deploy-rest-resources.xqy";
55

66
let $_modules-import := deploy:deploy()
77

0 commit comments

Comments
 (0)