-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryTest.html
More file actions
345 lines (340 loc) · 24.8 KB
/
QueryTest.html
File metadata and controls
345 lines (340 loc) · 24.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>LSD</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css" type="text/css" media="all"/>
<link rel="stylesheet" href="https://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all"/>
<link rel="stylesheet" id="theme" type="text/css" href="yatspec_alt.css">
</head>
<body>
<div class="hd-switch">
<input type="checkbox" id="switch-id" name="myswitch" onchange="toggleTheme()">
<label for="switch-id">Classic</label>
<span class="hd-switch-knob"></span>
</div>
<div class="logo">
<h5 class="logo1">L</h5>iving <h5 class="logo2">S</h5>equence <h5 class="logo3">D</h5>iagrams
</div>
<header>
<h1>Query</h1>
<pre class="notes">As a user
I want to run sql reports against the database directly
So that I can mine the information I need
This example hosts embers on Jetty, in a jersey ServletContainer.
IOC via ResourceConfig
Database via Hsqldb</pre>
<nav class="contents">
<h2>Contents</h2>
<ul class="contents">
<li class='test-passed icon-check'>
<a href="#queryNotFound">Query not found</a>
</li>
<li class='test-passed icon-check'>
<a href="#queryRunsWithNoRowsOfData">Query runs with no rows of data</a>
</li>
<li class='test-passed icon-check'>
<a href="#showAllAvailableQueries">Show all available queries</a>
</li>
</ul>
</nav>
</header>
<main role="main">
<article class="testmethod section">
<header>
<a id="queryNotFound"></a>
<h2 class="section-header">Query not found</h2>
</header>
<section class="section-body">
<section class="scenario" id="-943850153_0_364668868">
<section class="specification">
<h2>Specification<a id=""></a></h2>
<pre class="highlight specification">When http get request for "unknown query"
Then http response code is http_not_found
Then http response body contains string "query not found unknown query"</pre>
</section>
<section class="results">
<h3 class="logKey">Test result:</h3>
<pre class='highlight results test-passed icon-check'>Test passed</pre>
</section>
<section class="diagram">
<h3 logkey="Sequence_Diagram">Sequence Diagram</h3>
<div class="highlight SvgWrapper" ><?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" contentScriptType="application/ecmascript" contentStyleType="text/css" height="251px" preserveAspectRatio="none" style="width:153px;height:251px;" version="1.1" viewBox="0 0 153 251" width="153px" zoomAndPan="magnify">
<defs>
<filter height="300%" id="f1rrjxfak1hqrk" width="300%" x="-1" y="-1">
<feGaussianBlur result="blurOut" stdDeviation="2.0" />
<feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0" />
<feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3" />
<feBlend in="SourceGraphic" in2="blurOut3" mode="normal" />
</filter>
</defs>
<g>
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="28" x2="28" y1="88.4883" y2="167.1094" />
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="108.5" x2="108.5" y1="88.4883" y2="167.1094" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="40" x="5" y="85.5352">Client</text>
<ellipse cx="28" cy="15" fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;" />
<path d="M28,23 L28,50 M15,31 L41,31 M28,50 L15,65 M28,50 L41,65 " fill="none" filter="url(#f1rrjxfak1hqrk)" style="stroke:#A80036;stroke-width:2.0;" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="40" x="5" y="179.6445">Client</text>
<ellipse cx="28" cy="192.5977" fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;" />
<path d="M28,200.5977 L28,227.5977 M15,208.5977 L41,208.5977 M28,227.5977 L15,242.5977 M28,227.5977 L41,242.5977 " fill="none" filter="url(#f1rrjxfak1hqrk)" style="stroke:#A80036;stroke-width:2.0;" />
<rect fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="65" x="74.5" y="53" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="81.5" y="73.5352">Embers</text>
<rect fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="65" x="74.5" y="166.1094" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="81.5" y="186.6445">Embers</text>
<line style="stroke:#A80036;stroke-width:1.0;" x1="107" x2="97" y1="119.7988" y2="115.7988" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="107" x2="97" y1="119.7988" y2="123.7988" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="108" y1="119.7988" y2="119.7988" />
<text class="sequence_diagram_clickable" fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" sequence_diagram_message_id="_request_from_Client_to_Embers" textLength="47" x="35" y="115.0566">request</text>
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="38" y1="149.1094" y2="145.1094" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="38" y1="149.1094" y2="153.1094" />
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="28" x2="108" y1="149.1094" y2="149.1094" />
<text class="sequence_diagram_clickable" fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" sequence_diagram_message_id="_response_from_Embers_to_Client" textLength="57" x="45" y="144.3672">response</text>
</g>
</svg>
</div>
</section>
<section class="interestingGivens">
<h3 class="logKey">Interesting Givens</h3>
<table class="interestingGivens">
<tr>
<th class="key">Url</th>
<td class="interestingGiven">http://localhost:8001/embers/query/unknownQuery</td>
</tr>
</table>
</section>
<footer>
<section class="interactions">
<details>
<summary>Captured Interactions</summary>
<details class="interaction">
<summary class="logKey" logkey="_request_from_Client_to_Embers"> request from Client to Embers</summary>
<div contenteditable="true" ondblclick="document.execCommand('selectAll',false,null)"
class="logValue highlight HttpRequestWrapper">GET http://localhost:8001/embers/query/unknownQuery
Headers: null
Body: null</div>
</details>
<details class="interaction">
<summary class="logKey" logkey="_response_from_Embers_to_Client"> response from Embers to Client</summary>
<div contenteditable="true" ondblclick="document.execCommand('selectAll',false,null)"
class="logValue highlight HttpResponseWrapper">Response Code: 404
Headers: {null=[HTTP/1.1 404 Not Found], Server=[Jetty(9.3.0.M1)], Content-Length=[29], Date=[Mon, 05 Apr 2021 09:50:30 GMT], Content-Type=[text/plain]}
Body: Query not found: unknownQuery
</div>
</details>
</details>
</section>
</footer>
</section>
</section>
</article>
<article class="testmethod section">
<header>
<a id="queryRunsWithNoRowsOfData"></a>
<h2 class="section-header">Query runs with no rows of data</h2>
</header>
<section class="section-body">
<section class="scenario" id="1452438065_0_802996738">
<section class="specification">
<h2>Specification<a id=""></a></h2>
<pre class="highlight specification">Given embers has a query that returns no rows
When http get request for "no rows"
Then http response code is 200
Then http response body is empty</pre>
</section>
<section class="results">
<h3 class="logKey">Test result:</h3>
<pre class='highlight results test-passed icon-check'>Test passed</pre>
</section>
<section class="diagram">
<h3 logkey="Sequence_Diagram">Sequence Diagram</h3>
<div class="highlight SvgWrapper" ><?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" contentScriptType="application/ecmascript" contentStyleType="text/css" height="251px" preserveAspectRatio="none" style="width:153px;height:251px;" version="1.1" viewBox="0 0 153 251" width="153px" zoomAndPan="magnify">
<defs>
<filter height="300%" id="f1rrjxfak1hqrk" width="300%" x="-1" y="-1">
<feGaussianBlur result="blurOut" stdDeviation="2.0" />
<feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0" />
<feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3" />
<feBlend in="SourceGraphic" in2="blurOut3" mode="normal" />
</filter>
</defs>
<g>
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="28" x2="28" y1="88.4883" y2="167.1094" />
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="108.5" x2="108.5" y1="88.4883" y2="167.1094" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="40" x="5" y="85.5352">Client</text>
<ellipse cx="28" cy="15" fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;" />
<path d="M28,23 L28,50 M15,31 L41,31 M28,50 L15,65 M28,50 L41,65 " fill="none" filter="url(#f1rrjxfak1hqrk)" style="stroke:#A80036;stroke-width:2.0;" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="40" x="5" y="179.6445">Client</text>
<ellipse cx="28" cy="192.5977" fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;" />
<path d="M28,200.5977 L28,227.5977 M15,208.5977 L41,208.5977 M28,227.5977 L15,242.5977 M28,227.5977 L41,242.5977 " fill="none" filter="url(#f1rrjxfak1hqrk)" style="stroke:#A80036;stroke-width:2.0;" />
<rect fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="65" x="74.5" y="53" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="81.5" y="73.5352">Embers</text>
<rect fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="65" x="74.5" y="166.1094" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="81.5" y="186.6445">Embers</text>
<line style="stroke:#A80036;stroke-width:1.0;" x1="107" x2="97" y1="119.7988" y2="115.7988" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="107" x2="97" y1="119.7988" y2="123.7988" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="108" y1="119.7988" y2="119.7988" />
<text class="sequence_diagram_clickable" fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" sequence_diagram_message_id="_request_from_Client_to_Embers" textLength="47" x="35" y="115.0566">request</text>
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="38" y1="149.1094" y2="145.1094" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="38" y1="149.1094" y2="153.1094" />
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="28" x2="108" y1="149.1094" y2="149.1094" />
<text class="sequence_diagram_clickable" fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" sequence_diagram_message_id="_response_from_Embers_to_Client" textLength="57" x="45" y="144.3672">response</text>
</g>
</svg>
</div>
</section>
<section class="interestingGivens">
<h3 class="logKey">Interesting Givens</h3>
<table class="interestingGivens">
<tr>
<th class="key">Expected Query Name To Run</th>
<td class="interestingGiven">noRows</td>
</tr>
<tr>
<th class="key">Expected Query Sql To Run</th>
<td class="interestingGiven">select * from queries where name = 'missing'</td>
</tr>
<tr>
<th class="key">Url</th>
<td class="interestingGiven">http://localhost:8001/embers/query/noRows</td>
</tr>
</table>
</section>
<footer>
<section class="interactions">
<details>
<summary>Captured Interactions</summary>
<details class="interaction">
<summary class="logKey" logkey="_request_from_Client_to_Embers"> request from Client to Embers</summary>
<div contenteditable="true" ondblclick="document.execCommand('selectAll',false,null)"
class="logValue highlight HttpRequestWrapper">GET http://localhost:8001/embers/query/noRows
Headers: null
Body: null</div>
</details>
<details class="interaction">
<summary class="logKey" logkey="_response_from_Embers_to_Client"> response from Embers to Client</summary>
<div contenteditable="true" ondblclick="document.execCommand('selectAll',false,null)"
class="logValue highlight HttpResponseWrapper">Response Code: 200
Headers: {null=[HTTP/1.1 200 OK], Server=[Jetty(9.3.0.M1)], Content-Length=[0], Date=[Mon, 05 Apr 2021 09:50:31 GMT], Content-Type=[text/html]}
Body: </div>
</details>
</details>
</section>
</footer>
</section>
</section>
</article>
<article class="testmethod section">
<header>
<a id="showAllAvailableQueries"></a>
<h2 class="section-header">Show all available queries</h2>
</header>
<section class="section-body">
<pre class="notes">Embers has a query to show all available queries</pre>
<section class="scenario" id="-1522219551_0_-966258421">
<section class="specification">
<h2>Specification<a id=""></a></h2>
<pre class="highlight specification">Given embers has a query that returns no rows
Given embers has a query that shows all queries
When http get request for all_queries
Then http response code is 200
Then http response body all of contains string "name" contains string "description" contains string "sql" contains string all_queries</pre>
</section>
<section class="results">
<h3 class="logKey">Test result:</h3>
<pre class='highlight results test-passed icon-check'>Test passed</pre>
</section>
<section class="diagram">
<h3 logkey="Sequence_Diagram">Sequence Diagram</h3>
<div class="highlight SvgWrapper" ><?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" contentScriptType="application/ecmascript"
contentStyleType="text/css" height="251px" preserveAspectRatio="none"
style="width:153px;height:251px;" version="1.1" viewBox="0 0 153 251"
width="153px" zoomAndPan="magnify">
<defs>
<filter height="300%" id="f1rrjxfak1hqrk" width="300%" x="-1" y="-1">
<feGaussianBlur result="blurOut" stdDeviation="2.0" />
<feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0" />
<feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3" />
<feBlend in="SourceGraphic" in2="blurOut3" mode="normal" />
</filter>
</defs>
<g>
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="28" x2="28" y1="88.4883" y2="167.1094" />
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="108.5" x2="108.5" y1="88.4883" y2="167.1094" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="40" x="5" y="85.5352">Client</text>
<ellipse cx="28" cy="15" fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;" />
<path d="M28,23 L28,50 M15,31 L41,31 M28,50 L15,65 M28,50 L41,65 " fill="none" filter="url(#f1rrjxfak1hqrk)" style="stroke:#A80036;stroke-width:2.0;" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="40" x="5" y="179.6445">Client</text>
<ellipse cx="28" cy="192.5977" fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;" />
<path d="M28,200.5977 L28,227.5977 M15,208.5977 L41,208.5977 M28,227.5977 L15,242.5977 M28,227.5977 L41,242.5977 " fill="none" filter="url(#f1rrjxfak1hqrk)" style="stroke:#A80036;stroke-width:2.0;" />
<rect fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="65" x="74.5" y="53" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="81.5" y="73.5352">Embers</text>
<rect fill="#FEFECE" filter="url(#f1rrjxfak1hqrk)" height="30.4883" style="stroke:#A80036;stroke-width:1.5;" width="65" x="74.5" y="166.1094" />
<text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="81.5" y="186.6445">Embers</text>
<line style="stroke:#A80036;stroke-width:1.0;" x1="107" x2="97" y1="119.7988" y2="115.7988" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="107" x2="97" y1="119.7988" y2="123.7988" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="108" y1="119.7988" y2="119.7988" />
<text class="sequence_diagram_clickable" fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" sequence_diagram_message_id="_request_from_Client_to_Embers" textLength="47" x="35" y="115.0566">request</text>
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="38" y1="149.1094" y2="145.1094" />
<line style="stroke:#A80036;stroke-width:1.0;" x1="28" x2="38" y1="149.1094" y2="153.1094" />
<line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="28" x2="108" y1="149.1094" y2="149.1094" />
<text class="sequence_diagram_clickable" fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" sequence_diagram_message_id="_response_from_Embers_to_Client" textLength="57" x="45" y="144.3672">response</text>
</g>
</svg>
</div>
</section>
<section class="interestingGivens">
<h3 class="logKey">Interesting Givens</h3>
<table class="interestingGivens">
<tr>
<th class="key">Expected Query Name To Run</th>
<td class="interestingGiven">allQueries</td>
</tr>
<tr>
<th class="key">Expected Query Sql To Run</th>
<td class="interestingGiven">select id, name, description, sql from queries order by name</td>
</tr>
<tr>
<th class="key">Url</th>
<td class="interestingGiven">http://localhost:8001/embers/query/allQueries</td>
</tr>
</table>
</section>
<footer>
<section class="interactions">
<details>
<summary>Captured Interactions</summary>
<details class="interaction">
<summary class="logKey" logkey="_request_from_Client_to_Embers"> request from Client to Embers</summary>
<div contenteditable="true" ondblclick="document.execCommand('selectAll',false,null)"
class="logValue highlight HttpRequestWrapper">GET http://localhost:8001/embers/query/allQueries
Headers: null
Body: null</div>
</details>
<details class="interaction">
<summary class="logKey" logkey="_response_from_Embers_to_Client"> response from Embers to Client</summary>
<div contenteditable="true" ondblclick="document.execCommand('selectAll',false,null)"
class="logValue highlight HttpResponseWrapper">Response Code: 200
Headers: {null=[HTTP/1.1 200 OK], Server=[Jetty(9.3.0.M1)], Content-Length=[242], Date=[Mon, 05 Apr 2021 09:50:30 GMT], Content-Type=[text/html]}
Body: name,description,id,sql
allQueries,Shows all the available queries,3,select id, name, description, sql from queries order by name
noRows,Show what happens when query runs but no data is selected,2,select * from queries where name = 'missing'
</div>
</details>
</details>
</section>
</footer>
</section>
</section>
</article>
</main>
<footer>
<div class="footer">
<script src="xregexp.js" type="text/javascript"></script>
<script src="yatspec.js" type="text/javascript"></script>
</div>
</footer>
</body>
</html>