OLD | NEW |
| (Empty) |
1 library googleapis.dataproc.v1beta2.test; | |
2 | |
3 import "dart:core" as core; | |
4 import "dart:collection" as collection; | |
5 import "dart:async" as async; | |
6 import "dart:convert" as convert; | |
7 | |
8 import 'package:http/http.dart' as http; | |
9 import 'package:http/testing.dart' as http_testing; | |
10 import 'package:test/test.dart' as unittest; | |
11 | |
12 import 'package:googleapis/dataproc/v1beta2.dart' as api; | |
13 | |
14 class HttpServerMock extends http.BaseClient { | |
15 core.Function _callback; | |
16 core.bool _expectJson; | |
17 | |
18 void register(core.Function callback, core.bool expectJson) { | |
19 _callback = callback; | |
20 _expectJson = expectJson; | |
21 } | |
22 | |
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | |
24 if (_expectJson) { | |
25 return request.finalize() | |
26 .transform(convert.UTF8.decoder) | |
27 .join('') | |
28 .then((core.String jsonString) { | |
29 if (jsonString.isEmpty) { | |
30 return _callback(request, null); | |
31 } else { | |
32 return _callback(request, convert.JSON.decode(jsonString)); | |
33 } | |
34 }); | |
35 } else { | |
36 var stream = request.finalize(); | |
37 if (stream == null) { | |
38 return _callback(request, []); | |
39 } else { | |
40 return stream.toBytes().then((data) { | |
41 return _callback(request, data); | |
42 }); | |
43 } | |
44 } | |
45 } | |
46 } | |
47 | |
48 http.StreamedResponse stringResponse( | |
49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | |
51 return new http.StreamedResponse(stream, status, headers: headers); | |
52 } | |
53 | |
54 core.int buildCounterAcceleratorConfig = 0; | |
55 buildAcceleratorConfig() { | |
56 var o = new api.AcceleratorConfig(); | |
57 buildCounterAcceleratorConfig++; | |
58 if (buildCounterAcceleratorConfig < 3) { | |
59 o.acceleratorCount = 42; | |
60 o.acceleratorTypeUri = "foo"; | |
61 } | |
62 buildCounterAcceleratorConfig--; | |
63 return o; | |
64 } | |
65 | |
66 checkAcceleratorConfig(api.AcceleratorConfig o) { | |
67 buildCounterAcceleratorConfig++; | |
68 if (buildCounterAcceleratorConfig < 3) { | |
69 unittest.expect(o.acceleratorCount, unittest.equals(42)); | |
70 unittest.expect(o.acceleratorTypeUri, unittest.equals('foo')); | |
71 } | |
72 buildCounterAcceleratorConfig--; | |
73 } | |
74 | |
75 core.int buildCounterCancelJobRequest = 0; | |
76 buildCancelJobRequest() { | |
77 var o = new api.CancelJobRequest(); | |
78 buildCounterCancelJobRequest++; | |
79 if (buildCounterCancelJobRequest < 3) { | |
80 } | |
81 buildCounterCancelJobRequest--; | |
82 return o; | |
83 } | |
84 | |
85 checkCancelJobRequest(api.CancelJobRequest o) { | |
86 buildCounterCancelJobRequest++; | |
87 if (buildCounterCancelJobRequest < 3) { | |
88 } | |
89 buildCounterCancelJobRequest--; | |
90 } | |
91 | |
92 buildUnnamed54() { | |
93 var o = new core.Map<core.String, core.String>(); | |
94 o["x"] = "foo"; | |
95 o["y"] = "foo"; | |
96 return o; | |
97 } | |
98 | |
99 checkUnnamed54(core.Map<core.String, core.String> o) { | |
100 unittest.expect(o, unittest.hasLength(2)); | |
101 unittest.expect(o["x"], unittest.equals('foo')); | |
102 unittest.expect(o["y"], unittest.equals('foo')); | |
103 } | |
104 | |
105 buildUnnamed55() { | |
106 var o = new core.List<api.ClusterStatus>(); | |
107 o.add(buildClusterStatus()); | |
108 o.add(buildClusterStatus()); | |
109 return o; | |
110 } | |
111 | |
112 checkUnnamed55(core.List<api.ClusterStatus> o) { | |
113 unittest.expect(o, unittest.hasLength(2)); | |
114 checkClusterStatus(o[0]); | |
115 checkClusterStatus(o[1]); | |
116 } | |
117 | |
118 core.int buildCounterCluster = 0; | |
119 buildCluster() { | |
120 var o = new api.Cluster(); | |
121 buildCounterCluster++; | |
122 if (buildCounterCluster < 3) { | |
123 o.clusterName = "foo"; | |
124 o.clusterUuid = "foo"; | |
125 o.config = buildClusterConfig(); | |
126 o.labels = buildUnnamed54(); | |
127 o.metrics = buildClusterMetrics(); | |
128 o.projectId = "foo"; | |
129 o.status = buildClusterStatus(); | |
130 o.statusHistory = buildUnnamed55(); | |
131 } | |
132 buildCounterCluster--; | |
133 return o; | |
134 } | |
135 | |
136 checkCluster(api.Cluster o) { | |
137 buildCounterCluster++; | |
138 if (buildCounterCluster < 3) { | |
139 unittest.expect(o.clusterName, unittest.equals('foo')); | |
140 unittest.expect(o.clusterUuid, unittest.equals('foo')); | |
141 checkClusterConfig(o.config); | |
142 checkUnnamed54(o.labels); | |
143 checkClusterMetrics(o.metrics); | |
144 unittest.expect(o.projectId, unittest.equals('foo')); | |
145 checkClusterStatus(o.status); | |
146 checkUnnamed55(o.statusHistory); | |
147 } | |
148 buildCounterCluster--; | |
149 } | |
150 | |
151 buildUnnamed56() { | |
152 var o = new core.List<api.NodeInitializationAction>(); | |
153 o.add(buildNodeInitializationAction()); | |
154 o.add(buildNodeInitializationAction()); | |
155 return o; | |
156 } | |
157 | |
158 checkUnnamed56(core.List<api.NodeInitializationAction> o) { | |
159 unittest.expect(o, unittest.hasLength(2)); | |
160 checkNodeInitializationAction(o[0]); | |
161 checkNodeInitializationAction(o[1]); | |
162 } | |
163 | |
164 core.int buildCounterClusterConfig = 0; | |
165 buildClusterConfig() { | |
166 var o = new api.ClusterConfig(); | |
167 buildCounterClusterConfig++; | |
168 if (buildCounterClusterConfig < 3) { | |
169 o.configBucket = "foo"; | |
170 o.gceClusterConfig = buildGceClusterConfig(); | |
171 o.initializationActions = buildUnnamed56(); | |
172 o.masterConfig = buildInstanceGroupConfig(); | |
173 o.secondaryWorkerConfig = buildInstanceGroupConfig(); | |
174 o.softwareConfig = buildSoftwareConfig(); | |
175 o.workerConfig = buildInstanceGroupConfig(); | |
176 } | |
177 buildCounterClusterConfig--; | |
178 return o; | |
179 } | |
180 | |
181 checkClusterConfig(api.ClusterConfig o) { | |
182 buildCounterClusterConfig++; | |
183 if (buildCounterClusterConfig < 3) { | |
184 unittest.expect(o.configBucket, unittest.equals('foo')); | |
185 checkGceClusterConfig(o.gceClusterConfig); | |
186 checkUnnamed56(o.initializationActions); | |
187 checkInstanceGroupConfig(o.masterConfig); | |
188 checkInstanceGroupConfig(o.secondaryWorkerConfig); | |
189 checkSoftwareConfig(o.softwareConfig); | |
190 checkInstanceGroupConfig(o.workerConfig); | |
191 } | |
192 buildCounterClusterConfig--; | |
193 } | |
194 | |
195 buildUnnamed57() { | |
196 var o = new core.Map<core.String, core.String>(); | |
197 o["x"] = "foo"; | |
198 o["y"] = "foo"; | |
199 return o; | |
200 } | |
201 | |
202 checkUnnamed57(core.Map<core.String, core.String> o) { | |
203 unittest.expect(o, unittest.hasLength(2)); | |
204 unittest.expect(o["x"], unittest.equals('foo')); | |
205 unittest.expect(o["y"], unittest.equals('foo')); | |
206 } | |
207 | |
208 buildUnnamed58() { | |
209 var o = new core.Map<core.String, core.String>(); | |
210 o["x"] = "foo"; | |
211 o["y"] = "foo"; | |
212 return o; | |
213 } | |
214 | |
215 checkUnnamed58(core.Map<core.String, core.String> o) { | |
216 unittest.expect(o, unittest.hasLength(2)); | |
217 unittest.expect(o["x"], unittest.equals('foo')); | |
218 unittest.expect(o["y"], unittest.equals('foo')); | |
219 } | |
220 | |
221 core.int buildCounterClusterMetrics = 0; | |
222 buildClusterMetrics() { | |
223 var o = new api.ClusterMetrics(); | |
224 buildCounterClusterMetrics++; | |
225 if (buildCounterClusterMetrics < 3) { | |
226 o.hdfsMetrics = buildUnnamed57(); | |
227 o.yarnMetrics = buildUnnamed58(); | |
228 } | |
229 buildCounterClusterMetrics--; | |
230 return o; | |
231 } | |
232 | |
233 checkClusterMetrics(api.ClusterMetrics o) { | |
234 buildCounterClusterMetrics++; | |
235 if (buildCounterClusterMetrics < 3) { | |
236 checkUnnamed57(o.hdfsMetrics); | |
237 checkUnnamed58(o.yarnMetrics); | |
238 } | |
239 buildCounterClusterMetrics--; | |
240 } | |
241 | |
242 buildUnnamed59() { | |
243 var o = new core.Map<core.String, core.String>(); | |
244 o["x"] = "foo"; | |
245 o["y"] = "foo"; | |
246 return o; | |
247 } | |
248 | |
249 checkUnnamed59(core.Map<core.String, core.String> o) { | |
250 unittest.expect(o, unittest.hasLength(2)); | |
251 unittest.expect(o["x"], unittest.equals('foo')); | |
252 unittest.expect(o["y"], unittest.equals('foo')); | |
253 } | |
254 | |
255 buildUnnamed60() { | |
256 var o = new core.List<api.ClusterOperationStatus>(); | |
257 o.add(buildClusterOperationStatus()); | |
258 o.add(buildClusterOperationStatus()); | |
259 return o; | |
260 } | |
261 | |
262 checkUnnamed60(core.List<api.ClusterOperationStatus> o) { | |
263 unittest.expect(o, unittest.hasLength(2)); | |
264 checkClusterOperationStatus(o[0]); | |
265 checkClusterOperationStatus(o[1]); | |
266 } | |
267 | |
268 buildUnnamed61() { | |
269 var o = new core.List<core.String>(); | |
270 o.add("foo"); | |
271 o.add("foo"); | |
272 return o; | |
273 } | |
274 | |
275 checkUnnamed61(core.List<core.String> o) { | |
276 unittest.expect(o, unittest.hasLength(2)); | |
277 unittest.expect(o[0], unittest.equals('foo')); | |
278 unittest.expect(o[1], unittest.equals('foo')); | |
279 } | |
280 | |
281 core.int buildCounterClusterOperationMetadata = 0; | |
282 buildClusterOperationMetadata() { | |
283 var o = new api.ClusterOperationMetadata(); | |
284 buildCounterClusterOperationMetadata++; | |
285 if (buildCounterClusterOperationMetadata < 3) { | |
286 o.clusterName = "foo"; | |
287 o.clusterUuid = "foo"; | |
288 o.description = "foo"; | |
289 o.labels = buildUnnamed59(); | |
290 o.operationType = "foo"; | |
291 o.status = buildClusterOperationStatus(); | |
292 o.statusHistory = buildUnnamed60(); | |
293 o.warnings = buildUnnamed61(); | |
294 } | |
295 buildCounterClusterOperationMetadata--; | |
296 return o; | |
297 } | |
298 | |
299 checkClusterOperationMetadata(api.ClusterOperationMetadata o) { | |
300 buildCounterClusterOperationMetadata++; | |
301 if (buildCounterClusterOperationMetadata < 3) { | |
302 unittest.expect(o.clusterName, unittest.equals('foo')); | |
303 unittest.expect(o.clusterUuid, unittest.equals('foo')); | |
304 unittest.expect(o.description, unittest.equals('foo')); | |
305 checkUnnamed59(o.labels); | |
306 unittest.expect(o.operationType, unittest.equals('foo')); | |
307 checkClusterOperationStatus(o.status); | |
308 checkUnnamed60(o.statusHistory); | |
309 checkUnnamed61(o.warnings); | |
310 } | |
311 buildCounterClusterOperationMetadata--; | |
312 } | |
313 | |
314 core.int buildCounterClusterOperationStatus = 0; | |
315 buildClusterOperationStatus() { | |
316 var o = new api.ClusterOperationStatus(); | |
317 buildCounterClusterOperationStatus++; | |
318 if (buildCounterClusterOperationStatus < 3) { | |
319 o.details = "foo"; | |
320 o.innerState = "foo"; | |
321 o.state = "foo"; | |
322 o.stateStartTime = "foo"; | |
323 } | |
324 buildCounterClusterOperationStatus--; | |
325 return o; | |
326 } | |
327 | |
328 checkClusterOperationStatus(api.ClusterOperationStatus o) { | |
329 buildCounterClusterOperationStatus++; | |
330 if (buildCounterClusterOperationStatus < 3) { | |
331 unittest.expect(o.details, unittest.equals('foo')); | |
332 unittest.expect(o.innerState, unittest.equals('foo')); | |
333 unittest.expect(o.state, unittest.equals('foo')); | |
334 unittest.expect(o.stateStartTime, unittest.equals('foo')); | |
335 } | |
336 buildCounterClusterOperationStatus--; | |
337 } | |
338 | |
339 core.int buildCounterClusterStatus = 0; | |
340 buildClusterStatus() { | |
341 var o = new api.ClusterStatus(); | |
342 buildCounterClusterStatus++; | |
343 if (buildCounterClusterStatus < 3) { | |
344 o.detail = "foo"; | |
345 o.state = "foo"; | |
346 o.stateStartTime = "foo"; | |
347 o.substate = "foo"; | |
348 } | |
349 buildCounterClusterStatus--; | |
350 return o; | |
351 } | |
352 | |
353 checkClusterStatus(api.ClusterStatus o) { | |
354 buildCounterClusterStatus++; | |
355 if (buildCounterClusterStatus < 3) { | |
356 unittest.expect(o.detail, unittest.equals('foo')); | |
357 unittest.expect(o.state, unittest.equals('foo')); | |
358 unittest.expect(o.stateStartTime, unittest.equals('foo')); | |
359 unittest.expect(o.substate, unittest.equals('foo')); | |
360 } | |
361 buildCounterClusterStatus--; | |
362 } | |
363 | |
364 core.int buildCounterDiagnoseClusterRequest = 0; | |
365 buildDiagnoseClusterRequest() { | |
366 var o = new api.DiagnoseClusterRequest(); | |
367 buildCounterDiagnoseClusterRequest++; | |
368 if (buildCounterDiagnoseClusterRequest < 3) { | |
369 } | |
370 buildCounterDiagnoseClusterRequest--; | |
371 return o; | |
372 } | |
373 | |
374 checkDiagnoseClusterRequest(api.DiagnoseClusterRequest o) { | |
375 buildCounterDiagnoseClusterRequest++; | |
376 if (buildCounterDiagnoseClusterRequest < 3) { | |
377 } | |
378 buildCounterDiagnoseClusterRequest--; | |
379 } | |
380 | |
381 core.int buildCounterDiskConfig = 0; | |
382 buildDiskConfig() { | |
383 var o = new api.DiskConfig(); | |
384 buildCounterDiskConfig++; | |
385 if (buildCounterDiskConfig < 3) { | |
386 o.bootDiskSizeGb = 42; | |
387 o.numLocalSsds = 42; | |
388 } | |
389 buildCounterDiskConfig--; | |
390 return o; | |
391 } | |
392 | |
393 checkDiskConfig(api.DiskConfig o) { | |
394 buildCounterDiskConfig++; | |
395 if (buildCounterDiskConfig < 3) { | |
396 unittest.expect(o.bootDiskSizeGb, unittest.equals(42)); | |
397 unittest.expect(o.numLocalSsds, unittest.equals(42)); | |
398 } | |
399 buildCounterDiskConfig--; | |
400 } | |
401 | |
402 core.int buildCounterEmpty = 0; | |
403 buildEmpty() { | |
404 var o = new api.Empty(); | |
405 buildCounterEmpty++; | |
406 if (buildCounterEmpty < 3) { | |
407 } | |
408 buildCounterEmpty--; | |
409 return o; | |
410 } | |
411 | |
412 checkEmpty(api.Empty o) { | |
413 buildCounterEmpty++; | |
414 if (buildCounterEmpty < 3) { | |
415 } | |
416 buildCounterEmpty--; | |
417 } | |
418 | |
419 buildUnnamed62() { | |
420 var o = new core.Map<core.String, core.String>(); | |
421 o["x"] = "foo"; | |
422 o["y"] = "foo"; | |
423 return o; | |
424 } | |
425 | |
426 checkUnnamed62(core.Map<core.String, core.String> o) { | |
427 unittest.expect(o, unittest.hasLength(2)); | |
428 unittest.expect(o["x"], unittest.equals('foo')); | |
429 unittest.expect(o["y"], unittest.equals('foo')); | |
430 } | |
431 | |
432 buildUnnamed63() { | |
433 var o = new core.List<core.String>(); | |
434 o.add("foo"); | |
435 o.add("foo"); | |
436 return o; | |
437 } | |
438 | |
439 checkUnnamed63(core.List<core.String> o) { | |
440 unittest.expect(o, unittest.hasLength(2)); | |
441 unittest.expect(o[0], unittest.equals('foo')); | |
442 unittest.expect(o[1], unittest.equals('foo')); | |
443 } | |
444 | |
445 buildUnnamed64() { | |
446 var o = new core.List<core.String>(); | |
447 o.add("foo"); | |
448 o.add("foo"); | |
449 return o; | |
450 } | |
451 | |
452 checkUnnamed64(core.List<core.String> o) { | |
453 unittest.expect(o, unittest.hasLength(2)); | |
454 unittest.expect(o[0], unittest.equals('foo')); | |
455 unittest.expect(o[1], unittest.equals('foo')); | |
456 } | |
457 | |
458 core.int buildCounterGceClusterConfig = 0; | |
459 buildGceClusterConfig() { | |
460 var o = new api.GceClusterConfig(); | |
461 buildCounterGceClusterConfig++; | |
462 if (buildCounterGceClusterConfig < 3) { | |
463 o.internalIpOnly = true; | |
464 o.metadata = buildUnnamed62(); | |
465 o.networkUri = "foo"; | |
466 o.serviceAccount = "foo"; | |
467 o.serviceAccountScopes = buildUnnamed63(); | |
468 o.subnetworkUri = "foo"; | |
469 o.tags = buildUnnamed64(); | |
470 o.zoneUri = "foo"; | |
471 } | |
472 buildCounterGceClusterConfig--; | |
473 return o; | |
474 } | |
475 | |
476 checkGceClusterConfig(api.GceClusterConfig o) { | |
477 buildCounterGceClusterConfig++; | |
478 if (buildCounterGceClusterConfig < 3) { | |
479 unittest.expect(o.internalIpOnly, unittest.isTrue); | |
480 checkUnnamed62(o.metadata); | |
481 unittest.expect(o.networkUri, unittest.equals('foo')); | |
482 unittest.expect(o.serviceAccount, unittest.equals('foo')); | |
483 checkUnnamed63(o.serviceAccountScopes); | |
484 unittest.expect(o.subnetworkUri, unittest.equals('foo')); | |
485 checkUnnamed64(o.tags); | |
486 unittest.expect(o.zoneUri, unittest.equals('foo')); | |
487 } | |
488 buildCounterGceClusterConfig--; | |
489 } | |
490 | |
491 buildUnnamed65() { | |
492 var o = new core.List<core.String>(); | |
493 o.add("foo"); | |
494 o.add("foo"); | |
495 return o; | |
496 } | |
497 | |
498 checkUnnamed65(core.List<core.String> o) { | |
499 unittest.expect(o, unittest.hasLength(2)); | |
500 unittest.expect(o[0], unittest.equals('foo')); | |
501 unittest.expect(o[1], unittest.equals('foo')); | |
502 } | |
503 | |
504 buildUnnamed66() { | |
505 var o = new core.List<core.String>(); | |
506 o.add("foo"); | |
507 o.add("foo"); | |
508 return o; | |
509 } | |
510 | |
511 checkUnnamed66(core.List<core.String> o) { | |
512 unittest.expect(o, unittest.hasLength(2)); | |
513 unittest.expect(o[0], unittest.equals('foo')); | |
514 unittest.expect(o[1], unittest.equals('foo')); | |
515 } | |
516 | |
517 buildUnnamed67() { | |
518 var o = new core.List<core.String>(); | |
519 o.add("foo"); | |
520 o.add("foo"); | |
521 return o; | |
522 } | |
523 | |
524 checkUnnamed67(core.List<core.String> o) { | |
525 unittest.expect(o, unittest.hasLength(2)); | |
526 unittest.expect(o[0], unittest.equals('foo')); | |
527 unittest.expect(o[1], unittest.equals('foo')); | |
528 } | |
529 | |
530 buildUnnamed68() { | |
531 var o = new core.List<core.String>(); | |
532 o.add("foo"); | |
533 o.add("foo"); | |
534 return o; | |
535 } | |
536 | |
537 checkUnnamed68(core.List<core.String> o) { | |
538 unittest.expect(o, unittest.hasLength(2)); | |
539 unittest.expect(o[0], unittest.equals('foo')); | |
540 unittest.expect(o[1], unittest.equals('foo')); | |
541 } | |
542 | |
543 buildUnnamed69() { | |
544 var o = new core.Map<core.String, core.String>(); | |
545 o["x"] = "foo"; | |
546 o["y"] = "foo"; | |
547 return o; | |
548 } | |
549 | |
550 checkUnnamed69(core.Map<core.String, core.String> o) { | |
551 unittest.expect(o, unittest.hasLength(2)); | |
552 unittest.expect(o["x"], unittest.equals('foo')); | |
553 unittest.expect(o["y"], unittest.equals('foo')); | |
554 } | |
555 | |
556 core.int buildCounterHadoopJob = 0; | |
557 buildHadoopJob() { | |
558 var o = new api.HadoopJob(); | |
559 buildCounterHadoopJob++; | |
560 if (buildCounterHadoopJob < 3) { | |
561 o.archiveUris = buildUnnamed65(); | |
562 o.args = buildUnnamed66(); | |
563 o.fileUris = buildUnnamed67(); | |
564 o.jarFileUris = buildUnnamed68(); | |
565 o.loggingConfig = buildLoggingConfig(); | |
566 o.mainClass = "foo"; | |
567 o.mainJarFileUri = "foo"; | |
568 o.properties = buildUnnamed69(); | |
569 } | |
570 buildCounterHadoopJob--; | |
571 return o; | |
572 } | |
573 | |
574 checkHadoopJob(api.HadoopJob o) { | |
575 buildCounterHadoopJob++; | |
576 if (buildCounterHadoopJob < 3) { | |
577 checkUnnamed65(o.archiveUris); | |
578 checkUnnamed66(o.args); | |
579 checkUnnamed67(o.fileUris); | |
580 checkUnnamed68(o.jarFileUris); | |
581 checkLoggingConfig(o.loggingConfig); | |
582 unittest.expect(o.mainClass, unittest.equals('foo')); | |
583 unittest.expect(o.mainJarFileUri, unittest.equals('foo')); | |
584 checkUnnamed69(o.properties); | |
585 } | |
586 buildCounterHadoopJob--; | |
587 } | |
588 | |
589 buildUnnamed70() { | |
590 var o = new core.List<core.String>(); | |
591 o.add("foo"); | |
592 o.add("foo"); | |
593 return o; | |
594 } | |
595 | |
596 checkUnnamed70(core.List<core.String> o) { | |
597 unittest.expect(o, unittest.hasLength(2)); | |
598 unittest.expect(o[0], unittest.equals('foo')); | |
599 unittest.expect(o[1], unittest.equals('foo')); | |
600 } | |
601 | |
602 buildUnnamed71() { | |
603 var o = new core.Map<core.String, core.String>(); | |
604 o["x"] = "foo"; | |
605 o["y"] = "foo"; | |
606 return o; | |
607 } | |
608 | |
609 checkUnnamed71(core.Map<core.String, core.String> o) { | |
610 unittest.expect(o, unittest.hasLength(2)); | |
611 unittest.expect(o["x"], unittest.equals('foo')); | |
612 unittest.expect(o["y"], unittest.equals('foo')); | |
613 } | |
614 | |
615 buildUnnamed72() { | |
616 var o = new core.Map<core.String, core.String>(); | |
617 o["x"] = "foo"; | |
618 o["y"] = "foo"; | |
619 return o; | |
620 } | |
621 | |
622 checkUnnamed72(core.Map<core.String, core.String> o) { | |
623 unittest.expect(o, unittest.hasLength(2)); | |
624 unittest.expect(o["x"], unittest.equals('foo')); | |
625 unittest.expect(o["y"], unittest.equals('foo')); | |
626 } | |
627 | |
628 core.int buildCounterHiveJob = 0; | |
629 buildHiveJob() { | |
630 var o = new api.HiveJob(); | |
631 buildCounterHiveJob++; | |
632 if (buildCounterHiveJob < 3) { | |
633 o.continueOnFailure = true; | |
634 o.jarFileUris = buildUnnamed70(); | |
635 o.properties = buildUnnamed71(); | |
636 o.queryFileUri = "foo"; | |
637 o.queryList = buildQueryList(); | |
638 o.scriptVariables = buildUnnamed72(); | |
639 } | |
640 buildCounterHiveJob--; | |
641 return o; | |
642 } | |
643 | |
644 checkHiveJob(api.HiveJob o) { | |
645 buildCounterHiveJob++; | |
646 if (buildCounterHiveJob < 3) { | |
647 unittest.expect(o.continueOnFailure, unittest.isTrue); | |
648 checkUnnamed70(o.jarFileUris); | |
649 checkUnnamed71(o.properties); | |
650 unittest.expect(o.queryFileUri, unittest.equals('foo')); | |
651 checkQueryList(o.queryList); | |
652 checkUnnamed72(o.scriptVariables); | |
653 } | |
654 buildCounterHiveJob--; | |
655 } | |
656 | |
657 buildUnnamed73() { | |
658 var o = new core.List<api.AcceleratorConfig>(); | |
659 o.add(buildAcceleratorConfig()); | |
660 o.add(buildAcceleratorConfig()); | |
661 return o; | |
662 } | |
663 | |
664 checkUnnamed73(core.List<api.AcceleratorConfig> o) { | |
665 unittest.expect(o, unittest.hasLength(2)); | |
666 checkAcceleratorConfig(o[0]); | |
667 checkAcceleratorConfig(o[1]); | |
668 } | |
669 | |
670 buildUnnamed74() { | |
671 var o = new core.List<core.String>(); | |
672 o.add("foo"); | |
673 o.add("foo"); | |
674 return o; | |
675 } | |
676 | |
677 checkUnnamed74(core.List<core.String> o) { | |
678 unittest.expect(o, unittest.hasLength(2)); | |
679 unittest.expect(o[0], unittest.equals('foo')); | |
680 unittest.expect(o[1], unittest.equals('foo')); | |
681 } | |
682 | |
683 core.int buildCounterInstanceGroupConfig = 0; | |
684 buildInstanceGroupConfig() { | |
685 var o = new api.InstanceGroupConfig(); | |
686 buildCounterInstanceGroupConfig++; | |
687 if (buildCounterInstanceGroupConfig < 3) { | |
688 o.accelerators = buildUnnamed73(); | |
689 o.diskConfig = buildDiskConfig(); | |
690 o.imageUri = "foo"; | |
691 o.instanceNames = buildUnnamed74(); | |
692 o.isPreemptible = true; | |
693 o.machineTypeUri = "foo"; | |
694 o.managedGroupConfig = buildManagedGroupConfig(); | |
695 o.numInstances = 42; | |
696 } | |
697 buildCounterInstanceGroupConfig--; | |
698 return o; | |
699 } | |
700 | |
701 checkInstanceGroupConfig(api.InstanceGroupConfig o) { | |
702 buildCounterInstanceGroupConfig++; | |
703 if (buildCounterInstanceGroupConfig < 3) { | |
704 checkUnnamed73(o.accelerators); | |
705 checkDiskConfig(o.diskConfig); | |
706 unittest.expect(o.imageUri, unittest.equals('foo')); | |
707 checkUnnamed74(o.instanceNames); | |
708 unittest.expect(o.isPreemptible, unittest.isTrue); | |
709 unittest.expect(o.machineTypeUri, unittest.equals('foo')); | |
710 checkManagedGroupConfig(o.managedGroupConfig); | |
711 unittest.expect(o.numInstances, unittest.equals(42)); | |
712 } | |
713 buildCounterInstanceGroupConfig--; | |
714 } | |
715 | |
716 buildUnnamed75() { | |
717 var o = new core.Map<core.String, core.String>(); | |
718 o["x"] = "foo"; | |
719 o["y"] = "foo"; | |
720 return o; | |
721 } | |
722 | |
723 checkUnnamed75(core.Map<core.String, core.String> o) { | |
724 unittest.expect(o, unittest.hasLength(2)); | |
725 unittest.expect(o["x"], unittest.equals('foo')); | |
726 unittest.expect(o["y"], unittest.equals('foo')); | |
727 } | |
728 | |
729 buildUnnamed76() { | |
730 var o = new core.List<api.JobStatus>(); | |
731 o.add(buildJobStatus()); | |
732 o.add(buildJobStatus()); | |
733 return o; | |
734 } | |
735 | |
736 checkUnnamed76(core.List<api.JobStatus> o) { | |
737 unittest.expect(o, unittest.hasLength(2)); | |
738 checkJobStatus(o[0]); | |
739 checkJobStatus(o[1]); | |
740 } | |
741 | |
742 buildUnnamed77() { | |
743 var o = new core.List<api.YarnApplication>(); | |
744 o.add(buildYarnApplication()); | |
745 o.add(buildYarnApplication()); | |
746 return o; | |
747 } | |
748 | |
749 checkUnnamed77(core.List<api.YarnApplication> o) { | |
750 unittest.expect(o, unittest.hasLength(2)); | |
751 checkYarnApplication(o[0]); | |
752 checkYarnApplication(o[1]); | |
753 } | |
754 | |
755 core.int buildCounterJob = 0; | |
756 buildJob() { | |
757 var o = new api.Job(); | |
758 buildCounterJob++; | |
759 if (buildCounterJob < 3) { | |
760 o.driverControlFilesUri = "foo"; | |
761 o.driverOutputResourceUri = "foo"; | |
762 o.hadoopJob = buildHadoopJob(); | |
763 o.hiveJob = buildHiveJob(); | |
764 o.labels = buildUnnamed75(); | |
765 o.pigJob = buildPigJob(); | |
766 o.placement = buildJobPlacement(); | |
767 o.pysparkJob = buildPySparkJob(); | |
768 o.reference = buildJobReference(); | |
769 o.scheduling = buildJobScheduling(); | |
770 o.sparkJob = buildSparkJob(); | |
771 o.sparkSqlJob = buildSparkSqlJob(); | |
772 o.status = buildJobStatus(); | |
773 o.statusHistory = buildUnnamed76(); | |
774 o.yarnApplications = buildUnnamed77(); | |
775 } | |
776 buildCounterJob--; | |
777 return o; | |
778 } | |
779 | |
780 checkJob(api.Job o) { | |
781 buildCounterJob++; | |
782 if (buildCounterJob < 3) { | |
783 unittest.expect(o.driverControlFilesUri, unittest.equals('foo')); | |
784 unittest.expect(o.driverOutputResourceUri, unittest.equals('foo')); | |
785 checkHadoopJob(o.hadoopJob); | |
786 checkHiveJob(o.hiveJob); | |
787 checkUnnamed75(o.labels); | |
788 checkPigJob(o.pigJob); | |
789 checkJobPlacement(o.placement); | |
790 checkPySparkJob(o.pysparkJob); | |
791 checkJobReference(o.reference); | |
792 checkJobScheduling(o.scheduling); | |
793 checkSparkJob(o.sparkJob); | |
794 checkSparkSqlJob(o.sparkSqlJob); | |
795 checkJobStatus(o.status); | |
796 checkUnnamed76(o.statusHistory); | |
797 checkUnnamed77(o.yarnApplications); | |
798 } | |
799 buildCounterJob--; | |
800 } | |
801 | |
802 core.int buildCounterJobPlacement = 0; | |
803 buildJobPlacement() { | |
804 var o = new api.JobPlacement(); | |
805 buildCounterJobPlacement++; | |
806 if (buildCounterJobPlacement < 3) { | |
807 o.clusterName = "foo"; | |
808 o.clusterUuid = "foo"; | |
809 } | |
810 buildCounterJobPlacement--; | |
811 return o; | |
812 } | |
813 | |
814 checkJobPlacement(api.JobPlacement o) { | |
815 buildCounterJobPlacement++; | |
816 if (buildCounterJobPlacement < 3) { | |
817 unittest.expect(o.clusterName, unittest.equals('foo')); | |
818 unittest.expect(o.clusterUuid, unittest.equals('foo')); | |
819 } | |
820 buildCounterJobPlacement--; | |
821 } | |
822 | |
823 core.int buildCounterJobReference = 0; | |
824 buildJobReference() { | |
825 var o = new api.JobReference(); | |
826 buildCounterJobReference++; | |
827 if (buildCounterJobReference < 3) { | |
828 o.jobId = "foo"; | |
829 o.projectId = "foo"; | |
830 } | |
831 buildCounterJobReference--; | |
832 return o; | |
833 } | |
834 | |
835 checkJobReference(api.JobReference o) { | |
836 buildCounterJobReference++; | |
837 if (buildCounterJobReference < 3) { | |
838 unittest.expect(o.jobId, unittest.equals('foo')); | |
839 unittest.expect(o.projectId, unittest.equals('foo')); | |
840 } | |
841 buildCounterJobReference--; | |
842 } | |
843 | |
844 core.int buildCounterJobScheduling = 0; | |
845 buildJobScheduling() { | |
846 var o = new api.JobScheduling(); | |
847 buildCounterJobScheduling++; | |
848 if (buildCounterJobScheduling < 3) { | |
849 o.maxFailuresPerHour = 42; | |
850 } | |
851 buildCounterJobScheduling--; | |
852 return o; | |
853 } | |
854 | |
855 checkJobScheduling(api.JobScheduling o) { | |
856 buildCounterJobScheduling++; | |
857 if (buildCounterJobScheduling < 3) { | |
858 unittest.expect(o.maxFailuresPerHour, unittest.equals(42)); | |
859 } | |
860 buildCounterJobScheduling--; | |
861 } | |
862 | |
863 core.int buildCounterJobStatus = 0; | |
864 buildJobStatus() { | |
865 var o = new api.JobStatus(); | |
866 buildCounterJobStatus++; | |
867 if (buildCounterJobStatus < 3) { | |
868 o.details = "foo"; | |
869 o.state = "foo"; | |
870 o.stateStartTime = "foo"; | |
871 o.substate = "foo"; | |
872 } | |
873 buildCounterJobStatus--; | |
874 return o; | |
875 } | |
876 | |
877 checkJobStatus(api.JobStatus o) { | |
878 buildCounterJobStatus++; | |
879 if (buildCounterJobStatus < 3) { | |
880 unittest.expect(o.details, unittest.equals('foo')); | |
881 unittest.expect(o.state, unittest.equals('foo')); | |
882 unittest.expect(o.stateStartTime, unittest.equals('foo')); | |
883 unittest.expect(o.substate, unittest.equals('foo')); | |
884 } | |
885 buildCounterJobStatus--; | |
886 } | |
887 | |
888 buildUnnamed78() { | |
889 var o = new core.List<api.Cluster>(); | |
890 o.add(buildCluster()); | |
891 o.add(buildCluster()); | |
892 return o; | |
893 } | |
894 | |
895 checkUnnamed78(core.List<api.Cluster> o) { | |
896 unittest.expect(o, unittest.hasLength(2)); | |
897 checkCluster(o[0]); | |
898 checkCluster(o[1]); | |
899 } | |
900 | |
901 core.int buildCounterListClustersResponse = 0; | |
902 buildListClustersResponse() { | |
903 var o = new api.ListClustersResponse(); | |
904 buildCounterListClustersResponse++; | |
905 if (buildCounterListClustersResponse < 3) { | |
906 o.clusters = buildUnnamed78(); | |
907 o.nextPageToken = "foo"; | |
908 } | |
909 buildCounterListClustersResponse--; | |
910 return o; | |
911 } | |
912 | |
913 checkListClustersResponse(api.ListClustersResponse o) { | |
914 buildCounterListClustersResponse++; | |
915 if (buildCounterListClustersResponse < 3) { | |
916 checkUnnamed78(o.clusters); | |
917 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
918 } | |
919 buildCounterListClustersResponse--; | |
920 } | |
921 | |
922 buildUnnamed79() { | |
923 var o = new core.List<api.Job>(); | |
924 o.add(buildJob()); | |
925 o.add(buildJob()); | |
926 return o; | |
927 } | |
928 | |
929 checkUnnamed79(core.List<api.Job> o) { | |
930 unittest.expect(o, unittest.hasLength(2)); | |
931 checkJob(o[0]); | |
932 checkJob(o[1]); | |
933 } | |
934 | |
935 core.int buildCounterListJobsResponse = 0; | |
936 buildListJobsResponse() { | |
937 var o = new api.ListJobsResponse(); | |
938 buildCounterListJobsResponse++; | |
939 if (buildCounterListJobsResponse < 3) { | |
940 o.jobs = buildUnnamed79(); | |
941 o.nextPageToken = "foo"; | |
942 } | |
943 buildCounterListJobsResponse--; | |
944 return o; | |
945 } | |
946 | |
947 checkListJobsResponse(api.ListJobsResponse o) { | |
948 buildCounterListJobsResponse++; | |
949 if (buildCounterListJobsResponse < 3) { | |
950 checkUnnamed79(o.jobs); | |
951 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
952 } | |
953 buildCounterListJobsResponse--; | |
954 } | |
955 | |
956 buildUnnamed80() { | |
957 var o = new core.List<api.Operation>(); | |
958 o.add(buildOperation()); | |
959 o.add(buildOperation()); | |
960 return o; | |
961 } | |
962 | |
963 checkUnnamed80(core.List<api.Operation> o) { | |
964 unittest.expect(o, unittest.hasLength(2)); | |
965 checkOperation(o[0]); | |
966 checkOperation(o[1]); | |
967 } | |
968 | |
969 core.int buildCounterListOperationsResponse = 0; | |
970 buildListOperationsResponse() { | |
971 var o = new api.ListOperationsResponse(); | |
972 buildCounterListOperationsResponse++; | |
973 if (buildCounterListOperationsResponse < 3) { | |
974 o.nextPageToken = "foo"; | |
975 o.operations = buildUnnamed80(); | |
976 } | |
977 buildCounterListOperationsResponse--; | |
978 return o; | |
979 } | |
980 | |
981 checkListOperationsResponse(api.ListOperationsResponse o) { | |
982 buildCounterListOperationsResponse++; | |
983 if (buildCounterListOperationsResponse < 3) { | |
984 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
985 checkUnnamed80(o.operations); | |
986 } | |
987 buildCounterListOperationsResponse--; | |
988 } | |
989 | |
990 buildUnnamed81() { | |
991 var o = new core.Map<core.String, core.String>(); | |
992 o["x"] = "foo"; | |
993 o["y"] = "foo"; | |
994 return o; | |
995 } | |
996 | |
997 checkUnnamed81(core.Map<core.String, core.String> o) { | |
998 unittest.expect(o, unittest.hasLength(2)); | |
999 unittest.expect(o["x"], unittest.equals('foo')); | |
1000 unittest.expect(o["y"], unittest.equals('foo')); | |
1001 } | |
1002 | |
1003 core.int buildCounterLoggingConfig = 0; | |
1004 buildLoggingConfig() { | |
1005 var o = new api.LoggingConfig(); | |
1006 buildCounterLoggingConfig++; | |
1007 if (buildCounterLoggingConfig < 3) { | |
1008 o.driverLogLevels = buildUnnamed81(); | |
1009 } | |
1010 buildCounterLoggingConfig--; | |
1011 return o; | |
1012 } | |
1013 | |
1014 checkLoggingConfig(api.LoggingConfig o) { | |
1015 buildCounterLoggingConfig++; | |
1016 if (buildCounterLoggingConfig < 3) { | |
1017 checkUnnamed81(o.driverLogLevels); | |
1018 } | |
1019 buildCounterLoggingConfig--; | |
1020 } | |
1021 | |
1022 core.int buildCounterManagedGroupConfig = 0; | |
1023 buildManagedGroupConfig() { | |
1024 var o = new api.ManagedGroupConfig(); | |
1025 buildCounterManagedGroupConfig++; | |
1026 if (buildCounterManagedGroupConfig < 3) { | |
1027 o.instanceGroupManagerName = "foo"; | |
1028 o.instanceTemplateName = "foo"; | |
1029 } | |
1030 buildCounterManagedGroupConfig--; | |
1031 return o; | |
1032 } | |
1033 | |
1034 checkManagedGroupConfig(api.ManagedGroupConfig o) { | |
1035 buildCounterManagedGroupConfig++; | |
1036 if (buildCounterManagedGroupConfig < 3) { | |
1037 unittest.expect(o.instanceGroupManagerName, unittest.equals('foo')); | |
1038 unittest.expect(o.instanceTemplateName, unittest.equals('foo')); | |
1039 } | |
1040 buildCounterManagedGroupConfig--; | |
1041 } | |
1042 | |
1043 core.int buildCounterNodeInitializationAction = 0; | |
1044 buildNodeInitializationAction() { | |
1045 var o = new api.NodeInitializationAction(); | |
1046 buildCounterNodeInitializationAction++; | |
1047 if (buildCounterNodeInitializationAction < 3) { | |
1048 o.executableFile = "foo"; | |
1049 o.executionTimeout = "foo"; | |
1050 } | |
1051 buildCounterNodeInitializationAction--; | |
1052 return o; | |
1053 } | |
1054 | |
1055 checkNodeInitializationAction(api.NodeInitializationAction o) { | |
1056 buildCounterNodeInitializationAction++; | |
1057 if (buildCounterNodeInitializationAction < 3) { | |
1058 unittest.expect(o.executableFile, unittest.equals('foo')); | |
1059 unittest.expect(o.executionTimeout, unittest.equals('foo')); | |
1060 } | |
1061 buildCounterNodeInitializationAction--; | |
1062 } | |
1063 | |
1064 buildUnnamed82() { | |
1065 var o = new core.Map<core.String, core.Object>(); | |
1066 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
1067 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
1068 return o; | |
1069 } | |
1070 | |
1071 checkUnnamed82(core.Map<core.String, core.Object> o) { | |
1072 unittest.expect(o, unittest.hasLength(2)); | |
1073 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | |
1074 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | |
1075 } | |
1076 | |
1077 buildUnnamed83() { | |
1078 var o = new core.Map<core.String, core.Object>(); | |
1079 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
1080 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
1081 return o; | |
1082 } | |
1083 | |
1084 checkUnnamed83(core.Map<core.String, core.Object> o) { | |
1085 unittest.expect(o, unittest.hasLength(2)); | |
1086 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | |
1087 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | |
1088 } | |
1089 | |
1090 core.int buildCounterOperation = 0; | |
1091 buildOperation() { | |
1092 var o = new api.Operation(); | |
1093 buildCounterOperation++; | |
1094 if (buildCounterOperation < 3) { | |
1095 o.done = true; | |
1096 o.error = buildStatus(); | |
1097 o.metadata = buildUnnamed82(); | |
1098 o.name = "foo"; | |
1099 o.response = buildUnnamed83(); | |
1100 } | |
1101 buildCounterOperation--; | |
1102 return o; | |
1103 } | |
1104 | |
1105 checkOperation(api.Operation o) { | |
1106 buildCounterOperation++; | |
1107 if (buildCounterOperation < 3) { | |
1108 unittest.expect(o.done, unittest.isTrue); | |
1109 checkStatus(o.error); | |
1110 checkUnnamed82(o.metadata); | |
1111 unittest.expect(o.name, unittest.equals('foo')); | |
1112 checkUnnamed83(o.response); | |
1113 } | |
1114 buildCounterOperation--; | |
1115 } | |
1116 | |
1117 buildUnnamed84() { | |
1118 var o = new core.List<core.String>(); | |
1119 o.add("foo"); | |
1120 o.add("foo"); | |
1121 return o; | |
1122 } | |
1123 | |
1124 checkUnnamed84(core.List<core.String> o) { | |
1125 unittest.expect(o, unittest.hasLength(2)); | |
1126 unittest.expect(o[0], unittest.equals('foo')); | |
1127 unittest.expect(o[1], unittest.equals('foo')); | |
1128 } | |
1129 | |
1130 buildUnnamed85() { | |
1131 var o = new core.Map<core.String, core.String>(); | |
1132 o["x"] = "foo"; | |
1133 o["y"] = "foo"; | |
1134 return o; | |
1135 } | |
1136 | |
1137 checkUnnamed85(core.Map<core.String, core.String> o) { | |
1138 unittest.expect(o, unittest.hasLength(2)); | |
1139 unittest.expect(o["x"], unittest.equals('foo')); | |
1140 unittest.expect(o["y"], unittest.equals('foo')); | |
1141 } | |
1142 | |
1143 buildUnnamed86() { | |
1144 var o = new core.Map<core.String, core.String>(); | |
1145 o["x"] = "foo"; | |
1146 o["y"] = "foo"; | |
1147 return o; | |
1148 } | |
1149 | |
1150 checkUnnamed86(core.Map<core.String, core.String> o) { | |
1151 unittest.expect(o, unittest.hasLength(2)); | |
1152 unittest.expect(o["x"], unittest.equals('foo')); | |
1153 unittest.expect(o["y"], unittest.equals('foo')); | |
1154 } | |
1155 | |
1156 core.int buildCounterPigJob = 0; | |
1157 buildPigJob() { | |
1158 var o = new api.PigJob(); | |
1159 buildCounterPigJob++; | |
1160 if (buildCounterPigJob < 3) { | |
1161 o.continueOnFailure = true; | |
1162 o.jarFileUris = buildUnnamed84(); | |
1163 o.loggingConfig = buildLoggingConfig(); | |
1164 o.properties = buildUnnamed85(); | |
1165 o.queryFileUri = "foo"; | |
1166 o.queryList = buildQueryList(); | |
1167 o.scriptVariables = buildUnnamed86(); | |
1168 } | |
1169 buildCounterPigJob--; | |
1170 return o; | |
1171 } | |
1172 | |
1173 checkPigJob(api.PigJob o) { | |
1174 buildCounterPigJob++; | |
1175 if (buildCounterPigJob < 3) { | |
1176 unittest.expect(o.continueOnFailure, unittest.isTrue); | |
1177 checkUnnamed84(o.jarFileUris); | |
1178 checkLoggingConfig(o.loggingConfig); | |
1179 checkUnnamed85(o.properties); | |
1180 unittest.expect(o.queryFileUri, unittest.equals('foo')); | |
1181 checkQueryList(o.queryList); | |
1182 checkUnnamed86(o.scriptVariables); | |
1183 } | |
1184 buildCounterPigJob--; | |
1185 } | |
1186 | |
1187 buildUnnamed87() { | |
1188 var o = new core.List<core.String>(); | |
1189 o.add("foo"); | |
1190 o.add("foo"); | |
1191 return o; | |
1192 } | |
1193 | |
1194 checkUnnamed87(core.List<core.String> o) { | |
1195 unittest.expect(o, unittest.hasLength(2)); | |
1196 unittest.expect(o[0], unittest.equals('foo')); | |
1197 unittest.expect(o[1], unittest.equals('foo')); | |
1198 } | |
1199 | |
1200 buildUnnamed88() { | |
1201 var o = new core.List<core.String>(); | |
1202 o.add("foo"); | |
1203 o.add("foo"); | |
1204 return o; | |
1205 } | |
1206 | |
1207 checkUnnamed88(core.List<core.String> o) { | |
1208 unittest.expect(o, unittest.hasLength(2)); | |
1209 unittest.expect(o[0], unittest.equals('foo')); | |
1210 unittest.expect(o[1], unittest.equals('foo')); | |
1211 } | |
1212 | |
1213 buildUnnamed89() { | |
1214 var o = new core.List<core.String>(); | |
1215 o.add("foo"); | |
1216 o.add("foo"); | |
1217 return o; | |
1218 } | |
1219 | |
1220 checkUnnamed89(core.List<core.String> o) { | |
1221 unittest.expect(o, unittest.hasLength(2)); | |
1222 unittest.expect(o[0], unittest.equals('foo')); | |
1223 unittest.expect(o[1], unittest.equals('foo')); | |
1224 } | |
1225 | |
1226 buildUnnamed90() { | |
1227 var o = new core.List<core.String>(); | |
1228 o.add("foo"); | |
1229 o.add("foo"); | |
1230 return o; | |
1231 } | |
1232 | |
1233 checkUnnamed90(core.List<core.String> o) { | |
1234 unittest.expect(o, unittest.hasLength(2)); | |
1235 unittest.expect(o[0], unittest.equals('foo')); | |
1236 unittest.expect(o[1], unittest.equals('foo')); | |
1237 } | |
1238 | |
1239 buildUnnamed91() { | |
1240 var o = new core.Map<core.String, core.String>(); | |
1241 o["x"] = "foo"; | |
1242 o["y"] = "foo"; | |
1243 return o; | |
1244 } | |
1245 | |
1246 checkUnnamed91(core.Map<core.String, core.String> o) { | |
1247 unittest.expect(o, unittest.hasLength(2)); | |
1248 unittest.expect(o["x"], unittest.equals('foo')); | |
1249 unittest.expect(o["y"], unittest.equals('foo')); | |
1250 } | |
1251 | |
1252 buildUnnamed92() { | |
1253 var o = new core.List<core.String>(); | |
1254 o.add("foo"); | |
1255 o.add("foo"); | |
1256 return o; | |
1257 } | |
1258 | |
1259 checkUnnamed92(core.List<core.String> o) { | |
1260 unittest.expect(o, unittest.hasLength(2)); | |
1261 unittest.expect(o[0], unittest.equals('foo')); | |
1262 unittest.expect(o[1], unittest.equals('foo')); | |
1263 } | |
1264 | |
1265 core.int buildCounterPySparkJob = 0; | |
1266 buildPySparkJob() { | |
1267 var o = new api.PySparkJob(); | |
1268 buildCounterPySparkJob++; | |
1269 if (buildCounterPySparkJob < 3) { | |
1270 o.archiveUris = buildUnnamed87(); | |
1271 o.args = buildUnnamed88(); | |
1272 o.fileUris = buildUnnamed89(); | |
1273 o.jarFileUris = buildUnnamed90(); | |
1274 o.loggingConfig = buildLoggingConfig(); | |
1275 o.mainPythonFileUri = "foo"; | |
1276 o.properties = buildUnnamed91(); | |
1277 o.pythonFileUris = buildUnnamed92(); | |
1278 } | |
1279 buildCounterPySparkJob--; | |
1280 return o; | |
1281 } | |
1282 | |
1283 checkPySparkJob(api.PySparkJob o) { | |
1284 buildCounterPySparkJob++; | |
1285 if (buildCounterPySparkJob < 3) { | |
1286 checkUnnamed87(o.archiveUris); | |
1287 checkUnnamed88(o.args); | |
1288 checkUnnamed89(o.fileUris); | |
1289 checkUnnamed90(o.jarFileUris); | |
1290 checkLoggingConfig(o.loggingConfig); | |
1291 unittest.expect(o.mainPythonFileUri, unittest.equals('foo')); | |
1292 checkUnnamed91(o.properties); | |
1293 checkUnnamed92(o.pythonFileUris); | |
1294 } | |
1295 buildCounterPySparkJob--; | |
1296 } | |
1297 | |
1298 buildUnnamed93() { | |
1299 var o = new core.List<core.String>(); | |
1300 o.add("foo"); | |
1301 o.add("foo"); | |
1302 return o; | |
1303 } | |
1304 | |
1305 checkUnnamed93(core.List<core.String> o) { | |
1306 unittest.expect(o, unittest.hasLength(2)); | |
1307 unittest.expect(o[0], unittest.equals('foo')); | |
1308 unittest.expect(o[1], unittest.equals('foo')); | |
1309 } | |
1310 | |
1311 core.int buildCounterQueryList = 0; | |
1312 buildQueryList() { | |
1313 var o = new api.QueryList(); | |
1314 buildCounterQueryList++; | |
1315 if (buildCounterQueryList < 3) { | |
1316 o.queries = buildUnnamed93(); | |
1317 } | |
1318 buildCounterQueryList--; | |
1319 return o; | |
1320 } | |
1321 | |
1322 checkQueryList(api.QueryList o) { | |
1323 buildCounterQueryList++; | |
1324 if (buildCounterQueryList < 3) { | |
1325 checkUnnamed93(o.queries); | |
1326 } | |
1327 buildCounterQueryList--; | |
1328 } | |
1329 | |
1330 buildUnnamed94() { | |
1331 var o = new core.Map<core.String, core.String>(); | |
1332 o["x"] = "foo"; | |
1333 o["y"] = "foo"; | |
1334 return o; | |
1335 } | |
1336 | |
1337 checkUnnamed94(core.Map<core.String, core.String> o) { | |
1338 unittest.expect(o, unittest.hasLength(2)); | |
1339 unittest.expect(o["x"], unittest.equals('foo')); | |
1340 unittest.expect(o["y"], unittest.equals('foo')); | |
1341 } | |
1342 | |
1343 core.int buildCounterSoftwareConfig = 0; | |
1344 buildSoftwareConfig() { | |
1345 var o = new api.SoftwareConfig(); | |
1346 buildCounterSoftwareConfig++; | |
1347 if (buildCounterSoftwareConfig < 3) { | |
1348 o.imageVersion = "foo"; | |
1349 o.properties = buildUnnamed94(); | |
1350 } | |
1351 buildCounterSoftwareConfig--; | |
1352 return o; | |
1353 } | |
1354 | |
1355 checkSoftwareConfig(api.SoftwareConfig o) { | |
1356 buildCounterSoftwareConfig++; | |
1357 if (buildCounterSoftwareConfig < 3) { | |
1358 unittest.expect(o.imageVersion, unittest.equals('foo')); | |
1359 checkUnnamed94(o.properties); | |
1360 } | |
1361 buildCounterSoftwareConfig--; | |
1362 } | |
1363 | |
1364 buildUnnamed95() { | |
1365 var o = new core.List<core.String>(); | |
1366 o.add("foo"); | |
1367 o.add("foo"); | |
1368 return o; | |
1369 } | |
1370 | |
1371 checkUnnamed95(core.List<core.String> o) { | |
1372 unittest.expect(o, unittest.hasLength(2)); | |
1373 unittest.expect(o[0], unittest.equals('foo')); | |
1374 unittest.expect(o[1], unittest.equals('foo')); | |
1375 } | |
1376 | |
1377 buildUnnamed96() { | |
1378 var o = new core.List<core.String>(); | |
1379 o.add("foo"); | |
1380 o.add("foo"); | |
1381 return o; | |
1382 } | |
1383 | |
1384 checkUnnamed96(core.List<core.String> o) { | |
1385 unittest.expect(o, unittest.hasLength(2)); | |
1386 unittest.expect(o[0], unittest.equals('foo')); | |
1387 unittest.expect(o[1], unittest.equals('foo')); | |
1388 } | |
1389 | |
1390 buildUnnamed97() { | |
1391 var o = new core.List<core.String>(); | |
1392 o.add("foo"); | |
1393 o.add("foo"); | |
1394 return o; | |
1395 } | |
1396 | |
1397 checkUnnamed97(core.List<core.String> o) { | |
1398 unittest.expect(o, unittest.hasLength(2)); | |
1399 unittest.expect(o[0], unittest.equals('foo')); | |
1400 unittest.expect(o[1], unittest.equals('foo')); | |
1401 } | |
1402 | |
1403 buildUnnamed98() { | |
1404 var o = new core.List<core.String>(); | |
1405 o.add("foo"); | |
1406 o.add("foo"); | |
1407 return o; | |
1408 } | |
1409 | |
1410 checkUnnamed98(core.List<core.String> o) { | |
1411 unittest.expect(o, unittest.hasLength(2)); | |
1412 unittest.expect(o[0], unittest.equals('foo')); | |
1413 unittest.expect(o[1], unittest.equals('foo')); | |
1414 } | |
1415 | |
1416 buildUnnamed99() { | |
1417 var o = new core.Map<core.String, core.String>(); | |
1418 o["x"] = "foo"; | |
1419 o["y"] = "foo"; | |
1420 return o; | |
1421 } | |
1422 | |
1423 checkUnnamed99(core.Map<core.String, core.String> o) { | |
1424 unittest.expect(o, unittest.hasLength(2)); | |
1425 unittest.expect(o["x"], unittest.equals('foo')); | |
1426 unittest.expect(o["y"], unittest.equals('foo')); | |
1427 } | |
1428 | |
1429 core.int buildCounterSparkJob = 0; | |
1430 buildSparkJob() { | |
1431 var o = new api.SparkJob(); | |
1432 buildCounterSparkJob++; | |
1433 if (buildCounterSparkJob < 3) { | |
1434 o.archiveUris = buildUnnamed95(); | |
1435 o.args = buildUnnamed96(); | |
1436 o.fileUris = buildUnnamed97(); | |
1437 o.jarFileUris = buildUnnamed98(); | |
1438 o.loggingConfig = buildLoggingConfig(); | |
1439 o.mainClass = "foo"; | |
1440 o.mainJarFileUri = "foo"; | |
1441 o.properties = buildUnnamed99(); | |
1442 } | |
1443 buildCounterSparkJob--; | |
1444 return o; | |
1445 } | |
1446 | |
1447 checkSparkJob(api.SparkJob o) { | |
1448 buildCounterSparkJob++; | |
1449 if (buildCounterSparkJob < 3) { | |
1450 checkUnnamed95(o.archiveUris); | |
1451 checkUnnamed96(o.args); | |
1452 checkUnnamed97(o.fileUris); | |
1453 checkUnnamed98(o.jarFileUris); | |
1454 checkLoggingConfig(o.loggingConfig); | |
1455 unittest.expect(o.mainClass, unittest.equals('foo')); | |
1456 unittest.expect(o.mainJarFileUri, unittest.equals('foo')); | |
1457 checkUnnamed99(o.properties); | |
1458 } | |
1459 buildCounterSparkJob--; | |
1460 } | |
1461 | |
1462 buildUnnamed100() { | |
1463 var o = new core.List<core.String>(); | |
1464 o.add("foo"); | |
1465 o.add("foo"); | |
1466 return o; | |
1467 } | |
1468 | |
1469 checkUnnamed100(core.List<core.String> o) { | |
1470 unittest.expect(o, unittest.hasLength(2)); | |
1471 unittest.expect(o[0], unittest.equals('foo')); | |
1472 unittest.expect(o[1], unittest.equals('foo')); | |
1473 } | |
1474 | |
1475 buildUnnamed101() { | |
1476 var o = new core.Map<core.String, core.String>(); | |
1477 o["x"] = "foo"; | |
1478 o["y"] = "foo"; | |
1479 return o; | |
1480 } | |
1481 | |
1482 checkUnnamed101(core.Map<core.String, core.String> o) { | |
1483 unittest.expect(o, unittest.hasLength(2)); | |
1484 unittest.expect(o["x"], unittest.equals('foo')); | |
1485 unittest.expect(o["y"], unittest.equals('foo')); | |
1486 } | |
1487 | |
1488 buildUnnamed102() { | |
1489 var o = new core.Map<core.String, core.String>(); | |
1490 o["x"] = "foo"; | |
1491 o["y"] = "foo"; | |
1492 return o; | |
1493 } | |
1494 | |
1495 checkUnnamed102(core.Map<core.String, core.String> o) { | |
1496 unittest.expect(o, unittest.hasLength(2)); | |
1497 unittest.expect(o["x"], unittest.equals('foo')); | |
1498 unittest.expect(o["y"], unittest.equals('foo')); | |
1499 } | |
1500 | |
1501 core.int buildCounterSparkSqlJob = 0; | |
1502 buildSparkSqlJob() { | |
1503 var o = new api.SparkSqlJob(); | |
1504 buildCounterSparkSqlJob++; | |
1505 if (buildCounterSparkSqlJob < 3) { | |
1506 o.jarFileUris = buildUnnamed100(); | |
1507 o.loggingConfig = buildLoggingConfig(); | |
1508 o.properties = buildUnnamed101(); | |
1509 o.queryFileUri = "foo"; | |
1510 o.queryList = buildQueryList(); | |
1511 o.scriptVariables = buildUnnamed102(); | |
1512 } | |
1513 buildCounterSparkSqlJob--; | |
1514 return o; | |
1515 } | |
1516 | |
1517 checkSparkSqlJob(api.SparkSqlJob o) { | |
1518 buildCounterSparkSqlJob++; | |
1519 if (buildCounterSparkSqlJob < 3) { | |
1520 checkUnnamed100(o.jarFileUris); | |
1521 checkLoggingConfig(o.loggingConfig); | |
1522 checkUnnamed101(o.properties); | |
1523 unittest.expect(o.queryFileUri, unittest.equals('foo')); | |
1524 checkQueryList(o.queryList); | |
1525 checkUnnamed102(o.scriptVariables); | |
1526 } | |
1527 buildCounterSparkSqlJob--; | |
1528 } | |
1529 | |
1530 buildUnnamed103() { | |
1531 var o = new core.Map<core.String, core.Object>(); | |
1532 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
1533 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
1534 return o; | |
1535 } | |
1536 | |
1537 checkUnnamed103(core.Map<core.String, core.Object> o) { | |
1538 unittest.expect(o, unittest.hasLength(2)); | |
1539 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | |
1540 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | |
1541 } | |
1542 | |
1543 buildUnnamed104() { | |
1544 var o = new core.List<core.Map<core.String, core.Object>>(); | |
1545 o.add(buildUnnamed103()); | |
1546 o.add(buildUnnamed103()); | |
1547 return o; | |
1548 } | |
1549 | |
1550 checkUnnamed104(core.List<core.Map<core.String, core.Object>> o) { | |
1551 unittest.expect(o, unittest.hasLength(2)); | |
1552 checkUnnamed103(o[0]); | |
1553 checkUnnamed103(o[1]); | |
1554 } | |
1555 | |
1556 core.int buildCounterStatus = 0; | |
1557 buildStatus() { | |
1558 var o = new api.Status(); | |
1559 buildCounterStatus++; | |
1560 if (buildCounterStatus < 3) { | |
1561 o.code = 42; | |
1562 o.details = buildUnnamed104(); | |
1563 o.message = "foo"; | |
1564 } | |
1565 buildCounterStatus--; | |
1566 return o; | |
1567 } | |
1568 | |
1569 checkStatus(api.Status o) { | |
1570 buildCounterStatus++; | |
1571 if (buildCounterStatus < 3) { | |
1572 unittest.expect(o.code, unittest.equals(42)); | |
1573 checkUnnamed104(o.details); | |
1574 unittest.expect(o.message, unittest.equals('foo')); | |
1575 } | |
1576 buildCounterStatus--; | |
1577 } | |
1578 | |
1579 core.int buildCounterSubmitJobRequest = 0; | |
1580 buildSubmitJobRequest() { | |
1581 var o = new api.SubmitJobRequest(); | |
1582 buildCounterSubmitJobRequest++; | |
1583 if (buildCounterSubmitJobRequest < 3) { | |
1584 o.job = buildJob(); | |
1585 } | |
1586 buildCounterSubmitJobRequest--; | |
1587 return o; | |
1588 } | |
1589 | |
1590 checkSubmitJobRequest(api.SubmitJobRequest o) { | |
1591 buildCounterSubmitJobRequest++; | |
1592 if (buildCounterSubmitJobRequest < 3) { | |
1593 checkJob(o.job); | |
1594 } | |
1595 buildCounterSubmitJobRequest--; | |
1596 } | |
1597 | |
1598 core.int buildCounterYarnApplication = 0; | |
1599 buildYarnApplication() { | |
1600 var o = new api.YarnApplication(); | |
1601 buildCounterYarnApplication++; | |
1602 if (buildCounterYarnApplication < 3) { | |
1603 o.name = "foo"; | |
1604 o.progress = 42.0; | |
1605 o.state = "foo"; | |
1606 o.trackingUrl = "foo"; | |
1607 } | |
1608 buildCounterYarnApplication--; | |
1609 return o; | |
1610 } | |
1611 | |
1612 checkYarnApplication(api.YarnApplication o) { | |
1613 buildCounterYarnApplication++; | |
1614 if (buildCounterYarnApplication < 3) { | |
1615 unittest.expect(o.name, unittest.equals('foo')); | |
1616 unittest.expect(o.progress, unittest.equals(42.0)); | |
1617 unittest.expect(o.state, unittest.equals('foo')); | |
1618 unittest.expect(o.trackingUrl, unittest.equals('foo')); | |
1619 } | |
1620 buildCounterYarnApplication--; | |
1621 } | |
1622 | |
1623 | |
1624 main() { | |
1625 unittest.group("obj-schema-AcceleratorConfig", () { | |
1626 unittest.test("to-json--from-json", () { | |
1627 var o = buildAcceleratorConfig(); | |
1628 var od = new api.AcceleratorConfig.fromJson(o.toJson()); | |
1629 checkAcceleratorConfig(od); | |
1630 }); | |
1631 }); | |
1632 | |
1633 | |
1634 unittest.group("obj-schema-CancelJobRequest", () { | |
1635 unittest.test("to-json--from-json", () { | |
1636 var o = buildCancelJobRequest(); | |
1637 var od = new api.CancelJobRequest.fromJson(o.toJson()); | |
1638 checkCancelJobRequest(od); | |
1639 }); | |
1640 }); | |
1641 | |
1642 | |
1643 unittest.group("obj-schema-Cluster", () { | |
1644 unittest.test("to-json--from-json", () { | |
1645 var o = buildCluster(); | |
1646 var od = new api.Cluster.fromJson(o.toJson()); | |
1647 checkCluster(od); | |
1648 }); | |
1649 }); | |
1650 | |
1651 | |
1652 unittest.group("obj-schema-ClusterConfig", () { | |
1653 unittest.test("to-json--from-json", () { | |
1654 var o = buildClusterConfig(); | |
1655 var od = new api.ClusterConfig.fromJson(o.toJson()); | |
1656 checkClusterConfig(od); | |
1657 }); | |
1658 }); | |
1659 | |
1660 | |
1661 unittest.group("obj-schema-ClusterMetrics", () { | |
1662 unittest.test("to-json--from-json", () { | |
1663 var o = buildClusterMetrics(); | |
1664 var od = new api.ClusterMetrics.fromJson(o.toJson()); | |
1665 checkClusterMetrics(od); | |
1666 }); | |
1667 }); | |
1668 | |
1669 | |
1670 unittest.group("obj-schema-ClusterOperationMetadata", () { | |
1671 unittest.test("to-json--from-json", () { | |
1672 var o = buildClusterOperationMetadata(); | |
1673 var od = new api.ClusterOperationMetadata.fromJson(o.toJson()); | |
1674 checkClusterOperationMetadata(od); | |
1675 }); | |
1676 }); | |
1677 | |
1678 | |
1679 unittest.group("obj-schema-ClusterOperationStatus", () { | |
1680 unittest.test("to-json--from-json", () { | |
1681 var o = buildClusterOperationStatus(); | |
1682 var od = new api.ClusterOperationStatus.fromJson(o.toJson()); | |
1683 checkClusterOperationStatus(od); | |
1684 }); | |
1685 }); | |
1686 | |
1687 | |
1688 unittest.group("obj-schema-ClusterStatus", () { | |
1689 unittest.test("to-json--from-json", () { | |
1690 var o = buildClusterStatus(); | |
1691 var od = new api.ClusterStatus.fromJson(o.toJson()); | |
1692 checkClusterStatus(od); | |
1693 }); | |
1694 }); | |
1695 | |
1696 | |
1697 unittest.group("obj-schema-DiagnoseClusterRequest", () { | |
1698 unittest.test("to-json--from-json", () { | |
1699 var o = buildDiagnoseClusterRequest(); | |
1700 var od = new api.DiagnoseClusterRequest.fromJson(o.toJson()); | |
1701 checkDiagnoseClusterRequest(od); | |
1702 }); | |
1703 }); | |
1704 | |
1705 | |
1706 unittest.group("obj-schema-DiskConfig", () { | |
1707 unittest.test("to-json--from-json", () { | |
1708 var o = buildDiskConfig(); | |
1709 var od = new api.DiskConfig.fromJson(o.toJson()); | |
1710 checkDiskConfig(od); | |
1711 }); | |
1712 }); | |
1713 | |
1714 | |
1715 unittest.group("obj-schema-Empty", () { | |
1716 unittest.test("to-json--from-json", () { | |
1717 var o = buildEmpty(); | |
1718 var od = new api.Empty.fromJson(o.toJson()); | |
1719 checkEmpty(od); | |
1720 }); | |
1721 }); | |
1722 | |
1723 | |
1724 unittest.group("obj-schema-GceClusterConfig", () { | |
1725 unittest.test("to-json--from-json", () { | |
1726 var o = buildGceClusterConfig(); | |
1727 var od = new api.GceClusterConfig.fromJson(o.toJson()); | |
1728 checkGceClusterConfig(od); | |
1729 }); | |
1730 }); | |
1731 | |
1732 | |
1733 unittest.group("obj-schema-HadoopJob", () { | |
1734 unittest.test("to-json--from-json", () { | |
1735 var o = buildHadoopJob(); | |
1736 var od = new api.HadoopJob.fromJson(o.toJson()); | |
1737 checkHadoopJob(od); | |
1738 }); | |
1739 }); | |
1740 | |
1741 | |
1742 unittest.group("obj-schema-HiveJob", () { | |
1743 unittest.test("to-json--from-json", () { | |
1744 var o = buildHiveJob(); | |
1745 var od = new api.HiveJob.fromJson(o.toJson()); | |
1746 checkHiveJob(od); | |
1747 }); | |
1748 }); | |
1749 | |
1750 | |
1751 unittest.group("obj-schema-InstanceGroupConfig", () { | |
1752 unittest.test("to-json--from-json", () { | |
1753 var o = buildInstanceGroupConfig(); | |
1754 var od = new api.InstanceGroupConfig.fromJson(o.toJson()); | |
1755 checkInstanceGroupConfig(od); | |
1756 }); | |
1757 }); | |
1758 | |
1759 | |
1760 unittest.group("obj-schema-Job", () { | |
1761 unittest.test("to-json--from-json", () { | |
1762 var o = buildJob(); | |
1763 var od = new api.Job.fromJson(o.toJson()); | |
1764 checkJob(od); | |
1765 }); | |
1766 }); | |
1767 | |
1768 | |
1769 unittest.group("obj-schema-JobPlacement", () { | |
1770 unittest.test("to-json--from-json", () { | |
1771 var o = buildJobPlacement(); | |
1772 var od = new api.JobPlacement.fromJson(o.toJson()); | |
1773 checkJobPlacement(od); | |
1774 }); | |
1775 }); | |
1776 | |
1777 | |
1778 unittest.group("obj-schema-JobReference", () { | |
1779 unittest.test("to-json--from-json", () { | |
1780 var o = buildJobReference(); | |
1781 var od = new api.JobReference.fromJson(o.toJson()); | |
1782 checkJobReference(od); | |
1783 }); | |
1784 }); | |
1785 | |
1786 | |
1787 unittest.group("obj-schema-JobScheduling", () { | |
1788 unittest.test("to-json--from-json", () { | |
1789 var o = buildJobScheduling(); | |
1790 var od = new api.JobScheduling.fromJson(o.toJson()); | |
1791 checkJobScheduling(od); | |
1792 }); | |
1793 }); | |
1794 | |
1795 | |
1796 unittest.group("obj-schema-JobStatus", () { | |
1797 unittest.test("to-json--from-json", () { | |
1798 var o = buildJobStatus(); | |
1799 var od = new api.JobStatus.fromJson(o.toJson()); | |
1800 checkJobStatus(od); | |
1801 }); | |
1802 }); | |
1803 | |
1804 | |
1805 unittest.group("obj-schema-ListClustersResponse", () { | |
1806 unittest.test("to-json--from-json", () { | |
1807 var o = buildListClustersResponse(); | |
1808 var od = new api.ListClustersResponse.fromJson(o.toJson()); | |
1809 checkListClustersResponse(od); | |
1810 }); | |
1811 }); | |
1812 | |
1813 | |
1814 unittest.group("obj-schema-ListJobsResponse", () { | |
1815 unittest.test("to-json--from-json", () { | |
1816 var o = buildListJobsResponse(); | |
1817 var od = new api.ListJobsResponse.fromJson(o.toJson()); | |
1818 checkListJobsResponse(od); | |
1819 }); | |
1820 }); | |
1821 | |
1822 | |
1823 unittest.group("obj-schema-ListOperationsResponse", () { | |
1824 unittest.test("to-json--from-json", () { | |
1825 var o = buildListOperationsResponse(); | |
1826 var od = new api.ListOperationsResponse.fromJson(o.toJson()); | |
1827 checkListOperationsResponse(od); | |
1828 }); | |
1829 }); | |
1830 | |
1831 | |
1832 unittest.group("obj-schema-LoggingConfig", () { | |
1833 unittest.test("to-json--from-json", () { | |
1834 var o = buildLoggingConfig(); | |
1835 var od = new api.LoggingConfig.fromJson(o.toJson()); | |
1836 checkLoggingConfig(od); | |
1837 }); | |
1838 }); | |
1839 | |
1840 | |
1841 unittest.group("obj-schema-ManagedGroupConfig", () { | |
1842 unittest.test("to-json--from-json", () { | |
1843 var o = buildManagedGroupConfig(); | |
1844 var od = new api.ManagedGroupConfig.fromJson(o.toJson()); | |
1845 checkManagedGroupConfig(od); | |
1846 }); | |
1847 }); | |
1848 | |
1849 | |
1850 unittest.group("obj-schema-NodeInitializationAction", () { | |
1851 unittest.test("to-json--from-json", () { | |
1852 var o = buildNodeInitializationAction(); | |
1853 var od = new api.NodeInitializationAction.fromJson(o.toJson()); | |
1854 checkNodeInitializationAction(od); | |
1855 }); | |
1856 }); | |
1857 | |
1858 | |
1859 unittest.group("obj-schema-Operation", () { | |
1860 unittest.test("to-json--from-json", () { | |
1861 var o = buildOperation(); | |
1862 var od = new api.Operation.fromJson(o.toJson()); | |
1863 checkOperation(od); | |
1864 }); | |
1865 }); | |
1866 | |
1867 | |
1868 unittest.group("obj-schema-PigJob", () { | |
1869 unittest.test("to-json--from-json", () { | |
1870 var o = buildPigJob(); | |
1871 var od = new api.PigJob.fromJson(o.toJson()); | |
1872 checkPigJob(od); | |
1873 }); | |
1874 }); | |
1875 | |
1876 | |
1877 unittest.group("obj-schema-PySparkJob", () { | |
1878 unittest.test("to-json--from-json", () { | |
1879 var o = buildPySparkJob(); | |
1880 var od = new api.PySparkJob.fromJson(o.toJson()); | |
1881 checkPySparkJob(od); | |
1882 }); | |
1883 }); | |
1884 | |
1885 | |
1886 unittest.group("obj-schema-QueryList", () { | |
1887 unittest.test("to-json--from-json", () { | |
1888 var o = buildQueryList(); | |
1889 var od = new api.QueryList.fromJson(o.toJson()); | |
1890 checkQueryList(od); | |
1891 }); | |
1892 }); | |
1893 | |
1894 | |
1895 unittest.group("obj-schema-SoftwareConfig", () { | |
1896 unittest.test("to-json--from-json", () { | |
1897 var o = buildSoftwareConfig(); | |
1898 var od = new api.SoftwareConfig.fromJson(o.toJson()); | |
1899 checkSoftwareConfig(od); | |
1900 }); | |
1901 }); | |
1902 | |
1903 | |
1904 unittest.group("obj-schema-SparkJob", () { | |
1905 unittest.test("to-json--from-json", () { | |
1906 var o = buildSparkJob(); | |
1907 var od = new api.SparkJob.fromJson(o.toJson()); | |
1908 checkSparkJob(od); | |
1909 }); | |
1910 }); | |
1911 | |
1912 | |
1913 unittest.group("obj-schema-SparkSqlJob", () { | |
1914 unittest.test("to-json--from-json", () { | |
1915 var o = buildSparkSqlJob(); | |
1916 var od = new api.SparkSqlJob.fromJson(o.toJson()); | |
1917 checkSparkSqlJob(od); | |
1918 }); | |
1919 }); | |
1920 | |
1921 | |
1922 unittest.group("obj-schema-Status", () { | |
1923 unittest.test("to-json--from-json", () { | |
1924 var o = buildStatus(); | |
1925 var od = new api.Status.fromJson(o.toJson()); | |
1926 checkStatus(od); | |
1927 }); | |
1928 }); | |
1929 | |
1930 | |
1931 unittest.group("obj-schema-SubmitJobRequest", () { | |
1932 unittest.test("to-json--from-json", () { | |
1933 var o = buildSubmitJobRequest(); | |
1934 var od = new api.SubmitJobRequest.fromJson(o.toJson()); | |
1935 checkSubmitJobRequest(od); | |
1936 }); | |
1937 }); | |
1938 | |
1939 | |
1940 unittest.group("obj-schema-YarnApplication", () { | |
1941 unittest.test("to-json--from-json", () { | |
1942 var o = buildYarnApplication(); | |
1943 var od = new api.YarnApplication.fromJson(o.toJson()); | |
1944 checkYarnApplication(od); | |
1945 }); | |
1946 }); | |
1947 | |
1948 | |
1949 unittest.group("resource-ProjectsRegionsClustersResourceApi", () { | |
1950 unittest.test("method--create", () { | |
1951 | |
1952 var mock = new HttpServerMock(); | |
1953 api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).pro
jects.regions.clusters; | |
1954 var arg_request = buildCluster(); | |
1955 var arg_projectId = "foo"; | |
1956 var arg_region = "foo"; | |
1957 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
1958 var obj = new api.Cluster.fromJson(json); | |
1959 checkCluster(obj); | |
1960 | |
1961 var path = (req.url).path; | |
1962 var pathOffset = 0; | |
1963 var index; | |
1964 var subPart; | |
1965 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1966 pathOffset += 1; | |
1967 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
1968 pathOffset += 17; | |
1969 index = path.indexOf("/regions/", pathOffset); | |
1970 unittest.expect(index >= 0, unittest.isTrue); | |
1971 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
1972 pathOffset = index; | |
1973 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
1974 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
1975 pathOffset += 9; | |
1976 index = path.indexOf("/clusters", pathOffset); | |
1977 unittest.expect(index >= 0, unittest.isTrue); | |
1978 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
1979 pathOffset = index; | |
1980 unittest.expect(subPart, unittest.equals("$arg_region")); | |
1981 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clusters")); | |
1982 pathOffset += 9; | |
1983 | |
1984 var query = (req.url).query; | |
1985 var queryOffset = 0; | |
1986 var queryMap = {}; | |
1987 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1988 parseBool(n) { | |
1989 if (n == "true") return true; | |
1990 if (n == "false") return false; | |
1991 if (n == null) return null; | |
1992 throw new core.ArgumentError("Invalid boolean: $n"); | |
1993 } | |
1994 if (query.length > 0) { | |
1995 for (var part in query.split("&")) { | |
1996 var keyvalue = part.split("="); | |
1997 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1998 } | |
1999 } | |
2000 | |
2001 | |
2002 var h = { | |
2003 "content-type" : "application/json; charset=utf-8", | |
2004 }; | |
2005 var resp = convert.JSON.encode(buildOperation()); | |
2006 return new async.Future.value(stringResponse(200, h, resp)); | |
2007 }), true); | |
2008 res.create(arg_request, arg_projectId, arg_region).then(unittest.expectAsy
nc1(((api.Operation response) { | |
2009 checkOperation(response); | |
2010 }))); | |
2011 }); | |
2012 | |
2013 unittest.test("method--delete", () { | |
2014 | |
2015 var mock = new HttpServerMock(); | |
2016 api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).pro
jects.regions.clusters; | |
2017 var arg_projectId = "foo"; | |
2018 var arg_region = "foo"; | |
2019 var arg_clusterName = "foo"; | |
2020 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2021 var path = (req.url).path; | |
2022 var pathOffset = 0; | |
2023 var index; | |
2024 var subPart; | |
2025 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2026 pathOffset += 1; | |
2027 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2028 pathOffset += 17; | |
2029 index = path.indexOf("/regions/", pathOffset); | |
2030 unittest.expect(index >= 0, unittest.isTrue); | |
2031 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2032 pathOffset = index; | |
2033 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2034 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2035 pathOffset += 9; | |
2036 index = path.indexOf("/clusters/", pathOffset); | |
2037 unittest.expect(index >= 0, unittest.isTrue); | |
2038 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2039 pathOffset = index; | |
2040 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2041 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | |
2042 pathOffset += 10; | |
2043 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2044 pathOffset = path.length; | |
2045 unittest.expect(subPart, unittest.equals("$arg_clusterName")); | |
2046 | |
2047 var query = (req.url).query; | |
2048 var queryOffset = 0; | |
2049 var queryMap = {}; | |
2050 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2051 parseBool(n) { | |
2052 if (n == "true") return true; | |
2053 if (n == "false") return false; | |
2054 if (n == null) return null; | |
2055 throw new core.ArgumentError("Invalid boolean: $n"); | |
2056 } | |
2057 if (query.length > 0) { | |
2058 for (var part in query.split("&")) { | |
2059 var keyvalue = part.split("="); | |
2060 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2061 } | |
2062 } | |
2063 | |
2064 | |
2065 var h = { | |
2066 "content-type" : "application/json; charset=utf-8", | |
2067 }; | |
2068 var resp = convert.JSON.encode(buildOperation()); | |
2069 return new async.Future.value(stringResponse(200, h, resp)); | |
2070 }), true); | |
2071 res.delete(arg_projectId, arg_region, arg_clusterName).then(unittest.expec
tAsync1(((api.Operation response) { | |
2072 checkOperation(response); | |
2073 }))); | |
2074 }); | |
2075 | |
2076 unittest.test("method--diagnose", () { | |
2077 | |
2078 var mock = new HttpServerMock(); | |
2079 api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).pro
jects.regions.clusters; | |
2080 var arg_request = buildDiagnoseClusterRequest(); | |
2081 var arg_projectId = "foo"; | |
2082 var arg_region = "foo"; | |
2083 var arg_clusterName = "foo"; | |
2084 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2085 var obj = new api.DiagnoseClusterRequest.fromJson(json); | |
2086 checkDiagnoseClusterRequest(obj); | |
2087 | |
2088 var path = (req.url).path; | |
2089 var pathOffset = 0; | |
2090 var index; | |
2091 var subPart; | |
2092 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2093 pathOffset += 1; | |
2094 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2095 pathOffset += 17; | |
2096 index = path.indexOf("/regions/", pathOffset); | |
2097 unittest.expect(index >= 0, unittest.isTrue); | |
2098 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2099 pathOffset = index; | |
2100 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2101 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2102 pathOffset += 9; | |
2103 index = path.indexOf("/clusters/", pathOffset); | |
2104 unittest.expect(index >= 0, unittest.isTrue); | |
2105 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2106 pathOffset = index; | |
2107 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2108 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | |
2109 pathOffset += 10; | |
2110 index = path.indexOf(":diagnose", pathOffset); | |
2111 unittest.expect(index >= 0, unittest.isTrue); | |
2112 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2113 pathOffset = index; | |
2114 unittest.expect(subPart, unittest.equals("$arg_clusterName")); | |
2115 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als(":diagnose")); | |
2116 pathOffset += 9; | |
2117 | |
2118 var query = (req.url).query; | |
2119 var queryOffset = 0; | |
2120 var queryMap = {}; | |
2121 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2122 parseBool(n) { | |
2123 if (n == "true") return true; | |
2124 if (n == "false") return false; | |
2125 if (n == null) return null; | |
2126 throw new core.ArgumentError("Invalid boolean: $n"); | |
2127 } | |
2128 if (query.length > 0) { | |
2129 for (var part in query.split("&")) { | |
2130 var keyvalue = part.split("="); | |
2131 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2132 } | |
2133 } | |
2134 | |
2135 | |
2136 var h = { | |
2137 "content-type" : "application/json; charset=utf-8", | |
2138 }; | |
2139 var resp = convert.JSON.encode(buildOperation()); | |
2140 return new async.Future.value(stringResponse(200, h, resp)); | |
2141 }), true); | |
2142 res.diagnose(arg_request, arg_projectId, arg_region, arg_clusterName).then
(unittest.expectAsync1(((api.Operation response) { | |
2143 checkOperation(response); | |
2144 }))); | |
2145 }); | |
2146 | |
2147 unittest.test("method--get", () { | |
2148 | |
2149 var mock = new HttpServerMock(); | |
2150 api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).pro
jects.regions.clusters; | |
2151 var arg_projectId = "foo"; | |
2152 var arg_region = "foo"; | |
2153 var arg_clusterName = "foo"; | |
2154 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2155 var path = (req.url).path; | |
2156 var pathOffset = 0; | |
2157 var index; | |
2158 var subPart; | |
2159 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2160 pathOffset += 1; | |
2161 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2162 pathOffset += 17; | |
2163 index = path.indexOf("/regions/", pathOffset); | |
2164 unittest.expect(index >= 0, unittest.isTrue); | |
2165 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2166 pathOffset = index; | |
2167 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2168 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2169 pathOffset += 9; | |
2170 index = path.indexOf("/clusters/", pathOffset); | |
2171 unittest.expect(index >= 0, unittest.isTrue); | |
2172 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2173 pathOffset = index; | |
2174 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2175 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | |
2176 pathOffset += 10; | |
2177 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2178 pathOffset = path.length; | |
2179 unittest.expect(subPart, unittest.equals("$arg_clusterName")); | |
2180 | |
2181 var query = (req.url).query; | |
2182 var queryOffset = 0; | |
2183 var queryMap = {}; | |
2184 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2185 parseBool(n) { | |
2186 if (n == "true") return true; | |
2187 if (n == "false") return false; | |
2188 if (n == null) return null; | |
2189 throw new core.ArgumentError("Invalid boolean: $n"); | |
2190 } | |
2191 if (query.length > 0) { | |
2192 for (var part in query.split("&")) { | |
2193 var keyvalue = part.split("="); | |
2194 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2195 } | |
2196 } | |
2197 | |
2198 | |
2199 var h = { | |
2200 "content-type" : "application/json; charset=utf-8", | |
2201 }; | |
2202 var resp = convert.JSON.encode(buildCluster()); | |
2203 return new async.Future.value(stringResponse(200, h, resp)); | |
2204 }), true); | |
2205 res.get(arg_projectId, arg_region, arg_clusterName).then(unittest.expectAs
ync1(((api.Cluster response) { | |
2206 checkCluster(response); | |
2207 }))); | |
2208 }); | |
2209 | |
2210 unittest.test("method--list", () { | |
2211 | |
2212 var mock = new HttpServerMock(); | |
2213 api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).pro
jects.regions.clusters; | |
2214 var arg_projectId = "foo"; | |
2215 var arg_region = "foo"; | |
2216 var arg_filter = "foo"; | |
2217 var arg_pageToken = "foo"; | |
2218 var arg_pageSize = 42; | |
2219 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2220 var path = (req.url).path; | |
2221 var pathOffset = 0; | |
2222 var index; | |
2223 var subPart; | |
2224 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2225 pathOffset += 1; | |
2226 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2227 pathOffset += 17; | |
2228 index = path.indexOf("/regions/", pathOffset); | |
2229 unittest.expect(index >= 0, unittest.isTrue); | |
2230 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2231 pathOffset = index; | |
2232 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2233 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2234 pathOffset += 9; | |
2235 index = path.indexOf("/clusters", pathOffset); | |
2236 unittest.expect(index >= 0, unittest.isTrue); | |
2237 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2238 pathOffset = index; | |
2239 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2240 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clusters")); | |
2241 pathOffset += 9; | |
2242 | |
2243 var query = (req.url).query; | |
2244 var queryOffset = 0; | |
2245 var queryMap = {}; | |
2246 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2247 parseBool(n) { | |
2248 if (n == "true") return true; | |
2249 if (n == "false") return false; | |
2250 if (n == null) return null; | |
2251 throw new core.ArgumentError("Invalid boolean: $n"); | |
2252 } | |
2253 if (query.length > 0) { | |
2254 for (var part in query.split("&")) { | |
2255 var keyvalue = part.split("="); | |
2256 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2257 } | |
2258 } | |
2259 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
2260 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
2261 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
2262 | |
2263 | |
2264 var h = { | |
2265 "content-type" : "application/json; charset=utf-8", | |
2266 }; | |
2267 var resp = convert.JSON.encode(buildListClustersResponse()); | |
2268 return new async.Future.value(stringResponse(200, h, resp)); | |
2269 }), true); | |
2270 res.list(arg_projectId, arg_region, filter: arg_filter, pageToken: arg_pag
eToken, pageSize: arg_pageSize).then(unittest.expectAsync1(((api.ListClustersRes
ponse response) { | |
2271 checkListClustersResponse(response); | |
2272 }))); | |
2273 }); | |
2274 | |
2275 unittest.test("method--patch", () { | |
2276 | |
2277 var mock = new HttpServerMock(); | |
2278 api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).pro
jects.regions.clusters; | |
2279 var arg_request = buildCluster(); | |
2280 var arg_projectId = "foo"; | |
2281 var arg_region = "foo"; | |
2282 var arg_clusterName = "foo"; | |
2283 var arg_updateMask = "foo"; | |
2284 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2285 var obj = new api.Cluster.fromJson(json); | |
2286 checkCluster(obj); | |
2287 | |
2288 var path = (req.url).path; | |
2289 var pathOffset = 0; | |
2290 var index; | |
2291 var subPart; | |
2292 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2293 pathOffset += 1; | |
2294 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2295 pathOffset += 17; | |
2296 index = path.indexOf("/regions/", pathOffset); | |
2297 unittest.expect(index >= 0, unittest.isTrue); | |
2298 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2299 pathOffset = index; | |
2300 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2301 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2302 pathOffset += 9; | |
2303 index = path.indexOf("/clusters/", pathOffset); | |
2304 unittest.expect(index >= 0, unittest.isTrue); | |
2305 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2306 pathOffset = index; | |
2307 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2308 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | |
2309 pathOffset += 10; | |
2310 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2311 pathOffset = path.length; | |
2312 unittest.expect(subPart, unittest.equals("$arg_clusterName")); | |
2313 | |
2314 var query = (req.url).query; | |
2315 var queryOffset = 0; | |
2316 var queryMap = {}; | |
2317 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2318 parseBool(n) { | |
2319 if (n == "true") return true; | |
2320 if (n == "false") return false; | |
2321 if (n == null) return null; | |
2322 throw new core.ArgumentError("Invalid boolean: $n"); | |
2323 } | |
2324 if (query.length > 0) { | |
2325 for (var part in query.split("&")) { | |
2326 var keyvalue = part.split("="); | |
2327 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2328 } | |
2329 } | |
2330 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); | |
2331 | |
2332 | |
2333 var h = { | |
2334 "content-type" : "application/json; charset=utf-8", | |
2335 }; | |
2336 var resp = convert.JSON.encode(buildOperation()); | |
2337 return new async.Future.value(stringResponse(200, h, resp)); | |
2338 }), true); | |
2339 res.patch(arg_request, arg_projectId, arg_region, arg_clusterName, updateM
ask: arg_updateMask).then(unittest.expectAsync1(((api.Operation response) { | |
2340 checkOperation(response); | |
2341 }))); | |
2342 }); | |
2343 | |
2344 }); | |
2345 | |
2346 | |
2347 unittest.group("resource-ProjectsRegionsJobsResourceApi", () { | |
2348 unittest.test("method--cancel", () { | |
2349 | |
2350 var mock = new HttpServerMock(); | |
2351 api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).project
s.regions.jobs; | |
2352 var arg_request = buildCancelJobRequest(); | |
2353 var arg_projectId = "foo"; | |
2354 var arg_region = "foo"; | |
2355 var arg_jobId = "foo"; | |
2356 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2357 var obj = new api.CancelJobRequest.fromJson(json); | |
2358 checkCancelJobRequest(obj); | |
2359 | |
2360 var path = (req.url).path; | |
2361 var pathOffset = 0; | |
2362 var index; | |
2363 var subPart; | |
2364 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2365 pathOffset += 1; | |
2366 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2367 pathOffset += 17; | |
2368 index = path.indexOf("/regions/", pathOffset); | |
2369 unittest.expect(index >= 0, unittest.isTrue); | |
2370 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2371 pathOffset = index; | |
2372 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2373 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2374 pathOffset += 9; | |
2375 index = path.indexOf("/jobs/", pathOffset); | |
2376 unittest.expect(index >= 0, unittest.isTrue); | |
2377 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2378 pathOffset = index; | |
2379 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2380 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/jobs/")); | |
2381 pathOffset += 6; | |
2382 index = path.indexOf(":cancel", pathOffset); | |
2383 unittest.expect(index >= 0, unittest.isTrue); | |
2384 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2385 pathOffset = index; | |
2386 unittest.expect(subPart, unittest.equals("$arg_jobId")); | |
2387 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als(":cancel")); | |
2388 pathOffset += 7; | |
2389 | |
2390 var query = (req.url).query; | |
2391 var queryOffset = 0; | |
2392 var queryMap = {}; | |
2393 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2394 parseBool(n) { | |
2395 if (n == "true") return true; | |
2396 if (n == "false") return false; | |
2397 if (n == null) return null; | |
2398 throw new core.ArgumentError("Invalid boolean: $n"); | |
2399 } | |
2400 if (query.length > 0) { | |
2401 for (var part in query.split("&")) { | |
2402 var keyvalue = part.split("="); | |
2403 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2404 } | |
2405 } | |
2406 | |
2407 | |
2408 var h = { | |
2409 "content-type" : "application/json; charset=utf-8", | |
2410 }; | |
2411 var resp = convert.JSON.encode(buildJob()); | |
2412 return new async.Future.value(stringResponse(200, h, resp)); | |
2413 }), true); | |
2414 res.cancel(arg_request, arg_projectId, arg_region, arg_jobId).then(unittes
t.expectAsync1(((api.Job response) { | |
2415 checkJob(response); | |
2416 }))); | |
2417 }); | |
2418 | |
2419 unittest.test("method--delete", () { | |
2420 | |
2421 var mock = new HttpServerMock(); | |
2422 api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).project
s.regions.jobs; | |
2423 var arg_projectId = "foo"; | |
2424 var arg_region = "foo"; | |
2425 var arg_jobId = "foo"; | |
2426 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2427 var path = (req.url).path; | |
2428 var pathOffset = 0; | |
2429 var index; | |
2430 var subPart; | |
2431 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2432 pathOffset += 1; | |
2433 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2434 pathOffset += 17; | |
2435 index = path.indexOf("/regions/", pathOffset); | |
2436 unittest.expect(index >= 0, unittest.isTrue); | |
2437 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2438 pathOffset = index; | |
2439 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2440 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2441 pathOffset += 9; | |
2442 index = path.indexOf("/jobs/", pathOffset); | |
2443 unittest.expect(index >= 0, unittest.isTrue); | |
2444 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2445 pathOffset = index; | |
2446 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2447 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/jobs/")); | |
2448 pathOffset += 6; | |
2449 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2450 pathOffset = path.length; | |
2451 unittest.expect(subPart, unittest.equals("$arg_jobId")); | |
2452 | |
2453 var query = (req.url).query; | |
2454 var queryOffset = 0; | |
2455 var queryMap = {}; | |
2456 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2457 parseBool(n) { | |
2458 if (n == "true") return true; | |
2459 if (n == "false") return false; | |
2460 if (n == null) return null; | |
2461 throw new core.ArgumentError("Invalid boolean: $n"); | |
2462 } | |
2463 if (query.length > 0) { | |
2464 for (var part in query.split("&")) { | |
2465 var keyvalue = part.split("="); | |
2466 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2467 } | |
2468 } | |
2469 | |
2470 | |
2471 var h = { | |
2472 "content-type" : "application/json; charset=utf-8", | |
2473 }; | |
2474 var resp = convert.JSON.encode(buildEmpty()); | |
2475 return new async.Future.value(stringResponse(200, h, resp)); | |
2476 }), true); | |
2477 res.delete(arg_projectId, arg_region, arg_jobId).then(unittest.expectAsync
1(((api.Empty response) { | |
2478 checkEmpty(response); | |
2479 }))); | |
2480 }); | |
2481 | |
2482 unittest.test("method--get", () { | |
2483 | |
2484 var mock = new HttpServerMock(); | |
2485 api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).project
s.regions.jobs; | |
2486 var arg_projectId = "foo"; | |
2487 var arg_region = "foo"; | |
2488 var arg_jobId = "foo"; | |
2489 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2490 var path = (req.url).path; | |
2491 var pathOffset = 0; | |
2492 var index; | |
2493 var subPart; | |
2494 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2495 pathOffset += 1; | |
2496 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2497 pathOffset += 17; | |
2498 index = path.indexOf("/regions/", pathOffset); | |
2499 unittest.expect(index >= 0, unittest.isTrue); | |
2500 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2501 pathOffset = index; | |
2502 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2503 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2504 pathOffset += 9; | |
2505 index = path.indexOf("/jobs/", pathOffset); | |
2506 unittest.expect(index >= 0, unittest.isTrue); | |
2507 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2508 pathOffset = index; | |
2509 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2510 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/jobs/")); | |
2511 pathOffset += 6; | |
2512 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2513 pathOffset = path.length; | |
2514 unittest.expect(subPart, unittest.equals("$arg_jobId")); | |
2515 | |
2516 var query = (req.url).query; | |
2517 var queryOffset = 0; | |
2518 var queryMap = {}; | |
2519 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2520 parseBool(n) { | |
2521 if (n == "true") return true; | |
2522 if (n == "false") return false; | |
2523 if (n == null) return null; | |
2524 throw new core.ArgumentError("Invalid boolean: $n"); | |
2525 } | |
2526 if (query.length > 0) { | |
2527 for (var part in query.split("&")) { | |
2528 var keyvalue = part.split("="); | |
2529 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2530 } | |
2531 } | |
2532 | |
2533 | |
2534 var h = { | |
2535 "content-type" : "application/json; charset=utf-8", | |
2536 }; | |
2537 var resp = convert.JSON.encode(buildJob()); | |
2538 return new async.Future.value(stringResponse(200, h, resp)); | |
2539 }), true); | |
2540 res.get(arg_projectId, arg_region, arg_jobId).then(unittest.expectAsync1((
(api.Job response) { | |
2541 checkJob(response); | |
2542 }))); | |
2543 }); | |
2544 | |
2545 unittest.test("method--list", () { | |
2546 | |
2547 var mock = new HttpServerMock(); | |
2548 api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).project
s.regions.jobs; | |
2549 var arg_projectId = "foo"; | |
2550 var arg_region = "foo"; | |
2551 var arg_filter = "foo"; | |
2552 var arg_jobStateMatcher = "foo"; | |
2553 var arg_pageToken = "foo"; | |
2554 var arg_pageSize = 42; | |
2555 var arg_clusterName = "foo"; | |
2556 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2557 var path = (req.url).path; | |
2558 var pathOffset = 0; | |
2559 var index; | |
2560 var subPart; | |
2561 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2562 pathOffset += 1; | |
2563 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2564 pathOffset += 17; | |
2565 index = path.indexOf("/regions/", pathOffset); | |
2566 unittest.expect(index >= 0, unittest.isTrue); | |
2567 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2568 pathOffset = index; | |
2569 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2570 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2571 pathOffset += 9; | |
2572 index = path.indexOf("/jobs", pathOffset); | |
2573 unittest.expect(index >= 0, unittest.isTrue); | |
2574 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2575 pathOffset = index; | |
2576 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2577 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/jobs")); | |
2578 pathOffset += 5; | |
2579 | |
2580 var query = (req.url).query; | |
2581 var queryOffset = 0; | |
2582 var queryMap = {}; | |
2583 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2584 parseBool(n) { | |
2585 if (n == "true") return true; | |
2586 if (n == "false") return false; | |
2587 if (n == null) return null; | |
2588 throw new core.ArgumentError("Invalid boolean: $n"); | |
2589 } | |
2590 if (query.length > 0) { | |
2591 for (var part in query.split("&")) { | |
2592 var keyvalue = part.split("="); | |
2593 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2594 } | |
2595 } | |
2596 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
2597 unittest.expect(queryMap["jobStateMatcher"].first, unittest.equals(arg_j
obStateMatcher)); | |
2598 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
2599 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
2600 unittest.expect(queryMap["clusterName"].first, unittest.equals(arg_clust
erName)); | |
2601 | |
2602 | |
2603 var h = { | |
2604 "content-type" : "application/json; charset=utf-8", | |
2605 }; | |
2606 var resp = convert.JSON.encode(buildListJobsResponse()); | |
2607 return new async.Future.value(stringResponse(200, h, resp)); | |
2608 }), true); | |
2609 res.list(arg_projectId, arg_region, filter: arg_filter, jobStateMatcher: a
rg_jobStateMatcher, pageToken: arg_pageToken, pageSize: arg_pageSize, clusterNam
e: arg_clusterName).then(unittest.expectAsync1(((api.ListJobsResponse response)
{ | |
2610 checkListJobsResponse(response); | |
2611 }))); | |
2612 }); | |
2613 | |
2614 unittest.test("method--patch", () { | |
2615 | |
2616 var mock = new HttpServerMock(); | |
2617 api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).project
s.regions.jobs; | |
2618 var arg_request = buildJob(); | |
2619 var arg_projectId = "foo"; | |
2620 var arg_region = "foo"; | |
2621 var arg_jobId = "foo"; | |
2622 var arg_updateMask = "foo"; | |
2623 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2624 var obj = new api.Job.fromJson(json); | |
2625 checkJob(obj); | |
2626 | |
2627 var path = (req.url).path; | |
2628 var pathOffset = 0; | |
2629 var index; | |
2630 var subPart; | |
2631 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2632 pathOffset += 1; | |
2633 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2634 pathOffset += 17; | |
2635 index = path.indexOf("/regions/", pathOffset); | |
2636 unittest.expect(index >= 0, unittest.isTrue); | |
2637 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2638 pathOffset = index; | |
2639 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2640 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2641 pathOffset += 9; | |
2642 index = path.indexOf("/jobs/", pathOffset); | |
2643 unittest.expect(index >= 0, unittest.isTrue); | |
2644 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2645 pathOffset = index; | |
2646 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2647 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/jobs/")); | |
2648 pathOffset += 6; | |
2649 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2650 pathOffset = path.length; | |
2651 unittest.expect(subPart, unittest.equals("$arg_jobId")); | |
2652 | |
2653 var query = (req.url).query; | |
2654 var queryOffset = 0; | |
2655 var queryMap = {}; | |
2656 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2657 parseBool(n) { | |
2658 if (n == "true") return true; | |
2659 if (n == "false") return false; | |
2660 if (n == null) return null; | |
2661 throw new core.ArgumentError("Invalid boolean: $n"); | |
2662 } | |
2663 if (query.length > 0) { | |
2664 for (var part in query.split("&")) { | |
2665 var keyvalue = part.split("="); | |
2666 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2667 } | |
2668 } | |
2669 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); | |
2670 | |
2671 | |
2672 var h = { | |
2673 "content-type" : "application/json; charset=utf-8", | |
2674 }; | |
2675 var resp = convert.JSON.encode(buildJob()); | |
2676 return new async.Future.value(stringResponse(200, h, resp)); | |
2677 }), true); | |
2678 res.patch(arg_request, arg_projectId, arg_region, arg_jobId, updateMask: a
rg_updateMask).then(unittest.expectAsync1(((api.Job response) { | |
2679 checkJob(response); | |
2680 }))); | |
2681 }); | |
2682 | |
2683 unittest.test("method--submit", () { | |
2684 | |
2685 var mock = new HttpServerMock(); | |
2686 api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).project
s.regions.jobs; | |
2687 var arg_request = buildSubmitJobRequest(); | |
2688 var arg_projectId = "foo"; | |
2689 var arg_region = "foo"; | |
2690 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2691 var obj = new api.SubmitJobRequest.fromJson(json); | |
2692 checkSubmitJobRequest(obj); | |
2693 | |
2694 var path = (req.url).path; | |
2695 var pathOffset = 0; | |
2696 var index; | |
2697 var subPart; | |
2698 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2699 pathOffset += 1; | |
2700 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta2/projects/")); | |
2701 pathOffset += 17; | |
2702 index = path.indexOf("/regions/", pathOffset); | |
2703 unittest.expect(index >= 0, unittest.isTrue); | |
2704 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2705 pathOffset = index; | |
2706 unittest.expect(subPart, unittest.equals("$arg_projectId")); | |
2707 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/regions/")); | |
2708 pathOffset += 9; | |
2709 index = path.indexOf("/jobs:submit", pathOffset); | |
2710 unittest.expect(index >= 0, unittest.isTrue); | |
2711 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2712 pathOffset = index; | |
2713 unittest.expect(subPart, unittest.equals("$arg_region")); | |
2714 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/jobs:submit")); | |
2715 pathOffset += 12; | |
2716 | |
2717 var query = (req.url).query; | |
2718 var queryOffset = 0; | |
2719 var queryMap = {}; | |
2720 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2721 parseBool(n) { | |
2722 if (n == "true") return true; | |
2723 if (n == "false") return false; | |
2724 if (n == null) return null; | |
2725 throw new core.ArgumentError("Invalid boolean: $n"); | |
2726 } | |
2727 if (query.length > 0) { | |
2728 for (var part in query.split("&")) { | |
2729 var keyvalue = part.split("="); | |
2730 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2731 } | |
2732 } | |
2733 | |
2734 | |
2735 var h = { | |
2736 "content-type" : "application/json; charset=utf-8", | |
2737 }; | |
2738 var resp = convert.JSON.encode(buildJob()); | |
2739 return new async.Future.value(stringResponse(200, h, resp)); | |
2740 }), true); | |
2741 res.submit(arg_request, arg_projectId, arg_region).then(unittest.expectAsy
nc1(((api.Job response) { | |
2742 checkJob(response); | |
2743 }))); | |
2744 }); | |
2745 | |
2746 }); | |
2747 | |
2748 | |
2749 unittest.group("resource-ProjectsRegionsOperationsResourceApi", () { | |
2750 unittest.test("method--cancel", () { | |
2751 | |
2752 var mock = new HttpServerMock(); | |
2753 api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).p
rojects.regions.operations; | |
2754 var arg_name = "foo"; | |
2755 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2756 var path = (req.url).path; | |
2757 var pathOffset = 0; | |
2758 var index; | |
2759 var subPart; | |
2760 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2761 pathOffset += 1; | |
2762 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | |
2763 pathOffset += 8; | |
2764 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
2765 | |
2766 var query = (req.url).query; | |
2767 var queryOffset = 0; | |
2768 var queryMap = {}; | |
2769 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2770 parseBool(n) { | |
2771 if (n == "true") return true; | |
2772 if (n == "false") return false; | |
2773 if (n == null) return null; | |
2774 throw new core.ArgumentError("Invalid boolean: $n"); | |
2775 } | |
2776 if (query.length > 0) { | |
2777 for (var part in query.split("&")) { | |
2778 var keyvalue = part.split("="); | |
2779 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2780 } | |
2781 } | |
2782 | |
2783 | |
2784 var h = { | |
2785 "content-type" : "application/json; charset=utf-8", | |
2786 }; | |
2787 var resp = convert.JSON.encode(buildEmpty()); | |
2788 return new async.Future.value(stringResponse(200, h, resp)); | |
2789 }), true); | |
2790 res.cancel(arg_name).then(unittest.expectAsync1(((api.Empty response) { | |
2791 checkEmpty(response); | |
2792 }))); | |
2793 }); | |
2794 | |
2795 unittest.test("method--delete", () { | |
2796 | |
2797 var mock = new HttpServerMock(); | |
2798 api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).p
rojects.regions.operations; | |
2799 var arg_name = "foo"; | |
2800 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2801 var path = (req.url).path; | |
2802 var pathOffset = 0; | |
2803 var index; | |
2804 var subPart; | |
2805 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2806 pathOffset += 1; | |
2807 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | |
2808 pathOffset += 8; | |
2809 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
2810 | |
2811 var query = (req.url).query; | |
2812 var queryOffset = 0; | |
2813 var queryMap = {}; | |
2814 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2815 parseBool(n) { | |
2816 if (n == "true") return true; | |
2817 if (n == "false") return false; | |
2818 if (n == null) return null; | |
2819 throw new core.ArgumentError("Invalid boolean: $n"); | |
2820 } | |
2821 if (query.length > 0) { | |
2822 for (var part in query.split("&")) { | |
2823 var keyvalue = part.split("="); | |
2824 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2825 } | |
2826 } | |
2827 | |
2828 | |
2829 var h = { | |
2830 "content-type" : "application/json; charset=utf-8", | |
2831 }; | |
2832 var resp = convert.JSON.encode(buildEmpty()); | |
2833 return new async.Future.value(stringResponse(200, h, resp)); | |
2834 }), true); | |
2835 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { | |
2836 checkEmpty(response); | |
2837 }))); | |
2838 }); | |
2839 | |
2840 unittest.test("method--get", () { | |
2841 | |
2842 var mock = new HttpServerMock(); | |
2843 api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).p
rojects.regions.operations; | |
2844 var arg_name = "foo"; | |
2845 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2846 var path = (req.url).path; | |
2847 var pathOffset = 0; | |
2848 var index; | |
2849 var subPart; | |
2850 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2851 pathOffset += 1; | |
2852 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | |
2853 pathOffset += 8; | |
2854 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
2855 | |
2856 var query = (req.url).query; | |
2857 var queryOffset = 0; | |
2858 var queryMap = {}; | |
2859 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2860 parseBool(n) { | |
2861 if (n == "true") return true; | |
2862 if (n == "false") return false; | |
2863 if (n == null) return null; | |
2864 throw new core.ArgumentError("Invalid boolean: $n"); | |
2865 } | |
2866 if (query.length > 0) { | |
2867 for (var part in query.split("&")) { | |
2868 var keyvalue = part.split("="); | |
2869 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2870 } | |
2871 } | |
2872 | |
2873 | |
2874 var h = { | |
2875 "content-type" : "application/json; charset=utf-8", | |
2876 }; | |
2877 var resp = convert.JSON.encode(buildOperation()); | |
2878 return new async.Future.value(stringResponse(200, h, resp)); | |
2879 }), true); | |
2880 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { | |
2881 checkOperation(response); | |
2882 }))); | |
2883 }); | |
2884 | |
2885 unittest.test("method--list", () { | |
2886 | |
2887 var mock = new HttpServerMock(); | |
2888 api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).p
rojects.regions.operations; | |
2889 var arg_name = "foo"; | |
2890 var arg_pageSize = 42; | |
2891 var arg_filter = "foo"; | |
2892 var arg_pageToken = "foo"; | |
2893 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | |
2894 var path = (req.url).path; | |
2895 var pathOffset = 0; | |
2896 var index; | |
2897 var subPart; | |
2898 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2899 pathOffset += 1; | |
2900 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | |
2901 pathOffset += 8; | |
2902 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
2903 | |
2904 var query = (req.url).query; | |
2905 var queryOffset = 0; | |
2906 var queryMap = {}; | |
2907 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2908 parseBool(n) { | |
2909 if (n == "true") return true; | |
2910 if (n == "false") return false; | |
2911 if (n == null) return null; | |
2912 throw new core.ArgumentError("Invalid boolean: $n"); | |
2913 } | |
2914 if (query.length > 0) { | |
2915 for (var part in query.split("&")) { | |
2916 var keyvalue = part.split("="); | |
2917 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2918 } | |
2919 } | |
2920 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
2921 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
2922 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
2923 | |
2924 | |
2925 var h = { | |
2926 "content-type" : "application/json; charset=utf-8", | |
2927 }; | |
2928 var resp = convert.JSON.encode(buildListOperationsResponse()); | |
2929 return new async.Future.value(stringResponse(200, h, resp)); | |
2930 }), true); | |
2931 res.list(arg_name, pageSize: arg_pageSize, filter: arg_filter, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.ListOperationsResponse response)
{ | |
2932 checkListOperationsResponse(response); | |
2933 }))); | |
2934 }); | |
2935 | |
2936 }); | |
2937 | |
2938 | |
2939 } | |
2940 | |
OLD | NEW |