Merge lp:~stolowski/unity-scope-click/fake-json-cpp into lp:unity-scope-click/devel
- fake-json-cpp
- Merge into devel
Proposed by
Paweł Stołowski
Status: | Merged |
---|---|
Approved by: | Alejandro J. Cura |
Approved revision: | 322 |
Merged at revision: | 322 |
Proposed branch: | lp:~stolowski/unity-scope-click/fake-json-cpp |
Merge into: | lp:unity-scope-click/devel |
Diff against target: |
1263 lines (+643/-595) 3 files modified
libclickscope/tests/CMakeLists.txt (+1/-1) libclickscope/tests/fake_json.cpp (+626/-0) libclickscope/tests/fake_json.h (+16/-594) |
To merge this branch: | bzr merge lp:~stolowski/unity-scope-click/fake-json-cpp |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alejandro J. Cura (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+226423@code.launchpad.net |
Commit message
Moved fake json strings into a cpp file.
Description of the change
Moved fake json strings into a cpp file. This speeds compilation a little bit when modifying any of these strings and recompiling (without that change, any update to fake_json.h triggered recompilation of a number of test files that included it).
To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : | # |
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'libclickscope/tests/CMakeLists.txt' | |||
2 | --- libclickscope/tests/CMakeLists.txt 2014-06-26 17:52:31 +0000 | |||
3 | +++ libclickscope/tests/CMakeLists.txt 2014-07-11 09:18:16 +0000 | |||
4 | @@ -20,7 +20,7 @@ | |||
5 | 20 | mock_network_access_manager.h | 20 | mock_network_access_manager.h |
6 | 21 | mock_ubuntuone_credentials.h | 21 | mock_ubuntuone_credentials.h |
7 | 22 | mock_webclient.h | 22 | mock_webclient.h |
9 | 23 | 23 | fake_json.cpp | |
10 | 24 | test_bootstrap.cpp | 24 | test_bootstrap.cpp |
11 | 25 | test_configuration.cpp | 25 | test_configuration.cpp |
12 | 26 | test_departments.cpp | 26 | test_departments.cpp |
13 | 27 | 27 | ||
14 | === added file 'libclickscope/tests/fake_json.cpp' | |||
15 | --- libclickscope/tests/fake_json.cpp 1970-01-01 00:00:00 +0000 | |||
16 | +++ libclickscope/tests/fake_json.cpp 2014-07-11 09:18:16 +0000 | |||
17 | @@ -0,0 +1,626 @@ | |||
18 | 1 | /* | ||
19 | 2 | * Copyright (C) 2014 Canonical Ltd. | ||
20 | 3 | * | ||
21 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
22 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
23 | 6 | * by the Free Software Foundation. | ||
24 | 7 | * | ||
25 | 8 | * This program is distributed in the hope that it will be useful, but | ||
26 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
27 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
28 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
29 | 12 | * | ||
30 | 13 | * You should have received a copy of the GNU General Public License along | ||
31 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
32 | 15 | * | ||
33 | 16 | * In addition, as a special exception, the copyright holders give | ||
34 | 17 | * permission to link the code of portions of this program with the | ||
35 | 18 | * OpenSSL library under certain conditions as described in each | ||
36 | 19 | * individual source file, and distribute linked combinations | ||
37 | 20 | * including the two. | ||
38 | 21 | * You must obey the GNU General Public License in all respects | ||
39 | 22 | * for all of the code used other than OpenSSL. If you modify | ||
40 | 23 | * file(s) with this exception, you may extend this exception to your | ||
41 | 24 | * version of the file(s), but you are not obligated to do so. If you | ||
42 | 25 | * do not wish to do so, delete this exception statement from your | ||
43 | 26 | * version. If you delete this exception statement from all source | ||
44 | 27 | * files in the program, then also delete it here. | ||
45 | 28 | */ | ||
46 | 29 | |||
47 | 30 | #include "fake_json.h" | ||
48 | 31 | |||
49 | 32 | const std::string FAKE_JSON_REVIEWS_RESULT_ONE = R"foo( | ||
50 | 33 | [ | ||
51 | 34 | { | ||
52 | 35 | "date_created": "2014-01-28T09:09:47.218Z", | ||
53 | 36 | "date_deleted": null, | ||
54 | 37 | "hide": false, | ||
55 | 38 | "id": 1, | ||
56 | 39 | "language": "en", | ||
57 | 40 | "package_name": "com.example.fakepackage", | ||
58 | 41 | "rating": 4, | ||
59 | 42 | "review_text": "It is ok.", | ||
60 | 43 | "reviewer_displayname": "Reviewer", | ||
61 | 44 | "reviewer_username": "reviewer", | ||
62 | 45 | "summary": "Review Summary", | ||
63 | 46 | "usefulness_favorable": 0, | ||
64 | 47 | "usefulness_total": 0, | ||
65 | 48 | "version": "0.2" | ||
66 | 49 | } | ||
67 | 50 | ] | ||
68 | 51 | )foo"; | ||
69 | 52 | |||
70 | 53 | const std::string FAKE_JSON_SEARCH_RESULT_ONE = R"foo({ | ||
71 | 54 | "_embedded": { | ||
72 | 55 | "clickindex:package": [ | ||
73 | 56 | { | ||
74 | 57 | "name": "org.example.awesomelauncher", | ||
75 | 58 | "title": "Awesome Launcher", | ||
76 | 59 | "description": "This is an awesome launcher.", | ||
77 | 60 | "price": 1.99, | ||
78 | 61 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
79 | 62 | "_links": { | ||
80 | 63 | "self": { | ||
81 | 64 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
82 | 65 | } | ||
83 | 66 | } | ||
84 | 67 | } | ||
85 | 68 | ] | ||
86 | 69 | } | ||
87 | 70 | } | ||
88 | 71 | )foo"; | ||
89 | 72 | |||
90 | 73 | const std::string FAKE_JSON_SEARCH_RESULT_MISSING_DATA = R"foo({ | ||
91 | 74 | "_embedded": { | ||
92 | 75 | "clickindex:package": [ | ||
93 | 76 | { | ||
94 | 77 | "name": "org.example.awesomelauncher", | ||
95 | 78 | "title": "Awesome Launcher", | ||
96 | 79 | "description": "This is an awesome launcher.", | ||
97 | 80 | "_links": { | ||
98 | 81 | "self": { | ||
99 | 82 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
100 | 83 | } | ||
101 | 84 | } | ||
102 | 85 | } | ||
103 | 86 | ] | ||
104 | 87 | } | ||
105 | 88 | } | ||
106 | 89 | )foo"; | ||
107 | 90 | |||
108 | 91 | const std::string FAKE_JSON_SEARCH_RESULT_MANY = R"foo({ | ||
109 | 92 | "_embedded": { | ||
110 | 93 | "clickindex:package": [ | ||
111 | 94 | { | ||
112 | 95 | "name": "org.example.awesomelauncher", | ||
113 | 96 | "title": "Awesome Launcher", | ||
114 | 97 | "description": "This is an awesome launcher.", | ||
115 | 98 | "price": 1.99, | ||
116 | 99 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
117 | 100 | "_links": { | ||
118 | 101 | "self": { | ||
119 | 102 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
120 | 103 | } | ||
121 | 104 | } | ||
122 | 105 | }, | ||
123 | 106 | { | ||
124 | 107 | "name": "org.example.fantastiqueapp", | ||
125 | 108 | "title": "Fantastic App", | ||
126 | 109 | "description": "This is a fantasticc app.", | ||
127 | 110 | "price": 0.0, | ||
128 | 111 | "icon_url": "http://assets.ubuntu.com/sites/ubuntu/504/u/img/ubuntu/features/icon-find-more-apps-64x64.png", | ||
129 | 112 | "_links": { | ||
130 | 113 | "self": { | ||
131 | 114 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.fantasticapp" | ||
132 | 115 | } | ||
133 | 116 | } | ||
134 | 117 | }, | ||
135 | 118 | { | ||
136 | 119 | "name": "org.example.awesomewidget", | ||
137 | 120 | "title": "Awesome Widget", | ||
138 | 121 | "description": "This is an awesome widget.", | ||
139 | 122 | "price": 1.99, | ||
140 | 123 | "icon_url": "http://assets.ubuntu.com/sites/ubuntu/504/u/img/ubuntu/features/icon-photos-and-videos-64x64.png", | ||
141 | 124 | "_links": { | ||
142 | 125 | "self": { | ||
143 | 126 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
144 | 127 | } | ||
145 | 128 | } | ||
146 | 129 | } | ||
147 | 130 | ] | ||
148 | 131 | } | ||
149 | 132 | } | ||
150 | 133 | )foo"; | ||
151 | 134 | |||
152 | 135 | const std::string FAKE_JSON_SEARCH_RESULT_RECOMMENDS = R"foo({ | ||
153 | 136 | "_embedded": { | ||
154 | 137 | "clickindex:package": [ | ||
155 | 138 | { | ||
156 | 139 | "name": "org.example.awesomelauncher", | ||
157 | 140 | "title": "Awesome Launcher", | ||
158 | 141 | "description": "This is an awesome launcher.", | ||
159 | 142 | "price": 1.99, | ||
160 | 143 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
161 | 144 | "_links": { | ||
162 | 145 | "self": { | ||
163 | 146 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
164 | 147 | } | ||
165 | 148 | } | ||
166 | 149 | } | ||
167 | 150 | ], | ||
168 | 151 | "clickindex:recommendation": [ | ||
169 | 152 | { | ||
170 | 153 | "name": "org.example.awesomelauncher2", | ||
171 | 154 | "title": "Awesome Launcher 2", | ||
172 | 155 | "description": "This is an another awesome launcher.", | ||
173 | 156 | "price": 1.99, | ||
174 | 157 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
175 | 158 | "_links": { | ||
176 | 159 | "self": { | ||
177 | 160 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher2" | ||
178 | 161 | } | ||
179 | 162 | } | ||
180 | 163 | } | ||
181 | 164 | ] | ||
182 | 165 | } | ||
183 | 166 | } | ||
184 | 167 | )foo"; | ||
185 | 168 | |||
186 | 169 | const std::string FAKE_JSON_PACKAGE_DETAILS = R"foo( | ||
187 | 170 | { | ||
188 | 171 | "name": "ar.com.beuno.wheather-touch", | ||
189 | 172 | "icon_url": "http://developer.staging.ubuntu.com/site_media/appmedia/2013/07/weather-icone-6797-64.png", | ||
190 | 173 | "title": "\u1F4A9 Weather", | ||
191 | 174 | "description": "\u1F4A9 Weather\nA weather application.", | ||
192 | 175 | "download_url": "https://public.apps.staging.ubuntu.com/download/ar.com.beuno/wheather-touch/ar.com.beuno.wheather-touch-0.2", | ||
193 | 176 | "rating": 3.5, | ||
194 | 177 | "keywords": "these, are, key, words", | ||
195 | 178 | "terms_of_service": "tos", | ||
196 | 179 | "license": "Proprietary", | ||
197 | 180 | "publisher": "Beuno", | ||
198 | 181 | "screenshot_url": "sshot0", | ||
199 | 182 | "screenshot_urls": ["sshot1", "sshot2"], | ||
200 | 183 | "binary_filesize": 177582, | ||
201 | 184 | "version": "0.2", | ||
202 | 185 | "framework": "None", | ||
203 | 186 | |||
204 | 187 | "website": "", | ||
205 | 188 | "support_url": "http://beuno.com.ar", | ||
206 | 189 | "price": 1.99, | ||
207 | 190 | "license_key_path": "", | ||
208 | 191 | "click_version": "0.1", | ||
209 | 192 | "company_name": "", | ||
210 | 193 | "icon_urls": { | ||
211 | 194 | "64": "http://developer.staging.ubuntu.com/site_media/appmedia/2013/07/weather-icone-6797-64.png" | ||
212 | 195 | }, | ||
213 | 196 | "requires_license_key": false, | ||
214 | 197 | "date_published": "2013-07-16T21:50:34.874000" | ||
215 | 198 | } | ||
216 | 199 | )foo"; | ||
217 | 200 | |||
218 | 201 | const std::string FAKE_JSON_BOOTSTRAP = R"( | ||
219 | 202 | { | ||
220 | 203 | "_embedded": { | ||
221 | 204 | "clickindex:department": [ | ||
222 | 205 | { | ||
223 | 206 | "has_children": false, | ||
224 | 207 | "_links": { | ||
225 | 208 | "self": { | ||
226 | 209 | "href": "https://search.apps.staging.ubuntu.com/api/v1/departments/fake-subdepartment"} | ||
227 | 210 | }, | ||
228 | 211 | "name": "Fake Subdepartment", "slug": "fake-subdepartment"} | ||
229 | 212 | ], | ||
230 | 213 | "clickindex:highlight": [ | ||
231 | 214 | { | ||
232 | 215 | "_embedded": { | ||
233 | 216 | "clickindex:package": [ | ||
234 | 217 | { | ||
235 | 218 | "publisher": "Awesome Widget Company", | ||
236 | 219 | "name": "org.example.awesomelauncher", | ||
237 | 220 | "title": "Awesome Launcher", | ||
238 | 221 | "price": 1.99, | ||
239 | 222 | "_links": { | ||
240 | 223 | "self": { | ||
241 | 224 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher"} | ||
242 | 225 | }, | ||
243 | 226 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
244 | 227 | }, | ||
245 | 228 | { | ||
246 | 229 | "publisher": "Awesome Widget Company", | ||
247 | 230 | "name": "org.example.awesomewidget", | ||
248 | 231 | "title": "Awesome Widget", "price": 1.99, | ||
249 | 232 | "_links": { | ||
250 | 233 | "self": { | ||
251 | 234 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
252 | 235 | } | ||
253 | 236 | }, | ||
254 | 237 | "icon": "http://example.org/media/org.example.awesomewidget/icons/icon16.png"} | ||
255 | 238 | ] | ||
256 | 239 | }, | ||
257 | 240 | "_links": { | ||
258 | 241 | "self": { | ||
259 | 242 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/top-apps" | ||
260 | 243 | } | ||
261 | 244 | }, | ||
262 | 245 | "name": "Top Apps", "slug": "top-apps" | ||
263 | 246 | }, | ||
264 | 247 | { | ||
265 | 248 | "_embedded": { | ||
266 | 249 | "clickindex:package": [ | ||
267 | 250 | { | ||
268 | 251 | "publisher": "Awesome Widget Company", | ||
269 | 252 | "name": "org.example.awesomelauncher", | ||
270 | 253 | "title": "Awesome Launcher", | ||
271 | 254 | "price": 1.99, | ||
272 | 255 | "_links": { | ||
273 | 256 | "self": { | ||
274 | 257 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
275 | 258 | } | ||
276 | 259 | }, | ||
277 | 260 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
278 | 261 | }, | ||
279 | 262 | { | ||
280 | 263 | "publisher": "Awesome Widget Company", | ||
281 | 264 | "name": "org.example.awesomewidget", | ||
282 | 265 | "title": "Awesome Widget", | ||
283 | 266 | "price": 1.99, | ||
284 | 267 | "_links": { | ||
285 | 268 | "self": { | ||
286 | 269 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
287 | 270 | } | ||
288 | 271 | }, | ||
289 | 272 | "icon": "http://example.org/media/org.example.awesomewidget/icons/icon16.png" | ||
290 | 273 | } | ||
291 | 274 | ] | ||
292 | 275 | }, | ||
293 | 276 | "_links": { | ||
294 | 277 | "self": { | ||
295 | 278 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/most-purchased" | ||
296 | 279 | } | ||
297 | 280 | }, | ||
298 | 281 | "name": "Most Purchased", | ||
299 | 282 | "slug": "most-purchased" | ||
300 | 283 | }, | ||
301 | 284 | { | ||
302 | 285 | "_embedded": { | ||
303 | 286 | "clickindex:package": [ | ||
304 | 287 | { | ||
305 | 288 | "publisher": "Awesome Widget Company", | ||
306 | 289 | "name": "org.example.awesomelauncher", | ||
307 | 290 | "title": "Awesome Launcher", | ||
308 | 291 | "price": 1.99, | ||
309 | 292 | "_links": { | ||
310 | 293 | "self": { | ||
311 | 294 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
312 | 295 | } | ||
313 | 296 | }, | ||
314 | 297 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
315 | 298 | }, | ||
316 | 299 | { | ||
317 | 300 | "publisher": "Awesome Widget Company", | ||
318 | 301 | "name": "org.example.awesomewidget", | ||
319 | 302 | "title": "Awesome Widget", | ||
320 | 303 | "price": 1.99, | ||
321 | 304 | "_links": { | ||
322 | 305 | "self": { | ||
323 | 306 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
324 | 307 | } | ||
325 | 308 | }, | ||
326 | 309 | "icon": "http://example.org/media/org.example.awesomewidget/icons/icon16.png" | ||
327 | 310 | } | ||
328 | 311 | ] | ||
329 | 312 | }, | ||
330 | 313 | "_links": { | ||
331 | 314 | "self": { | ||
332 | 315 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/new-releases" | ||
333 | 316 | } | ||
334 | 317 | }, | ||
335 | 318 | "name": "New Releases", | ||
336 | 319 | "slug": "new-releases" | ||
337 | 320 | } | ||
338 | 321 | ] | ||
339 | 322 | }, "has_children": true, | ||
340 | 323 | "_links": { | ||
341 | 324 | "curies": [ | ||
342 | 325 | { | ||
343 | 326 | "href": "https://search.apps.staging.ubuntu.com/docs/v1/relations.html{#rel}", | ||
344 | 327 | "name": "clickindex", "templated": true | ||
345 | 328 | } | ||
346 | 329 | ], | ||
347 | 330 | "self": { | ||
348 | 331 | "href": "https://search.apps.staging.ubuntu.com/api/v1/departments/fake-department-with-subdepartments" | ||
349 | 332 | }, | ||
350 | 333 | "collection": { | ||
351 | 334 | "href": "https://search.apps.staging.ubuntu.com/api/v1/departments" | ||
352 | 335 | } | ||
353 | 336 | }, | ||
354 | 337 | "name": "Fake Department With Subdepartments", | ||
355 | 338 | "slug": "fake-department-with-subdepartments" | ||
356 | 339 | })"; | ||
357 | 340 | |||
358 | 341 | const std::string FAKE_JSON_BROKEN_BOOTSTRAP = R"( | ||
359 | 342 | { | ||
360 | 343 | "_embedded": { | ||
361 | 344 | "clickindex:department": [ | ||
362 | 345 | { | ||
363 | 346 | "name": "Broken department" | ||
364 | 347 | } | ||
365 | 348 | ], | ||
366 | 349 | "clickindex:highlight": [ | ||
367 | 350 | { | ||
368 | 351 | "_embedded": { | ||
369 | 352 | "clickindex:package": [ | ||
370 | 353 | { | ||
371 | 354 | "publisher": "Awesome Widget Company", | ||
372 | 355 | "name": "org.example.awesomelauncher", | ||
373 | 356 | "title": "Awesome Launcher", | ||
374 | 357 | "price": 1.99, | ||
375 | 358 | "_links": { | ||
376 | 359 | "self": { | ||
377 | 360 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher"} | ||
378 | 361 | }, | ||
379 | 362 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
380 | 363 | } | ||
381 | 364 | ] | ||
382 | 365 | }, | ||
383 | 366 | "_links": { | ||
384 | 367 | "self": { | ||
385 | 368 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/top-apps" | ||
386 | 369 | } | ||
387 | 370 | }, | ||
388 | 371 | "name": "Top Apps", | ||
389 | 372 | "slug": "top-apps" | ||
390 | 373 | }, | ||
391 | 374 | { | ||
392 | 375 | "_embedded": { | ||
393 | 376 | "clickindex:package": [ | ||
394 | 377 | { | ||
395 | 378 | "publisher": "Awesome Widget Company", | ||
396 | 379 | "name": "org.example.awesomelauncher", | ||
397 | 380 | "title": "Awesome Launcher", | ||
398 | 381 | "price": 1.99, | ||
399 | 382 | "_links": { | ||
400 | 383 | "self": { | ||
401 | 384 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
402 | 385 | } | ||
403 | 386 | }, | ||
404 | 387 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
405 | 388 | } | ||
406 | 389 | ] | ||
407 | 390 | }, | ||
408 | 391 | "____name": "Broken highlight" | ||
409 | 392 | } | ||
410 | 393 | ] | ||
411 | 394 | } | ||
412 | 395 | })"; | ||
413 | 396 | |||
414 | 397 | const std::string FAKE_JSON_DEPARTMENTS_ONLY = R"( | ||
415 | 398 | { | ||
416 | 399 | "_links": { | ||
417 | 400 | "self": { | ||
418 | 401 | "href": "https://search.apps.ubuntu.com/api/v1/departments" | ||
419 | 402 | }, | ||
420 | 403 | "curies": [ | ||
421 | 404 | { | ||
422 | 405 | "name": "clickindex", | ||
423 | 406 | "href": "https://search.apps.ubuntu.com/docs/v1/relations.html{#rel}", | ||
424 | 407 | "templated": true | ||
425 | 408 | } | ||
426 | 409 | ] | ||
427 | 410 | }, | ||
428 | 411 | "_embedded": { | ||
429 | 412 | "clickindex:department": [ | ||
430 | 413 | { | ||
431 | 414 | "name": "Games", | ||
432 | 415 | "_links": { | ||
433 | 416 | "self": { | ||
434 | 417 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Games" | ||
435 | 418 | } | ||
436 | 419 | }, | ||
437 | 420 | "_embedded": { | ||
438 | 421 | "clickindex:department": [ | ||
439 | 422 | { | ||
440 | 423 | "name": "Board Games", | ||
441 | 424 | "_links": { | ||
442 | 425 | "self": { | ||
443 | 426 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Games/Board+Games" | ||
444 | 427 | } | ||
445 | 428 | } | ||
446 | 429 | } | ||
447 | 430 | ] | ||
448 | 431 | } | ||
449 | 432 | }, | ||
450 | 433 | { | ||
451 | 434 | "name": "Graphics", | ||
452 | 435 | "_links": { | ||
453 | 436 | "self": { | ||
454 | 437 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Graphics" | ||
455 | 438 | } | ||
456 | 439 | }, | ||
457 | 440 | "_embedded": { | ||
458 | 441 | "clickindex:department": [ | ||
459 | 442 | { | ||
460 | 443 | "name": "Drawing", | ||
461 | 444 | "_links": { | ||
462 | 445 | "self": { | ||
463 | 446 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Graphics/Drawing" | ||
464 | 447 | } | ||
465 | 448 | } | ||
466 | 449 | } | ||
467 | 450 | ] | ||
468 | 451 | } | ||
469 | 452 | }, | ||
470 | 453 | { | ||
471 | 454 | "name": "Internet", | ||
472 | 455 | "_links": { | ||
473 | 456 | "self": { | ||
474 | 457 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet" | ||
475 | 458 | } | ||
476 | 459 | }, | ||
477 | 460 | "_embedded": { | ||
478 | 461 | "clickindex:department": [ | ||
479 | 462 | { | ||
480 | 463 | "name": "Chat", | ||
481 | 464 | "_links": { | ||
482 | 465 | "self": { | ||
483 | 466 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet/Chat" | ||
484 | 467 | } | ||
485 | 468 | } | ||
486 | 469 | }, | ||
487 | 470 | { | ||
488 | 471 | "name": "Mail", | ||
489 | 472 | "_links": { | ||
490 | 473 | "self": { | ||
491 | 474 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet/Mail" | ||
492 | 475 | } | ||
493 | 476 | } | ||
494 | 477 | }, | ||
495 | 478 | { | ||
496 | 479 | "name": "Web Browsers", | ||
497 | 480 | "_links": { | ||
498 | 481 | "self": { | ||
499 | 482 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet/Web+Browsers" | ||
500 | 483 | } | ||
501 | 484 | } | ||
502 | 485 | } | ||
503 | 486 | ] | ||
504 | 487 | } | ||
505 | 488 | } | ||
506 | 489 | ] | ||
507 | 490 | } | ||
508 | 491 | })"; | ||
509 | 492 | |||
510 | 493 | const std::string FAKE_JSON_BROKEN_DEPARTMENTS = R"( | ||
511 | 494 | { | ||
512 | 495 | "_links": { | ||
513 | 496 | "self": { | ||
514 | 497 | "href": "https://search.apps.ubuntu.com/api/v1/departments" | ||
515 | 498 | }, | ||
516 | 499 | "curies": [ | ||
517 | 500 | { | ||
518 | 501 | "name": "clickindex", | ||
519 | 502 | "href": "https://search.apps.ubuntu.com/docs/v1/relations.html{#rel}", | ||
520 | 503 | "templated": true | ||
521 | 504 | } | ||
522 | 505 | ] | ||
523 | 506 | }, | ||
524 | 507 | "_embedded": { | ||
525 | 508 | "clickindex:department": [ | ||
526 | 509 | { | ||
527 | 510 | "name": "Games", | ||
528 | 511 | "_links": { | ||
529 | 512 | "self": { | ||
530 | 513 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Games" | ||
531 | 514 | } | ||
532 | 515 | }, | ||
533 | 516 | "_embedded": { | ||
534 | 517 | "clickindex:department": [ | ||
535 | 518 | { | ||
536 | 519 | "name": "Broken department" | ||
537 | 520 | } | ||
538 | 521 | ] | ||
539 | 522 | } | ||
540 | 523 | } | ||
541 | 524 | ] | ||
542 | 525 | } | ||
543 | 526 | })"; | ||
544 | 527 | |||
545 | 528 | const std::string FAKE_JSON_MANIFEST_REMOVABLE = R"foo( | ||
546 | 529 | { | ||
547 | 530 | "_removable": 1, | ||
548 | 531 | "name": "com.example.fake", | ||
549 | 532 | "version": "0.1", | ||
550 | 533 | "hooks": { | ||
551 | 534 | "fake-app": { | ||
552 | 535 | "desktop": "fake-app.desktop" | ||
553 | 536 | } | ||
554 | 537 | } | ||
555 | 538 | } | ||
556 | 539 | )foo"; | ||
557 | 540 | |||
558 | 541 | const std::string FAKE_JSON_MANIFEST_NONREMOVABLE = R"foo( | ||
559 | 542 | { | ||
560 | 543 | "_removable": 0, | ||
561 | 544 | "name": "com.example.fake", | ||
562 | 545 | "version": "0.1", | ||
563 | 546 | "hooks": { | ||
564 | 547 | "fake-app": { | ||
565 | 548 | "desktop": "fake-app.desktop" | ||
566 | 549 | } | ||
567 | 550 | } | ||
568 | 551 | } | ||
569 | 552 | )foo"; | ||
570 | 553 | |||
571 | 554 | const std::string FAKE_JSON_MANIFEST_ONE_APP = R"foo( | ||
572 | 555 | { | ||
573 | 556 | "_removable": 1, | ||
574 | 557 | "name": "com.example.fake-app", | ||
575 | 558 | "version": "0.1", | ||
576 | 559 | "hooks": { | ||
577 | 560 | "fake-app": { | ||
578 | 561 | "apparmor": "fake-app.json", | ||
579 | 562 | "desktop": "fake-app.desktop" | ||
580 | 563 | } | ||
581 | 564 | } | ||
582 | 565 | } | ||
583 | 566 | )foo"; | ||
584 | 567 | |||
585 | 568 | const std::string FAKE_JSON_MANIFEST_ONE_SCOPE = R"foo( | ||
586 | 569 | { | ||
587 | 570 | "_removable": 1, | ||
588 | 571 | "name": "com.example.fake-scope", | ||
589 | 572 | "version": "0.1", | ||
590 | 573 | "hooks": { | ||
591 | 574 | "fake-scope": { | ||
592 | 575 | "apparmor": "scope-security.json", | ||
593 | 576 | "scope": "fake-scope" | ||
594 | 577 | } | ||
595 | 578 | } | ||
596 | 579 | } | ||
597 | 580 | )foo"; | ||
598 | 581 | |||
599 | 582 | const std::string FAKE_JSON_MANIFEST_ONE_APP_ONE_SCOPE = R"foo( | ||
600 | 583 | { | ||
601 | 584 | "_removable": 1, | ||
602 | 585 | "name": "com.example.fake-1app-1scope", | ||
603 | 586 | "version": "0.1", | ||
604 | 587 | "hooks": { | ||
605 | 588 | "fake-app": { | ||
606 | 589 | "apparmor": "fake-app.json", | ||
607 | 590 | "desktop": "fake-app.desktop" | ||
608 | 591 | }, | ||
609 | 592 | "fake-scope": { | ||
610 | 593 | "apparmor": "scope-security.json", | ||
611 | 594 | "scope": "fake-scope" | ||
612 | 595 | } | ||
613 | 596 | } | ||
614 | 597 | } | ||
615 | 598 | )foo"; | ||
616 | 599 | |||
617 | 600 | const std::string FAKE_JSON_MANIFEST_TWO_APPS_TWO_SCOPES = R"foo( | ||
618 | 601 | { | ||
619 | 602 | "_removable": 1, | ||
620 | 603 | "name": "com.example.fake-2apps-2scopes", | ||
621 | 604 | "version": "0.1", | ||
622 | 605 | "hooks": { | ||
623 | 606 | "fake-app1": { | ||
624 | 607 | "apparmor": "fake-app1.json", | ||
625 | 608 | "desktop": "fake-app1.desktop" | ||
626 | 609 | }, | ||
627 | 610 | "fake-app2": { | ||
628 | 611 | "apparmor": "fake-app2.json", | ||
629 | 612 | "desktop": "fake-app2.desktop" | ||
630 | 613 | }, | ||
631 | 614 | "fake-scope1": { | ||
632 | 615 | "apparmor": "scope-security1.json", | ||
633 | 616 | "scope": "fake-scope1" | ||
634 | 617 | }, | ||
635 | 618 | "fake-scope2": { | ||
636 | 619 | "apparmor": "scope-security1.json", | ||
637 | 620 | "scope": "fake-scope2" | ||
638 | 621 | } | ||
639 | 622 | } | ||
640 | 623 | } | ||
641 | 624 | )foo"; | ||
642 | 625 | |||
643 | 626 | |||
644 | 0 | 627 | ||
645 | === modified file 'libclickscope/tests/fake_json.h' | |||
646 | --- libclickscope/tests/fake_json.h 2014-06-26 17:52:31 +0000 | |||
647 | +++ libclickscope/tests/fake_json.h 2014-07-11 09:18:16 +0000 | |||
648 | @@ -32,599 +32,21 @@ | |||
649 | 32 | 32 | ||
650 | 33 | #include <string> | 33 | #include <string> |
651 | 34 | 34 | ||
1246 | 35 | 35 | extern const std::string FAKE_JSON_REVIEWS_RESULT_ONE; | |
1247 | 36 | const std::string FAKE_JSON_REVIEWS_RESULT_ONE = R"foo( | 36 | extern const std::string FAKE_JSON_SEARCH_RESULT_ONE; |
1248 | 37 | [ | 37 | extern const std::string FAKE_JSON_SEARCH_RESULT_MISSING_DATA; |
1249 | 38 | { | 38 | extern const std::string FAKE_JSON_SEARCH_RESULT_MANY; |
1250 | 39 | "date_created": "2014-01-28T09:09:47.218Z", | 39 | extern const std::string FAKE_JSON_SEARCH_RESULT_RECOMMENDS; |
1251 | 40 | "date_deleted": null, | 40 | extern const std::string FAKE_JSON_PACKAGE_DETAILS; |
1252 | 41 | "hide": false, | 41 | extern const std::string FAKE_JSON_BOOTSTRAP; |
1253 | 42 | "id": 1, | 42 | extern const std::string FAKE_JSON_BROKEN_BOOTSTRAP; |
1254 | 43 | "language": "en", | 43 | extern const std::string FAKE_JSON_DEPARTMENTS_ONLY; |
1255 | 44 | "package_name": "com.example.fakepackage", | 44 | extern const std::string FAKE_JSON_BROKEN_DEPARTMENTS; |
1256 | 45 | "rating": 4, | 45 | extern const std::string FAKE_JSON_MANIFEST_REMOVABLE; |
1257 | 46 | "review_text": "It is ok.", | 46 | extern const std::string FAKE_JSON_MANIFEST_NONREMOVABLE; |
1258 | 47 | "reviewer_displayname": "Reviewer", | 47 | extern const std::string FAKE_JSON_MANIFEST_ONE_APP; |
1259 | 48 | "reviewer_username": "reviewer", | 48 | extern const std::string FAKE_JSON_MANIFEST_ONE_SCOPE; |
1260 | 49 | "summary": "Review Summary", | 49 | extern const std::string FAKE_JSON_MANIFEST_ONE_APP_ONE_SCOPE; |
1261 | 50 | "usefulness_favorable": 0, | 50 | extern const std::string FAKE_JSON_MANIFEST_TWO_APPS_TWO_SCOPES; |
668 | 51 | "usefulness_total": 0, | ||
669 | 52 | "version": "0.2" | ||
670 | 53 | } | ||
671 | 54 | ] | ||
672 | 55 | )foo"; | ||
673 | 56 | |||
674 | 57 | const std::string FAKE_JSON_SEARCH_RESULT_ONE = R"foo({ | ||
675 | 58 | "_embedded": { | ||
676 | 59 | "clickindex:package": [ | ||
677 | 60 | { | ||
678 | 61 | "name": "org.example.awesomelauncher", | ||
679 | 62 | "title": "Awesome Launcher", | ||
680 | 63 | "description": "This is an awesome launcher.", | ||
681 | 64 | "price": 1.99, | ||
682 | 65 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
683 | 66 | "_links": { | ||
684 | 67 | "self": { | ||
685 | 68 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
686 | 69 | } | ||
687 | 70 | } | ||
688 | 71 | } | ||
689 | 72 | ] | ||
690 | 73 | } | ||
691 | 74 | } | ||
692 | 75 | )foo"; | ||
693 | 76 | |||
694 | 77 | const std::string FAKE_JSON_SEARCH_RESULT_MISSING_DATA = R"foo({ | ||
695 | 78 | "_embedded": { | ||
696 | 79 | "clickindex:package": [ | ||
697 | 80 | { | ||
698 | 81 | "name": "org.example.awesomelauncher", | ||
699 | 82 | "title": "Awesome Launcher", | ||
700 | 83 | "description": "This is an awesome launcher.", | ||
701 | 84 | "_links": { | ||
702 | 85 | "self": { | ||
703 | 86 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
704 | 87 | } | ||
705 | 88 | } | ||
706 | 89 | } | ||
707 | 90 | ] | ||
708 | 91 | } | ||
709 | 92 | } | ||
710 | 93 | )foo"; | ||
711 | 94 | |||
712 | 95 | const std::string FAKE_JSON_SEARCH_RESULT_MANY = R"foo({ | ||
713 | 96 | "_embedded": { | ||
714 | 97 | "clickindex:package": [ | ||
715 | 98 | { | ||
716 | 99 | "name": "org.example.awesomelauncher", | ||
717 | 100 | "title": "Awesome Launcher", | ||
718 | 101 | "description": "This is an awesome launcher.", | ||
719 | 102 | "price": 1.99, | ||
720 | 103 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
721 | 104 | "_links": { | ||
722 | 105 | "self": { | ||
723 | 106 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
724 | 107 | } | ||
725 | 108 | } | ||
726 | 109 | }, | ||
727 | 110 | { | ||
728 | 111 | "name": "org.example.fantastiqueapp", | ||
729 | 112 | "title": "Fantastic App", | ||
730 | 113 | "description": "This is a fantasticc app.", | ||
731 | 114 | "price": 0.0, | ||
732 | 115 | "icon_url": "http://assets.ubuntu.com/sites/ubuntu/504/u/img/ubuntu/features/icon-find-more-apps-64x64.png", | ||
733 | 116 | "_links": { | ||
734 | 117 | "self": { | ||
735 | 118 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.fantasticapp" | ||
736 | 119 | } | ||
737 | 120 | } | ||
738 | 121 | }, | ||
739 | 122 | { | ||
740 | 123 | "name": "org.example.awesomewidget", | ||
741 | 124 | "title": "Awesome Widget", | ||
742 | 125 | "description": "This is an awesome widget.", | ||
743 | 126 | "price": 1.99, | ||
744 | 127 | "icon_url": "http://assets.ubuntu.com/sites/ubuntu/504/u/img/ubuntu/features/icon-photos-and-videos-64x64.png", | ||
745 | 128 | "_links": { | ||
746 | 129 | "self": { | ||
747 | 130 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
748 | 131 | } | ||
749 | 132 | } | ||
750 | 133 | } | ||
751 | 134 | ] | ||
752 | 135 | } | ||
753 | 136 | } | ||
754 | 137 | )foo"; | ||
755 | 138 | |||
756 | 139 | const std::string FAKE_JSON_SEARCH_RESULT_RECOMMENDS = R"foo({ | ||
757 | 140 | "_embedded": { | ||
758 | 141 | "clickindex:package": [ | ||
759 | 142 | { | ||
760 | 143 | "name": "org.example.awesomelauncher", | ||
761 | 144 | "title": "Awesome Launcher", | ||
762 | 145 | "description": "This is an awesome launcher.", | ||
763 | 146 | "price": 1.99, | ||
764 | 147 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
765 | 148 | "_links": { | ||
766 | 149 | "self": { | ||
767 | 150 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
768 | 151 | } | ||
769 | 152 | } | ||
770 | 153 | } | ||
771 | 154 | ], | ||
772 | 155 | "clickindex:recommendation": [ | ||
773 | 156 | { | ||
774 | 157 | "name": "org.example.awesomelauncher2", | ||
775 | 158 | "title": "Awesome Launcher 2", | ||
776 | 159 | "description": "This is an another awesome launcher.", | ||
777 | 160 | "price": 1.99, | ||
778 | 161 | "icon_url": "http://software-center.ubuntu.com/site_media/appmedia/2012/09/SPAZ.png", | ||
779 | 162 | "_links": { | ||
780 | 163 | "self": { | ||
781 | 164 | "href": "http://search.apps.ubuntu.com/api/v1/package/org.example.awesomelauncher2" | ||
782 | 165 | } | ||
783 | 166 | } | ||
784 | 167 | } | ||
785 | 168 | ] | ||
786 | 169 | } | ||
787 | 170 | } | ||
788 | 171 | )foo"; | ||
789 | 172 | |||
790 | 173 | const std::string FAKE_JSON_PACKAGE_DETAILS = R"foo( | ||
791 | 174 | { | ||
792 | 175 | "name": "ar.com.beuno.wheather-touch", | ||
793 | 176 | "icon_url": "http://developer.staging.ubuntu.com/site_media/appmedia/2013/07/weather-icone-6797-64.png", | ||
794 | 177 | "title": "\u1F4A9 Weather", | ||
795 | 178 | "description": "\u1F4A9 Weather\nA weather application.", | ||
796 | 179 | "download_url": "https://public.apps.staging.ubuntu.com/download/ar.com.beuno/wheather-touch/ar.com.beuno.wheather-touch-0.2", | ||
797 | 180 | "rating": 3.5, | ||
798 | 181 | "keywords": "these, are, key, words", | ||
799 | 182 | "terms_of_service": "tos", | ||
800 | 183 | "license": "Proprietary", | ||
801 | 184 | "publisher": "Beuno", | ||
802 | 185 | "screenshot_url": "sshot0", | ||
803 | 186 | "screenshot_urls": ["sshot1", "sshot2"], | ||
804 | 187 | "binary_filesize": 177582, | ||
805 | 188 | "version": "0.2", | ||
806 | 189 | "framework": "None", | ||
807 | 190 | |||
808 | 191 | "website": "", | ||
809 | 192 | "support_url": "http://beuno.com.ar", | ||
810 | 193 | "price": 1.99, | ||
811 | 194 | "license_key_path": "", | ||
812 | 195 | "click_version": "0.1", | ||
813 | 196 | "company_name": "", | ||
814 | 197 | "icon_urls": { | ||
815 | 198 | "64": "http://developer.staging.ubuntu.com/site_media/appmedia/2013/07/weather-icone-6797-64.png" | ||
816 | 199 | }, | ||
817 | 200 | "requires_license_key": false, | ||
818 | 201 | "date_published": "2013-07-16T21:50:34.874000" | ||
819 | 202 | } | ||
820 | 203 | )foo"; | ||
821 | 204 | |||
822 | 205 | const std::string FAKE_JSON_BOOTSTRAP = R"( | ||
823 | 206 | { | ||
824 | 207 | "_embedded": { | ||
825 | 208 | "clickindex:department": [ | ||
826 | 209 | { | ||
827 | 210 | "has_children": false, | ||
828 | 211 | "_links": { | ||
829 | 212 | "self": { | ||
830 | 213 | "href": "https://search.apps.staging.ubuntu.com/api/v1/departments/fake-subdepartment"} | ||
831 | 214 | }, | ||
832 | 215 | "name": "Fake Subdepartment", "slug": "fake-subdepartment"} | ||
833 | 216 | ], | ||
834 | 217 | "clickindex:highlight": [ | ||
835 | 218 | { | ||
836 | 219 | "_embedded": { | ||
837 | 220 | "clickindex:package": [ | ||
838 | 221 | { | ||
839 | 222 | "publisher": "Awesome Widget Company", | ||
840 | 223 | "name": "org.example.awesomelauncher", | ||
841 | 224 | "title": "Awesome Launcher", | ||
842 | 225 | "price": 1.99, | ||
843 | 226 | "_links": { | ||
844 | 227 | "self": { | ||
845 | 228 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher"} | ||
846 | 229 | }, | ||
847 | 230 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
848 | 231 | }, | ||
849 | 232 | { | ||
850 | 233 | "publisher": "Awesome Widget Company", | ||
851 | 234 | "name": "org.example.awesomewidget", | ||
852 | 235 | "title": "Awesome Widget", "price": 1.99, | ||
853 | 236 | "_links": { | ||
854 | 237 | "self": { | ||
855 | 238 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
856 | 239 | } | ||
857 | 240 | }, | ||
858 | 241 | "icon": "http://example.org/media/org.example.awesomewidget/icons/icon16.png"} | ||
859 | 242 | ] | ||
860 | 243 | }, | ||
861 | 244 | "_links": { | ||
862 | 245 | "self": { | ||
863 | 246 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/top-apps" | ||
864 | 247 | } | ||
865 | 248 | }, | ||
866 | 249 | "name": "Top Apps", "slug": "top-apps" | ||
867 | 250 | }, | ||
868 | 251 | { | ||
869 | 252 | "_embedded": { | ||
870 | 253 | "clickindex:package": [ | ||
871 | 254 | { | ||
872 | 255 | "publisher": "Awesome Widget Company", | ||
873 | 256 | "name": "org.example.awesomelauncher", | ||
874 | 257 | "title": "Awesome Launcher", | ||
875 | 258 | "price": 1.99, | ||
876 | 259 | "_links": { | ||
877 | 260 | "self": { | ||
878 | 261 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
879 | 262 | } | ||
880 | 263 | }, | ||
881 | 264 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
882 | 265 | }, | ||
883 | 266 | { | ||
884 | 267 | "publisher": "Awesome Widget Company", | ||
885 | 268 | "name": "org.example.awesomewidget", | ||
886 | 269 | "title": "Awesome Widget", | ||
887 | 270 | "price": 1.99, | ||
888 | 271 | "_links": { | ||
889 | 272 | "self": { | ||
890 | 273 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
891 | 274 | } | ||
892 | 275 | }, | ||
893 | 276 | "icon": "http://example.org/media/org.example.awesomewidget/icons/icon16.png" | ||
894 | 277 | } | ||
895 | 278 | ] | ||
896 | 279 | }, | ||
897 | 280 | "_links": { | ||
898 | 281 | "self": { | ||
899 | 282 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/most-purchased" | ||
900 | 283 | } | ||
901 | 284 | }, | ||
902 | 285 | "name": "Most Purchased", | ||
903 | 286 | "slug": "most-purchased" | ||
904 | 287 | }, | ||
905 | 288 | { | ||
906 | 289 | "_embedded": { | ||
907 | 290 | "clickindex:package": [ | ||
908 | 291 | { | ||
909 | 292 | "publisher": "Awesome Widget Company", | ||
910 | 293 | "name": "org.example.awesomelauncher", | ||
911 | 294 | "title": "Awesome Launcher", | ||
912 | 295 | "price": 1.99, | ||
913 | 296 | "_links": { | ||
914 | 297 | "self": { | ||
915 | 298 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
916 | 299 | } | ||
917 | 300 | }, | ||
918 | 301 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
919 | 302 | }, | ||
920 | 303 | { | ||
921 | 304 | "publisher": "Awesome Widget Company", | ||
922 | 305 | "name": "org.example.awesomewidget", | ||
923 | 306 | "title": "Awesome Widget", | ||
924 | 307 | "price": 1.99, | ||
925 | 308 | "_links": { | ||
926 | 309 | "self": { | ||
927 | 310 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomewidget" | ||
928 | 311 | } | ||
929 | 312 | }, | ||
930 | 313 | "icon": "http://example.org/media/org.example.awesomewidget/icons/icon16.png" | ||
931 | 314 | } | ||
932 | 315 | ] | ||
933 | 316 | }, | ||
934 | 317 | "_links": { | ||
935 | 318 | "self": { | ||
936 | 319 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/new-releases" | ||
937 | 320 | } | ||
938 | 321 | }, | ||
939 | 322 | "name": "New Releases", | ||
940 | 323 | "slug": "new-releases" | ||
941 | 324 | } | ||
942 | 325 | ] | ||
943 | 326 | }, "has_children": true, | ||
944 | 327 | "_links": { | ||
945 | 328 | "curies": [ | ||
946 | 329 | { | ||
947 | 330 | "href": "https://search.apps.staging.ubuntu.com/docs/v1/relations.html{#rel}", | ||
948 | 331 | "name": "clickindex", "templated": true | ||
949 | 332 | } | ||
950 | 333 | ], | ||
951 | 334 | "self": { | ||
952 | 335 | "href": "https://search.apps.staging.ubuntu.com/api/v1/departments/fake-department-with-subdepartments" | ||
953 | 336 | }, | ||
954 | 337 | "collection": { | ||
955 | 338 | "href": "https://search.apps.staging.ubuntu.com/api/v1/departments" | ||
956 | 339 | } | ||
957 | 340 | }, | ||
958 | 341 | "name": "Fake Department With Subdepartments", | ||
959 | 342 | "slug": "fake-department-with-subdepartments" | ||
960 | 343 | })"; | ||
961 | 344 | |||
962 | 345 | const std::string FAKE_JSON_BROKEN_BOOTSTRAP = R"( | ||
963 | 346 | { | ||
964 | 347 | "_embedded": { | ||
965 | 348 | "clickindex:department": [ | ||
966 | 349 | { | ||
967 | 350 | "name": "Broken department" | ||
968 | 351 | } | ||
969 | 352 | ], | ||
970 | 353 | "clickindex:highlight": [ | ||
971 | 354 | { | ||
972 | 355 | "_embedded": { | ||
973 | 356 | "clickindex:package": [ | ||
974 | 357 | { | ||
975 | 358 | "publisher": "Awesome Widget Company", | ||
976 | 359 | "name": "org.example.awesomelauncher", | ||
977 | 360 | "title": "Awesome Launcher", | ||
978 | 361 | "price": 1.99, | ||
979 | 362 | "_links": { | ||
980 | 363 | "self": { | ||
981 | 364 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher"} | ||
982 | 365 | }, | ||
983 | 366 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
984 | 367 | } | ||
985 | 368 | ] | ||
986 | 369 | }, | ||
987 | 370 | "_links": { | ||
988 | 371 | "self": { | ||
989 | 372 | "href": "https://search.apps.staging.ubuntu.com/api/v1/highlights/top-apps" | ||
990 | 373 | } | ||
991 | 374 | }, | ||
992 | 375 | "name": "Top Apps", | ||
993 | 376 | "slug": "top-apps" | ||
994 | 377 | }, | ||
995 | 378 | { | ||
996 | 379 | "_embedded": { | ||
997 | 380 | "clickindex:package": [ | ||
998 | 381 | { | ||
999 | 382 | "publisher": "Awesome Widget Company", | ||
1000 | 383 | "name": "org.example.awesomelauncher", | ||
1001 | 384 | "title": "Awesome Launcher", | ||
1002 | 385 | "price": 1.99, | ||
1003 | 386 | "_links": { | ||
1004 | 387 | "self": { | ||
1005 | 388 | "href": "https://search.apps.staging.ubuntu.com/api/v1/package/org.example.awesomelauncher" | ||
1006 | 389 | } | ||
1007 | 390 | }, | ||
1008 | 391 | "icon": "http://example.org/media/org.example.awesomelauncher/icons/icon16.png" | ||
1009 | 392 | } | ||
1010 | 393 | ] | ||
1011 | 394 | }, | ||
1012 | 395 | "____name": "Broken highlight" | ||
1013 | 396 | } | ||
1014 | 397 | ] | ||
1015 | 398 | } | ||
1016 | 399 | })"; | ||
1017 | 400 | |||
1018 | 401 | const std::string FAKE_JSON_DEPARTMENTS_ONLY = R"( | ||
1019 | 402 | { | ||
1020 | 403 | "_links": { | ||
1021 | 404 | "self": { | ||
1022 | 405 | "href": "https://search.apps.ubuntu.com/api/v1/departments" | ||
1023 | 406 | }, | ||
1024 | 407 | "curies": [ | ||
1025 | 408 | { | ||
1026 | 409 | "name": "clickindex", | ||
1027 | 410 | "href": "https://search.apps.ubuntu.com/docs/v1/relations.html{#rel}", | ||
1028 | 411 | "templated": true | ||
1029 | 412 | } | ||
1030 | 413 | ] | ||
1031 | 414 | }, | ||
1032 | 415 | "_embedded": { | ||
1033 | 416 | "clickindex:department": [ | ||
1034 | 417 | { | ||
1035 | 418 | "name": "Games", | ||
1036 | 419 | "_links": { | ||
1037 | 420 | "self": { | ||
1038 | 421 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Games" | ||
1039 | 422 | } | ||
1040 | 423 | }, | ||
1041 | 424 | "_embedded": { | ||
1042 | 425 | "clickindex:department": [ | ||
1043 | 426 | { | ||
1044 | 427 | "name": "Board Games", | ||
1045 | 428 | "_links": { | ||
1046 | 429 | "self": { | ||
1047 | 430 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Games/Board+Games" | ||
1048 | 431 | } | ||
1049 | 432 | } | ||
1050 | 433 | } | ||
1051 | 434 | ] | ||
1052 | 435 | } | ||
1053 | 436 | }, | ||
1054 | 437 | { | ||
1055 | 438 | "name": "Graphics", | ||
1056 | 439 | "_links": { | ||
1057 | 440 | "self": { | ||
1058 | 441 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Graphics" | ||
1059 | 442 | } | ||
1060 | 443 | }, | ||
1061 | 444 | "_embedded": { | ||
1062 | 445 | "clickindex:department": [ | ||
1063 | 446 | { | ||
1064 | 447 | "name": "Drawing", | ||
1065 | 448 | "_links": { | ||
1066 | 449 | "self": { | ||
1067 | 450 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Graphics/Drawing" | ||
1068 | 451 | } | ||
1069 | 452 | } | ||
1070 | 453 | } | ||
1071 | 454 | ] | ||
1072 | 455 | } | ||
1073 | 456 | }, | ||
1074 | 457 | { | ||
1075 | 458 | "name": "Internet", | ||
1076 | 459 | "_links": { | ||
1077 | 460 | "self": { | ||
1078 | 461 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet" | ||
1079 | 462 | } | ||
1080 | 463 | }, | ||
1081 | 464 | "_embedded": { | ||
1082 | 465 | "clickindex:department": [ | ||
1083 | 466 | { | ||
1084 | 467 | "name": "Chat", | ||
1085 | 468 | "_links": { | ||
1086 | 469 | "self": { | ||
1087 | 470 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet/Chat" | ||
1088 | 471 | } | ||
1089 | 472 | } | ||
1090 | 473 | }, | ||
1091 | 474 | { | ||
1092 | 475 | "name": "Mail", | ||
1093 | 476 | "_links": { | ||
1094 | 477 | "self": { | ||
1095 | 478 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet/Mail" | ||
1096 | 479 | } | ||
1097 | 480 | } | ||
1098 | 481 | }, | ||
1099 | 482 | { | ||
1100 | 483 | "name": "Web Browsers", | ||
1101 | 484 | "_links": { | ||
1102 | 485 | "self": { | ||
1103 | 486 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Internet/Web+Browsers" | ||
1104 | 487 | } | ||
1105 | 488 | } | ||
1106 | 489 | } | ||
1107 | 490 | ] | ||
1108 | 491 | } | ||
1109 | 492 | } | ||
1110 | 493 | ] | ||
1111 | 494 | } | ||
1112 | 495 | })"; | ||
1113 | 496 | |||
1114 | 497 | const std::string FAKE_JSON_BROKEN_DEPARTMENTS = R"( | ||
1115 | 498 | { | ||
1116 | 499 | "_links": { | ||
1117 | 500 | "self": { | ||
1118 | 501 | "href": "https://search.apps.ubuntu.com/api/v1/departments" | ||
1119 | 502 | }, | ||
1120 | 503 | "curies": [ | ||
1121 | 504 | { | ||
1122 | 505 | "name": "clickindex", | ||
1123 | 506 | "href": "https://search.apps.ubuntu.com/docs/v1/relations.html{#rel}", | ||
1124 | 507 | "templated": true | ||
1125 | 508 | } | ||
1126 | 509 | ] | ||
1127 | 510 | }, | ||
1128 | 511 | "_embedded": { | ||
1129 | 512 | "clickindex:department": [ | ||
1130 | 513 | { | ||
1131 | 514 | "name": "Games", | ||
1132 | 515 | "_links": { | ||
1133 | 516 | "self": { | ||
1134 | 517 | "href": "https://search.apps.ubuntu.com/api/v1/departments/Games" | ||
1135 | 518 | } | ||
1136 | 519 | }, | ||
1137 | 520 | "_embedded": { | ||
1138 | 521 | "clickindex:department": [ | ||
1139 | 522 | { | ||
1140 | 523 | "name": "Broken department" | ||
1141 | 524 | } | ||
1142 | 525 | ] | ||
1143 | 526 | } | ||
1144 | 527 | } | ||
1145 | 528 | ] | ||
1146 | 529 | } | ||
1147 | 530 | })"; | ||
1148 | 531 | |||
1149 | 532 | const std::string FAKE_JSON_MANIFEST_REMOVABLE = R"foo( | ||
1150 | 533 | { | ||
1151 | 534 | "_removable": 1, | ||
1152 | 535 | "name": "com.example.fake", | ||
1153 | 536 | "version": "0.1", | ||
1154 | 537 | "hooks": { | ||
1155 | 538 | "fake-app": { | ||
1156 | 539 | "desktop": "fake-app.desktop" | ||
1157 | 540 | } | ||
1158 | 541 | } | ||
1159 | 542 | } | ||
1160 | 543 | )foo"; | ||
1161 | 544 | |||
1162 | 545 | const std::string FAKE_JSON_MANIFEST_NONREMOVABLE = R"foo( | ||
1163 | 546 | { | ||
1164 | 547 | "_removable": 0, | ||
1165 | 548 | "name": "com.example.fake", | ||
1166 | 549 | "version": "0.1", | ||
1167 | 550 | "hooks": { | ||
1168 | 551 | "fake-app": { | ||
1169 | 552 | "desktop": "fake-app.desktop" | ||
1170 | 553 | } | ||
1171 | 554 | } | ||
1172 | 555 | } | ||
1173 | 556 | )foo"; | ||
1174 | 557 | |||
1175 | 558 | const std::string FAKE_JSON_MANIFEST_ONE_APP = R"foo( | ||
1176 | 559 | { | ||
1177 | 560 | "_removable": 1, | ||
1178 | 561 | "name": "com.example.fake-app", | ||
1179 | 562 | "version": "0.1", | ||
1180 | 563 | "hooks": { | ||
1181 | 564 | "fake-app": { | ||
1182 | 565 | "apparmor": "fake-app.json", | ||
1183 | 566 | "desktop": "fake-app.desktop" | ||
1184 | 567 | } | ||
1185 | 568 | } | ||
1186 | 569 | } | ||
1187 | 570 | )foo"; | ||
1188 | 571 | |||
1189 | 572 | const std::string FAKE_JSON_MANIFEST_ONE_SCOPE = R"foo( | ||
1190 | 573 | { | ||
1191 | 574 | "_removable": 1, | ||
1192 | 575 | "name": "com.example.fake-scope", | ||
1193 | 576 | "version": "0.1", | ||
1194 | 577 | "hooks": { | ||
1195 | 578 | "fake-scope": { | ||
1196 | 579 | "apparmor": "scope-security.json", | ||
1197 | 580 | "scope": "fake-scope" | ||
1198 | 581 | } | ||
1199 | 582 | } | ||
1200 | 583 | } | ||
1201 | 584 | )foo"; | ||
1202 | 585 | |||
1203 | 586 | const std::string FAKE_JSON_MANIFEST_ONE_APP_ONE_SCOPE = R"foo( | ||
1204 | 587 | { | ||
1205 | 588 | "_removable": 1, | ||
1206 | 589 | "name": "com.example.fake-1app-1scope", | ||
1207 | 590 | "version": "0.1", | ||
1208 | 591 | "hooks": { | ||
1209 | 592 | "fake-app": { | ||
1210 | 593 | "apparmor": "fake-app.json", | ||
1211 | 594 | "desktop": "fake-app.desktop" | ||
1212 | 595 | }, | ||
1213 | 596 | "fake-scope": { | ||
1214 | 597 | "apparmor": "scope-security.json", | ||
1215 | 598 | "scope": "fake-scope" | ||
1216 | 599 | } | ||
1217 | 600 | } | ||
1218 | 601 | } | ||
1219 | 602 | )foo"; | ||
1220 | 603 | |||
1221 | 604 | const std::string FAKE_JSON_MANIFEST_TWO_APPS_TWO_SCOPES = R"foo( | ||
1222 | 605 | { | ||
1223 | 606 | "_removable": 1, | ||
1224 | 607 | "name": "com.example.fake-2apps-2scopes", | ||
1225 | 608 | "version": "0.1", | ||
1226 | 609 | "hooks": { | ||
1227 | 610 | "fake-app1": { | ||
1228 | 611 | "apparmor": "fake-app1.json", | ||
1229 | 612 | "desktop": "fake-app1.desktop" | ||
1230 | 613 | }, | ||
1231 | 614 | "fake-app2": { | ||
1232 | 615 | "apparmor": "fake-app2.json", | ||
1233 | 616 | "desktop": "fake-app2.desktop" | ||
1234 | 617 | }, | ||
1235 | 618 | "fake-scope1": { | ||
1236 | 619 | "apparmor": "scope-security1.json", | ||
1237 | 620 | "scope": "fake-scope1" | ||
1238 | 621 | }, | ||
1239 | 622 | "fake-scope2": { | ||
1240 | 623 | "apparmor": "scope-security1.json", | ||
1241 | 624 | "scope": "fake-scope2" | ||
1242 | 625 | } | ||
1243 | 626 | } | ||
1244 | 627 | } | ||
1245 | 628 | )foo"; | ||
1262 | 629 | 51 | ||
1263 | 630 | #endif // FAKE_JSON_H | 52 | #endif // FAKE_JSON_H |
PASSED: Continuous integration, rev:322 jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- ci/181/ jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- utopic- amd64-ci/ 156 jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- utopic- armhf-ci/ 155 jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- utopic- armhf-ci/ 155/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- utopic- i386-ci/ 155
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- team-unity- scope-click- devel-ci/ 181/rebuild
http://