Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: generated/googleapis_beta/test/toolresults/v1beta3_test.dart

Issue 1797933002: Api-roll 33: 2016-03-14 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Added resources/*/CHANGELOG.md, addresssed comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis_beta.toolresults.v1beta3.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:unittest/unittest.dart' as unittest;
11
12 import 'package:googleapis_beta/toolresults/v1beta3.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 headers, core.String body) {
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 buildCounterAny = 0;
55 buildAny() {
56 var o = new api.Any();
57 buildCounterAny++;
58 if (buildCounterAny < 3) {
59 o.typeUrl = "foo";
60 o.value = "foo";
61 }
62 buildCounterAny--;
63 return o;
64 }
65
66 checkAny(api.Any o) {
67 buildCounterAny++;
68 if (buildCounterAny < 3) {
69 unittest.expect(o.typeUrl, unittest.equals('foo'));
70 unittest.expect(o.value, unittest.equals('foo'));
71 }
72 buildCounterAny--;
73 }
74
75 core.int buildCounterDuration = 0;
76 buildDuration() {
77 var o = new api.Duration();
78 buildCounterDuration++;
79 if (buildCounterDuration < 3) {
80 o.nanos = 42;
81 o.seconds = "foo";
82 }
83 buildCounterDuration--;
84 return o;
85 }
86
87 checkDuration(api.Duration o) {
88 buildCounterDuration++;
89 if (buildCounterDuration < 3) {
90 unittest.expect(o.nanos, unittest.equals(42));
91 unittest.expect(o.seconds, unittest.equals('foo'));
92 }
93 buildCounterDuration--;
94 }
95
96 core.int buildCounterExecution = 0;
97 buildExecution() {
98 var o = new api.Execution();
99 buildCounterExecution++;
100 if (buildCounterExecution < 3) {
101 o.completionTime = buildTimestamp();
102 o.creationTime = buildTimestamp();
103 o.executionId = "foo";
104 o.outcome = buildOutcome();
105 o.state = "foo";
106 o.testExecutionMatrixId = "foo";
107 }
108 buildCounterExecution--;
109 return o;
110 }
111
112 checkExecution(api.Execution o) {
113 buildCounterExecution++;
114 if (buildCounterExecution < 3) {
115 checkTimestamp(o.completionTime);
116 checkTimestamp(o.creationTime);
117 unittest.expect(o.executionId, unittest.equals('foo'));
118 checkOutcome(o.outcome);
119 unittest.expect(o.state, unittest.equals('foo'));
120 unittest.expect(o.testExecutionMatrixId, unittest.equals('foo'));
121 }
122 buildCounterExecution--;
123 }
124
125 core.int buildCounterFailureDetail = 0;
126 buildFailureDetail() {
127 var o = new api.FailureDetail();
128 buildCounterFailureDetail++;
129 if (buildCounterFailureDetail < 3) {
130 o.crashed = true;
131 o.notInstalled = true;
132 o.otherNativeCrash = true;
133 o.timedOut = true;
134 }
135 buildCounterFailureDetail--;
136 return o;
137 }
138
139 checkFailureDetail(api.FailureDetail o) {
140 buildCounterFailureDetail++;
141 if (buildCounterFailureDetail < 3) {
142 unittest.expect(o.crashed, unittest.isTrue);
143 unittest.expect(o.notInstalled, unittest.isTrue);
144 unittest.expect(o.otherNativeCrash, unittest.isTrue);
145 unittest.expect(o.timedOut, unittest.isTrue);
146 }
147 buildCounterFailureDetail--;
148 }
149
150 core.int buildCounterFileReference = 0;
151 buildFileReference() {
152 var o = new api.FileReference();
153 buildCounterFileReference++;
154 if (buildCounterFileReference < 3) {
155 o.fileUri = "foo";
156 }
157 buildCounterFileReference--;
158 return o;
159 }
160
161 checkFileReference(api.FileReference o) {
162 buildCounterFileReference++;
163 if (buildCounterFileReference < 3) {
164 unittest.expect(o.fileUri, unittest.equals('foo'));
165 }
166 buildCounterFileReference--;
167 }
168
169 core.int buildCounterHistory = 0;
170 buildHistory() {
171 var o = new api.History();
172 buildCounterHistory++;
173 if (buildCounterHistory < 3) {
174 o.displayName = "foo";
175 o.historyId = "foo";
176 o.name = "foo";
177 }
178 buildCounterHistory--;
179 return o;
180 }
181
182 checkHistory(api.History o) {
183 buildCounterHistory++;
184 if (buildCounterHistory < 3) {
185 unittest.expect(o.displayName, unittest.equals('foo'));
186 unittest.expect(o.historyId, unittest.equals('foo'));
187 unittest.expect(o.name, unittest.equals('foo'));
188 }
189 buildCounterHistory--;
190 }
191
192 core.int buildCounterImage = 0;
193 buildImage() {
194 var o = new api.Image();
195 buildCounterImage++;
196 if (buildCounterImage < 3) {
197 o.error = buildStatus();
198 o.sourceImage = buildToolOutputReference();
199 o.stepId = "foo";
200 o.thumbnail = buildThumbnail();
201 }
202 buildCounterImage--;
203 return o;
204 }
205
206 checkImage(api.Image o) {
207 buildCounterImage++;
208 if (buildCounterImage < 3) {
209 checkStatus(o.error);
210 checkToolOutputReference(o.sourceImage);
211 unittest.expect(o.stepId, unittest.equals('foo'));
212 checkThumbnail(o.thumbnail);
213 }
214 buildCounterImage--;
215 }
216
217 core.int buildCounterInconclusiveDetail = 0;
218 buildInconclusiveDetail() {
219 var o = new api.InconclusiveDetail();
220 buildCounterInconclusiveDetail++;
221 if (buildCounterInconclusiveDetail < 3) {
222 o.abortedByUser = true;
223 o.infrastructureFailure = true;
224 o.nativeCrash = true;
225 }
226 buildCounterInconclusiveDetail--;
227 return o;
228 }
229
230 checkInconclusiveDetail(api.InconclusiveDetail o) {
231 buildCounterInconclusiveDetail++;
232 if (buildCounterInconclusiveDetail < 3) {
233 unittest.expect(o.abortedByUser, unittest.isTrue);
234 unittest.expect(o.infrastructureFailure, unittest.isTrue);
235 unittest.expect(o.nativeCrash, unittest.isTrue);
236 }
237 buildCounterInconclusiveDetail--;
238 }
239
240 buildUnnamed3253() {
241 var o = new core.List<api.Execution>();
242 o.add(buildExecution());
243 o.add(buildExecution());
244 return o;
245 }
246
247 checkUnnamed3253(core.List<api.Execution> o) {
248 unittest.expect(o, unittest.hasLength(2));
249 checkExecution(o[0]);
250 checkExecution(o[1]);
251 }
252
253 core.int buildCounterListExecutionsResponse = 0;
254 buildListExecutionsResponse() {
255 var o = new api.ListExecutionsResponse();
256 buildCounterListExecutionsResponse++;
257 if (buildCounterListExecutionsResponse < 3) {
258 o.executions = buildUnnamed3253();
259 o.nextPageToken = "foo";
260 }
261 buildCounterListExecutionsResponse--;
262 return o;
263 }
264
265 checkListExecutionsResponse(api.ListExecutionsResponse o) {
266 buildCounterListExecutionsResponse++;
267 if (buildCounterListExecutionsResponse < 3) {
268 checkUnnamed3253(o.executions);
269 unittest.expect(o.nextPageToken, unittest.equals('foo'));
270 }
271 buildCounterListExecutionsResponse--;
272 }
273
274 buildUnnamed3254() {
275 var o = new core.List<api.History>();
276 o.add(buildHistory());
277 o.add(buildHistory());
278 return o;
279 }
280
281 checkUnnamed3254(core.List<api.History> o) {
282 unittest.expect(o, unittest.hasLength(2));
283 checkHistory(o[0]);
284 checkHistory(o[1]);
285 }
286
287 core.int buildCounterListHistoriesResponse = 0;
288 buildListHistoriesResponse() {
289 var o = new api.ListHistoriesResponse();
290 buildCounterListHistoriesResponse++;
291 if (buildCounterListHistoriesResponse < 3) {
292 o.histories = buildUnnamed3254();
293 o.nextPageToken = "foo";
294 }
295 buildCounterListHistoriesResponse--;
296 return o;
297 }
298
299 checkListHistoriesResponse(api.ListHistoriesResponse o) {
300 buildCounterListHistoriesResponse++;
301 if (buildCounterListHistoriesResponse < 3) {
302 checkUnnamed3254(o.histories);
303 unittest.expect(o.nextPageToken, unittest.equals('foo'));
304 }
305 buildCounterListHistoriesResponse--;
306 }
307
308 buildUnnamed3255() {
309 var o = new core.List<api.Image>();
310 o.add(buildImage());
311 o.add(buildImage());
312 return o;
313 }
314
315 checkUnnamed3255(core.List<api.Image> o) {
316 unittest.expect(o, unittest.hasLength(2));
317 checkImage(o[0]);
318 checkImage(o[1]);
319 }
320
321 core.int buildCounterListStepThumbnailsResponse = 0;
322 buildListStepThumbnailsResponse() {
323 var o = new api.ListStepThumbnailsResponse();
324 buildCounterListStepThumbnailsResponse++;
325 if (buildCounterListStepThumbnailsResponse < 3) {
326 o.nextPageToken = "foo";
327 o.thumbnails = buildUnnamed3255();
328 }
329 buildCounterListStepThumbnailsResponse--;
330 return o;
331 }
332
333 checkListStepThumbnailsResponse(api.ListStepThumbnailsResponse o) {
334 buildCounterListStepThumbnailsResponse++;
335 if (buildCounterListStepThumbnailsResponse < 3) {
336 unittest.expect(o.nextPageToken, unittest.equals('foo'));
337 checkUnnamed3255(o.thumbnails);
338 }
339 buildCounterListStepThumbnailsResponse--;
340 }
341
342 buildUnnamed3256() {
343 var o = new core.List<api.Step>();
344 o.add(buildStep());
345 o.add(buildStep());
346 return o;
347 }
348
349 checkUnnamed3256(core.List<api.Step> o) {
350 unittest.expect(o, unittest.hasLength(2));
351 checkStep(o[0]);
352 checkStep(o[1]);
353 }
354
355 core.int buildCounterListStepsResponse = 0;
356 buildListStepsResponse() {
357 var o = new api.ListStepsResponse();
358 buildCounterListStepsResponse++;
359 if (buildCounterListStepsResponse < 3) {
360 o.nextPageToken = "foo";
361 o.steps = buildUnnamed3256();
362 }
363 buildCounterListStepsResponse--;
364 return o;
365 }
366
367 checkListStepsResponse(api.ListStepsResponse o) {
368 buildCounterListStepsResponse++;
369 if (buildCounterListStepsResponse < 3) {
370 unittest.expect(o.nextPageToken, unittest.equals('foo'));
371 checkUnnamed3256(o.steps);
372 }
373 buildCounterListStepsResponse--;
374 }
375
376 core.int buildCounterOutcome = 0;
377 buildOutcome() {
378 var o = new api.Outcome();
379 buildCounterOutcome++;
380 if (buildCounterOutcome < 3) {
381 o.failureDetail = buildFailureDetail();
382 o.inconclusiveDetail = buildInconclusiveDetail();
383 o.skippedDetail = buildSkippedDetail();
384 o.successDetail = buildSuccessDetail();
385 o.summary = "foo";
386 }
387 buildCounterOutcome--;
388 return o;
389 }
390
391 checkOutcome(api.Outcome o) {
392 buildCounterOutcome++;
393 if (buildCounterOutcome < 3) {
394 checkFailureDetail(o.failureDetail);
395 checkInconclusiveDetail(o.inconclusiveDetail);
396 checkSkippedDetail(o.skippedDetail);
397 checkSuccessDetail(o.successDetail);
398 unittest.expect(o.summary, unittest.equals('foo'));
399 }
400 buildCounterOutcome--;
401 }
402
403 core.int buildCounterProjectSettings = 0;
404 buildProjectSettings() {
405 var o = new api.ProjectSettings();
406 buildCounterProjectSettings++;
407 if (buildCounterProjectSettings < 3) {
408 o.defaultBucket = "foo";
409 o.name = "foo";
410 }
411 buildCounterProjectSettings--;
412 return o;
413 }
414
415 checkProjectSettings(api.ProjectSettings o) {
416 buildCounterProjectSettings++;
417 if (buildCounterProjectSettings < 3) {
418 unittest.expect(o.defaultBucket, unittest.equals('foo'));
419 unittest.expect(o.name, unittest.equals('foo'));
420 }
421 buildCounterProjectSettings--;
422 }
423
424 buildUnnamed3257() {
425 var o = new core.List<api.FileReference>();
426 o.add(buildFileReference());
427 o.add(buildFileReference());
428 return o;
429 }
430
431 checkUnnamed3257(core.List<api.FileReference> o) {
432 unittest.expect(o, unittest.hasLength(2));
433 checkFileReference(o[0]);
434 checkFileReference(o[1]);
435 }
436
437 core.int buildCounterPublishXunitXmlFilesRequest = 0;
438 buildPublishXunitXmlFilesRequest() {
439 var o = new api.PublishXunitXmlFilesRequest();
440 buildCounterPublishXunitXmlFilesRequest++;
441 if (buildCounterPublishXunitXmlFilesRequest < 3) {
442 o.xunitXmlFiles = buildUnnamed3257();
443 }
444 buildCounterPublishXunitXmlFilesRequest--;
445 return o;
446 }
447
448 checkPublishXunitXmlFilesRequest(api.PublishXunitXmlFilesRequest o) {
449 buildCounterPublishXunitXmlFilesRequest++;
450 if (buildCounterPublishXunitXmlFilesRequest < 3) {
451 checkUnnamed3257(o.xunitXmlFiles);
452 }
453 buildCounterPublishXunitXmlFilesRequest--;
454 }
455
456 core.int buildCounterSkippedDetail = 0;
457 buildSkippedDetail() {
458 var o = new api.SkippedDetail();
459 buildCounterSkippedDetail++;
460 if (buildCounterSkippedDetail < 3) {
461 o.incompatibleAppVersion = true;
462 o.incompatibleArchitecture = true;
463 o.incompatibleDevice = true;
464 }
465 buildCounterSkippedDetail--;
466 return o;
467 }
468
469 checkSkippedDetail(api.SkippedDetail o) {
470 buildCounterSkippedDetail++;
471 if (buildCounterSkippedDetail < 3) {
472 unittest.expect(o.incompatibleAppVersion, unittest.isTrue);
473 unittest.expect(o.incompatibleArchitecture, unittest.isTrue);
474 unittest.expect(o.incompatibleDevice, unittest.isTrue);
475 }
476 buildCounterSkippedDetail--;
477 }
478
479 buildUnnamed3258() {
480 var o = new core.List<api.Any>();
481 o.add(buildAny());
482 o.add(buildAny());
483 return o;
484 }
485
486 checkUnnamed3258(core.List<api.Any> o) {
487 unittest.expect(o, unittest.hasLength(2));
488 checkAny(o[0]);
489 checkAny(o[1]);
490 }
491
492 core.int buildCounterStatus = 0;
493 buildStatus() {
494 var o = new api.Status();
495 buildCounterStatus++;
496 if (buildCounterStatus < 3) {
497 o.code = 42;
498 o.details = buildUnnamed3258();
499 o.message = "foo";
500 }
501 buildCounterStatus--;
502 return o;
503 }
504
505 checkStatus(api.Status o) {
506 buildCounterStatus++;
507 if (buildCounterStatus < 3) {
508 unittest.expect(o.code, unittest.equals(42));
509 checkUnnamed3258(o.details);
510 unittest.expect(o.message, unittest.equals('foo'));
511 }
512 buildCounterStatus--;
513 }
514
515 buildUnnamed3259() {
516 var o = new core.List<api.StepDimensionValueEntry>();
517 o.add(buildStepDimensionValueEntry());
518 o.add(buildStepDimensionValueEntry());
519 return o;
520 }
521
522 checkUnnamed3259(core.List<api.StepDimensionValueEntry> o) {
523 unittest.expect(o, unittest.hasLength(2));
524 checkStepDimensionValueEntry(o[0]);
525 checkStepDimensionValueEntry(o[1]);
526 }
527
528 buildUnnamed3260() {
529 var o = new core.List<api.StepLabelsEntry>();
530 o.add(buildStepLabelsEntry());
531 o.add(buildStepLabelsEntry());
532 return o;
533 }
534
535 checkUnnamed3260(core.List<api.StepLabelsEntry> o) {
536 unittest.expect(o, unittest.hasLength(2));
537 checkStepLabelsEntry(o[0]);
538 checkStepLabelsEntry(o[1]);
539 }
540
541 core.int buildCounterStep = 0;
542 buildStep() {
543 var o = new api.Step();
544 buildCounterStep++;
545 if (buildCounterStep < 3) {
546 o.completionTime = buildTimestamp();
547 o.creationTime = buildTimestamp();
548 o.description = "foo";
549 o.deviceUsageDuration = buildDuration();
550 o.dimensionValue = buildUnnamed3259();
551 o.hasImages = true;
552 o.labels = buildUnnamed3260();
553 o.name = "foo";
554 o.outcome = buildOutcome();
555 o.runDuration = buildDuration();
556 o.state = "foo";
557 o.stepId = "foo";
558 o.testExecutionStep = buildTestExecutionStep();
559 o.toolExecutionStep = buildToolExecutionStep();
560 }
561 buildCounterStep--;
562 return o;
563 }
564
565 checkStep(api.Step o) {
566 buildCounterStep++;
567 if (buildCounterStep < 3) {
568 checkTimestamp(o.completionTime);
569 checkTimestamp(o.creationTime);
570 unittest.expect(o.description, unittest.equals('foo'));
571 checkDuration(o.deviceUsageDuration);
572 checkUnnamed3259(o.dimensionValue);
573 unittest.expect(o.hasImages, unittest.isTrue);
574 checkUnnamed3260(o.labels);
575 unittest.expect(o.name, unittest.equals('foo'));
576 checkOutcome(o.outcome);
577 checkDuration(o.runDuration);
578 unittest.expect(o.state, unittest.equals('foo'));
579 unittest.expect(o.stepId, unittest.equals('foo'));
580 checkTestExecutionStep(o.testExecutionStep);
581 checkToolExecutionStep(o.toolExecutionStep);
582 }
583 buildCounterStep--;
584 }
585
586 core.int buildCounterStepDimensionValueEntry = 0;
587 buildStepDimensionValueEntry() {
588 var o = new api.StepDimensionValueEntry();
589 buildCounterStepDimensionValueEntry++;
590 if (buildCounterStepDimensionValueEntry < 3) {
591 o.key = "foo";
592 o.value = "foo";
593 }
594 buildCounterStepDimensionValueEntry--;
595 return o;
596 }
597
598 checkStepDimensionValueEntry(api.StepDimensionValueEntry o) {
599 buildCounterStepDimensionValueEntry++;
600 if (buildCounterStepDimensionValueEntry < 3) {
601 unittest.expect(o.key, unittest.equals('foo'));
602 unittest.expect(o.value, unittest.equals('foo'));
603 }
604 buildCounterStepDimensionValueEntry--;
605 }
606
607 core.int buildCounterStepLabelsEntry = 0;
608 buildStepLabelsEntry() {
609 var o = new api.StepLabelsEntry();
610 buildCounterStepLabelsEntry++;
611 if (buildCounterStepLabelsEntry < 3) {
612 o.key = "foo";
613 o.value = "foo";
614 }
615 buildCounterStepLabelsEntry--;
616 return o;
617 }
618
619 checkStepLabelsEntry(api.StepLabelsEntry o) {
620 buildCounterStepLabelsEntry++;
621 if (buildCounterStepLabelsEntry < 3) {
622 unittest.expect(o.key, unittest.equals('foo'));
623 unittest.expect(o.value, unittest.equals('foo'));
624 }
625 buildCounterStepLabelsEntry--;
626 }
627
628 core.int buildCounterSuccessDetail = 0;
629 buildSuccessDetail() {
630 var o = new api.SuccessDetail();
631 buildCounterSuccessDetail++;
632 if (buildCounterSuccessDetail < 3) {
633 o.otherNativeCrash = true;
634 }
635 buildCounterSuccessDetail--;
636 return o;
637 }
638
639 checkSuccessDetail(api.SuccessDetail o) {
640 buildCounterSuccessDetail++;
641 if (buildCounterSuccessDetail < 3) {
642 unittest.expect(o.otherNativeCrash, unittest.isTrue);
643 }
644 buildCounterSuccessDetail--;
645 }
646
647 core.int buildCounterTestCaseReference = 0;
648 buildTestCaseReference() {
649 var o = new api.TestCaseReference();
650 buildCounterTestCaseReference++;
651 if (buildCounterTestCaseReference < 3) {
652 o.className = "foo";
653 o.name = "foo";
654 o.testSuiteName = "foo";
655 }
656 buildCounterTestCaseReference--;
657 return o;
658 }
659
660 checkTestCaseReference(api.TestCaseReference o) {
661 buildCounterTestCaseReference++;
662 if (buildCounterTestCaseReference < 3) {
663 unittest.expect(o.className, unittest.equals('foo'));
664 unittest.expect(o.name, unittest.equals('foo'));
665 unittest.expect(o.testSuiteName, unittest.equals('foo'));
666 }
667 buildCounterTestCaseReference--;
668 }
669
670 buildUnnamed3261() {
671 var o = new core.List<api.TestSuiteOverview>();
672 o.add(buildTestSuiteOverview());
673 o.add(buildTestSuiteOverview());
674 return o;
675 }
676
677 checkUnnamed3261(core.List<api.TestSuiteOverview> o) {
678 unittest.expect(o, unittest.hasLength(2));
679 checkTestSuiteOverview(o[0]);
680 checkTestSuiteOverview(o[1]);
681 }
682
683 core.int buildCounterTestExecutionStep = 0;
684 buildTestExecutionStep() {
685 var o = new api.TestExecutionStep();
686 buildCounterTestExecutionStep++;
687 if (buildCounterTestExecutionStep < 3) {
688 o.testSuiteOverviews = buildUnnamed3261();
689 o.testTiming = buildTestTiming();
690 o.toolExecution = buildToolExecution();
691 }
692 buildCounterTestExecutionStep--;
693 return o;
694 }
695
696 checkTestExecutionStep(api.TestExecutionStep o) {
697 buildCounterTestExecutionStep++;
698 if (buildCounterTestExecutionStep < 3) {
699 checkUnnamed3261(o.testSuiteOverviews);
700 checkTestTiming(o.testTiming);
701 checkToolExecution(o.toolExecution);
702 }
703 buildCounterTestExecutionStep--;
704 }
705
706 core.int buildCounterTestSuiteOverview = 0;
707 buildTestSuiteOverview() {
708 var o = new api.TestSuiteOverview();
709 buildCounterTestSuiteOverview++;
710 if (buildCounterTestSuiteOverview < 3) {
711 o.errorCount = 42;
712 o.failureCount = 42;
713 o.name = "foo";
714 o.skippedCount = 42;
715 o.totalCount = 42;
716 o.xmlSource = buildFileReference();
717 }
718 buildCounterTestSuiteOverview--;
719 return o;
720 }
721
722 checkTestSuiteOverview(api.TestSuiteOverview o) {
723 buildCounterTestSuiteOverview++;
724 if (buildCounterTestSuiteOverview < 3) {
725 unittest.expect(o.errorCount, unittest.equals(42));
726 unittest.expect(o.failureCount, unittest.equals(42));
727 unittest.expect(o.name, unittest.equals('foo'));
728 unittest.expect(o.skippedCount, unittest.equals(42));
729 unittest.expect(o.totalCount, unittest.equals(42));
730 checkFileReference(o.xmlSource);
731 }
732 buildCounterTestSuiteOverview--;
733 }
734
735 core.int buildCounterTestTiming = 0;
736 buildTestTiming() {
737 var o = new api.TestTiming();
738 buildCounterTestTiming++;
739 if (buildCounterTestTiming < 3) {
740 o.testProcessDuration = buildDuration();
741 }
742 buildCounterTestTiming--;
743 return o;
744 }
745
746 checkTestTiming(api.TestTiming o) {
747 buildCounterTestTiming++;
748 if (buildCounterTestTiming < 3) {
749 checkDuration(o.testProcessDuration);
750 }
751 buildCounterTestTiming--;
752 }
753
754 core.int buildCounterThumbnail = 0;
755 buildThumbnail() {
756 var o = new api.Thumbnail();
757 buildCounterThumbnail++;
758 if (buildCounterThumbnail < 3) {
759 o.contentType = "foo";
760 o.data = "foo";
761 o.heightPx = 42;
762 o.widthPx = 42;
763 }
764 buildCounterThumbnail--;
765 return o;
766 }
767
768 checkThumbnail(api.Thumbnail o) {
769 buildCounterThumbnail++;
770 if (buildCounterThumbnail < 3) {
771 unittest.expect(o.contentType, unittest.equals('foo'));
772 unittest.expect(o.data, unittest.equals('foo'));
773 unittest.expect(o.heightPx, unittest.equals(42));
774 unittest.expect(o.widthPx, unittest.equals(42));
775 }
776 buildCounterThumbnail--;
777 }
778
779 core.int buildCounterTimestamp = 0;
780 buildTimestamp() {
781 var o = new api.Timestamp();
782 buildCounterTimestamp++;
783 if (buildCounterTimestamp < 3) {
784 o.nanos = 42;
785 o.seconds = "foo";
786 }
787 buildCounterTimestamp--;
788 return o;
789 }
790
791 checkTimestamp(api.Timestamp o) {
792 buildCounterTimestamp++;
793 if (buildCounterTimestamp < 3) {
794 unittest.expect(o.nanos, unittest.equals(42));
795 unittest.expect(o.seconds, unittest.equals('foo'));
796 }
797 buildCounterTimestamp--;
798 }
799
800 buildUnnamed3262() {
801 var o = new core.List<core.String>();
802 o.add("foo");
803 o.add("foo");
804 return o;
805 }
806
807 checkUnnamed3262(core.List<core.String> o) {
808 unittest.expect(o, unittest.hasLength(2));
809 unittest.expect(o[0], unittest.equals('foo'));
810 unittest.expect(o[1], unittest.equals('foo'));
811 }
812
813 buildUnnamed3263() {
814 var o = new core.List<api.FileReference>();
815 o.add(buildFileReference());
816 o.add(buildFileReference());
817 return o;
818 }
819
820 checkUnnamed3263(core.List<api.FileReference> o) {
821 unittest.expect(o, unittest.hasLength(2));
822 checkFileReference(o[0]);
823 checkFileReference(o[1]);
824 }
825
826 buildUnnamed3264() {
827 var o = new core.List<api.ToolOutputReference>();
828 o.add(buildToolOutputReference());
829 o.add(buildToolOutputReference());
830 return o;
831 }
832
833 checkUnnamed3264(core.List<api.ToolOutputReference> o) {
834 unittest.expect(o, unittest.hasLength(2));
835 checkToolOutputReference(o[0]);
836 checkToolOutputReference(o[1]);
837 }
838
839 core.int buildCounterToolExecution = 0;
840 buildToolExecution() {
841 var o = new api.ToolExecution();
842 buildCounterToolExecution++;
843 if (buildCounterToolExecution < 3) {
844 o.commandLineArguments = buildUnnamed3262();
845 o.exitCode = buildToolExitCode();
846 o.toolLogs = buildUnnamed3263();
847 o.toolOutputs = buildUnnamed3264();
848 }
849 buildCounterToolExecution--;
850 return o;
851 }
852
853 checkToolExecution(api.ToolExecution o) {
854 buildCounterToolExecution++;
855 if (buildCounterToolExecution < 3) {
856 checkUnnamed3262(o.commandLineArguments);
857 checkToolExitCode(o.exitCode);
858 checkUnnamed3263(o.toolLogs);
859 checkUnnamed3264(o.toolOutputs);
860 }
861 buildCounterToolExecution--;
862 }
863
864 core.int buildCounterToolExecutionStep = 0;
865 buildToolExecutionStep() {
866 var o = new api.ToolExecutionStep();
867 buildCounterToolExecutionStep++;
868 if (buildCounterToolExecutionStep < 3) {
869 o.toolExecution = buildToolExecution();
870 }
871 buildCounterToolExecutionStep--;
872 return o;
873 }
874
875 checkToolExecutionStep(api.ToolExecutionStep o) {
876 buildCounterToolExecutionStep++;
877 if (buildCounterToolExecutionStep < 3) {
878 checkToolExecution(o.toolExecution);
879 }
880 buildCounterToolExecutionStep--;
881 }
882
883 core.int buildCounterToolExitCode = 0;
884 buildToolExitCode() {
885 var o = new api.ToolExitCode();
886 buildCounterToolExitCode++;
887 if (buildCounterToolExitCode < 3) {
888 o.number = 42;
889 }
890 buildCounterToolExitCode--;
891 return o;
892 }
893
894 checkToolExitCode(api.ToolExitCode o) {
895 buildCounterToolExitCode++;
896 if (buildCounterToolExitCode < 3) {
897 unittest.expect(o.number, unittest.equals(42));
898 }
899 buildCounterToolExitCode--;
900 }
901
902 core.int buildCounterToolOutputReference = 0;
903 buildToolOutputReference() {
904 var o = new api.ToolOutputReference();
905 buildCounterToolOutputReference++;
906 if (buildCounterToolOutputReference < 3) {
907 o.creationTime = buildTimestamp();
908 o.output = buildFileReference();
909 o.testCase = buildTestCaseReference();
910 }
911 buildCounterToolOutputReference--;
912 return o;
913 }
914
915 checkToolOutputReference(api.ToolOutputReference o) {
916 buildCounterToolOutputReference++;
917 if (buildCounterToolOutputReference < 3) {
918 checkTimestamp(o.creationTime);
919 checkFileReference(o.output);
920 checkTestCaseReference(o.testCase);
921 }
922 buildCounterToolOutputReference--;
923 }
924
925
926 main() {
927 unittest.group("obj-schema-Any", () {
928 unittest.test("to-json--from-json", () {
929 var o = buildAny();
930 var od = new api.Any.fromJson(o.toJson());
931 checkAny(od);
932 });
933 });
934
935
936 unittest.group("obj-schema-Duration", () {
937 unittest.test("to-json--from-json", () {
938 var o = buildDuration();
939 var od = new api.Duration.fromJson(o.toJson());
940 checkDuration(od);
941 });
942 });
943
944
945 unittest.group("obj-schema-Execution", () {
946 unittest.test("to-json--from-json", () {
947 var o = buildExecution();
948 var od = new api.Execution.fromJson(o.toJson());
949 checkExecution(od);
950 });
951 });
952
953
954 unittest.group("obj-schema-FailureDetail", () {
955 unittest.test("to-json--from-json", () {
956 var o = buildFailureDetail();
957 var od = new api.FailureDetail.fromJson(o.toJson());
958 checkFailureDetail(od);
959 });
960 });
961
962
963 unittest.group("obj-schema-FileReference", () {
964 unittest.test("to-json--from-json", () {
965 var o = buildFileReference();
966 var od = new api.FileReference.fromJson(o.toJson());
967 checkFileReference(od);
968 });
969 });
970
971
972 unittest.group("obj-schema-History", () {
973 unittest.test("to-json--from-json", () {
974 var o = buildHistory();
975 var od = new api.History.fromJson(o.toJson());
976 checkHistory(od);
977 });
978 });
979
980
981 unittest.group("obj-schema-Image", () {
982 unittest.test("to-json--from-json", () {
983 var o = buildImage();
984 var od = new api.Image.fromJson(o.toJson());
985 checkImage(od);
986 });
987 });
988
989
990 unittest.group("obj-schema-InconclusiveDetail", () {
991 unittest.test("to-json--from-json", () {
992 var o = buildInconclusiveDetail();
993 var od = new api.InconclusiveDetail.fromJson(o.toJson());
994 checkInconclusiveDetail(od);
995 });
996 });
997
998
999 unittest.group("obj-schema-ListExecutionsResponse", () {
1000 unittest.test("to-json--from-json", () {
1001 var o = buildListExecutionsResponse();
1002 var od = new api.ListExecutionsResponse.fromJson(o.toJson());
1003 checkListExecutionsResponse(od);
1004 });
1005 });
1006
1007
1008 unittest.group("obj-schema-ListHistoriesResponse", () {
1009 unittest.test("to-json--from-json", () {
1010 var o = buildListHistoriesResponse();
1011 var od = new api.ListHistoriesResponse.fromJson(o.toJson());
1012 checkListHistoriesResponse(od);
1013 });
1014 });
1015
1016
1017 unittest.group("obj-schema-ListStepThumbnailsResponse", () {
1018 unittest.test("to-json--from-json", () {
1019 var o = buildListStepThumbnailsResponse();
1020 var od = new api.ListStepThumbnailsResponse.fromJson(o.toJson());
1021 checkListStepThumbnailsResponse(od);
1022 });
1023 });
1024
1025
1026 unittest.group("obj-schema-ListStepsResponse", () {
1027 unittest.test("to-json--from-json", () {
1028 var o = buildListStepsResponse();
1029 var od = new api.ListStepsResponse.fromJson(o.toJson());
1030 checkListStepsResponse(od);
1031 });
1032 });
1033
1034
1035 unittest.group("obj-schema-Outcome", () {
1036 unittest.test("to-json--from-json", () {
1037 var o = buildOutcome();
1038 var od = new api.Outcome.fromJson(o.toJson());
1039 checkOutcome(od);
1040 });
1041 });
1042
1043
1044 unittest.group("obj-schema-ProjectSettings", () {
1045 unittest.test("to-json--from-json", () {
1046 var o = buildProjectSettings();
1047 var od = new api.ProjectSettings.fromJson(o.toJson());
1048 checkProjectSettings(od);
1049 });
1050 });
1051
1052
1053 unittest.group("obj-schema-PublishXunitXmlFilesRequest", () {
1054 unittest.test("to-json--from-json", () {
1055 var o = buildPublishXunitXmlFilesRequest();
1056 var od = new api.PublishXunitXmlFilesRequest.fromJson(o.toJson());
1057 checkPublishXunitXmlFilesRequest(od);
1058 });
1059 });
1060
1061
1062 unittest.group("obj-schema-SkippedDetail", () {
1063 unittest.test("to-json--from-json", () {
1064 var o = buildSkippedDetail();
1065 var od = new api.SkippedDetail.fromJson(o.toJson());
1066 checkSkippedDetail(od);
1067 });
1068 });
1069
1070
1071 unittest.group("obj-schema-Status", () {
1072 unittest.test("to-json--from-json", () {
1073 var o = buildStatus();
1074 var od = new api.Status.fromJson(o.toJson());
1075 checkStatus(od);
1076 });
1077 });
1078
1079
1080 unittest.group("obj-schema-Step", () {
1081 unittest.test("to-json--from-json", () {
1082 var o = buildStep();
1083 var od = new api.Step.fromJson(o.toJson());
1084 checkStep(od);
1085 });
1086 });
1087
1088
1089 unittest.group("obj-schema-StepDimensionValueEntry", () {
1090 unittest.test("to-json--from-json", () {
1091 var o = buildStepDimensionValueEntry();
1092 var od = new api.StepDimensionValueEntry.fromJson(o.toJson());
1093 checkStepDimensionValueEntry(od);
1094 });
1095 });
1096
1097
1098 unittest.group("obj-schema-StepLabelsEntry", () {
1099 unittest.test("to-json--from-json", () {
1100 var o = buildStepLabelsEntry();
1101 var od = new api.StepLabelsEntry.fromJson(o.toJson());
1102 checkStepLabelsEntry(od);
1103 });
1104 });
1105
1106
1107 unittest.group("obj-schema-SuccessDetail", () {
1108 unittest.test("to-json--from-json", () {
1109 var o = buildSuccessDetail();
1110 var od = new api.SuccessDetail.fromJson(o.toJson());
1111 checkSuccessDetail(od);
1112 });
1113 });
1114
1115
1116 unittest.group("obj-schema-TestCaseReference", () {
1117 unittest.test("to-json--from-json", () {
1118 var o = buildTestCaseReference();
1119 var od = new api.TestCaseReference.fromJson(o.toJson());
1120 checkTestCaseReference(od);
1121 });
1122 });
1123
1124
1125 unittest.group("obj-schema-TestExecutionStep", () {
1126 unittest.test("to-json--from-json", () {
1127 var o = buildTestExecutionStep();
1128 var od = new api.TestExecutionStep.fromJson(o.toJson());
1129 checkTestExecutionStep(od);
1130 });
1131 });
1132
1133
1134 unittest.group("obj-schema-TestSuiteOverview", () {
1135 unittest.test("to-json--from-json", () {
1136 var o = buildTestSuiteOverview();
1137 var od = new api.TestSuiteOverview.fromJson(o.toJson());
1138 checkTestSuiteOverview(od);
1139 });
1140 });
1141
1142
1143 unittest.group("obj-schema-TestTiming", () {
1144 unittest.test("to-json--from-json", () {
1145 var o = buildTestTiming();
1146 var od = new api.TestTiming.fromJson(o.toJson());
1147 checkTestTiming(od);
1148 });
1149 });
1150
1151
1152 unittest.group("obj-schema-Thumbnail", () {
1153 unittest.test("to-json--from-json", () {
1154 var o = buildThumbnail();
1155 var od = new api.Thumbnail.fromJson(o.toJson());
1156 checkThumbnail(od);
1157 });
1158 });
1159
1160
1161 unittest.group("obj-schema-Timestamp", () {
1162 unittest.test("to-json--from-json", () {
1163 var o = buildTimestamp();
1164 var od = new api.Timestamp.fromJson(o.toJson());
1165 checkTimestamp(od);
1166 });
1167 });
1168
1169
1170 unittest.group("obj-schema-ToolExecution", () {
1171 unittest.test("to-json--from-json", () {
1172 var o = buildToolExecution();
1173 var od = new api.ToolExecution.fromJson(o.toJson());
1174 checkToolExecution(od);
1175 });
1176 });
1177
1178
1179 unittest.group("obj-schema-ToolExecutionStep", () {
1180 unittest.test("to-json--from-json", () {
1181 var o = buildToolExecutionStep();
1182 var od = new api.ToolExecutionStep.fromJson(o.toJson());
1183 checkToolExecutionStep(od);
1184 });
1185 });
1186
1187
1188 unittest.group("obj-schema-ToolExitCode", () {
1189 unittest.test("to-json--from-json", () {
1190 var o = buildToolExitCode();
1191 var od = new api.ToolExitCode.fromJson(o.toJson());
1192 checkToolExitCode(od);
1193 });
1194 });
1195
1196
1197 unittest.group("obj-schema-ToolOutputReference", () {
1198 unittest.test("to-json--from-json", () {
1199 var o = buildToolOutputReference();
1200 var od = new api.ToolOutputReference.fromJson(o.toJson());
1201 checkToolOutputReference(od);
1202 });
1203 });
1204
1205
1206 unittest.group("resource-ProjectsResourceApi", () {
1207 unittest.test("method--getSettings", () {
1208
1209 var mock = new HttpServerMock();
1210 api.ProjectsResourceApi res = new api.ToolresultsApi(mock).projects;
1211 var arg_projectId = "foo";
1212 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1213 var path = (req.url).path;
1214 var pathOffset = 0;
1215 var index;
1216 var subPart;
1217 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1218 pathOffset += 1;
1219
1220 var query = (req.url).query;
1221 var queryOffset = 0;
1222 var queryMap = {};
1223 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1224 parseBool(n) {
1225 if (n == "true") return true;
1226 if (n == "false") return false;
1227 if (n == null) return null;
1228 throw new core.ArgumentError("Invalid boolean: $n");
1229 }
1230 if (query.length > 0) {
1231 for (var part in query.split("&")) {
1232 var keyvalue = part.split("=");
1233 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1234 }
1235 }
1236
1237
1238 var h = {
1239 "content-type" : "application/json; charset=utf-8",
1240 };
1241 var resp = convert.JSON.encode(buildProjectSettings());
1242 return new async.Future.value(stringResponse(200, h, resp));
1243 }), true);
1244 res.getSettings(arg_projectId).then(unittest.expectAsync(((api.ProjectSett ings response) {
1245 checkProjectSettings(response);
1246 })));
1247 });
1248
1249 unittest.test("method--initializeSettings", () {
1250
1251 var mock = new HttpServerMock();
1252 api.ProjectsResourceApi res = new api.ToolresultsApi(mock).projects;
1253 var arg_projectId = "foo";
1254 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1255 var path = (req.url).path;
1256 var pathOffset = 0;
1257 var index;
1258 var subPart;
1259 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1260 pathOffset += 1;
1261
1262 var query = (req.url).query;
1263 var queryOffset = 0;
1264 var queryMap = {};
1265 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1266 parseBool(n) {
1267 if (n == "true") return true;
1268 if (n == "false") return false;
1269 if (n == null) return null;
1270 throw new core.ArgumentError("Invalid boolean: $n");
1271 }
1272 if (query.length > 0) {
1273 for (var part in query.split("&")) {
1274 var keyvalue = part.split("=");
1275 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1276 }
1277 }
1278
1279
1280 var h = {
1281 "content-type" : "application/json; charset=utf-8",
1282 };
1283 var resp = convert.JSON.encode(buildProjectSettings());
1284 return new async.Future.value(stringResponse(200, h, resp));
1285 }), true);
1286 res.initializeSettings(arg_projectId).then(unittest.expectAsync(((api.Proj ectSettings response) {
1287 checkProjectSettings(response);
1288 })));
1289 });
1290
1291 });
1292
1293
1294 unittest.group("resource-ProjectsHistoriesResourceApi", () {
1295 unittest.test("method--create", () {
1296
1297 var mock = new HttpServerMock();
1298 api.ProjectsHistoriesResourceApi res = new api.ToolresultsApi(mock).projec ts.histories;
1299 var arg_request = buildHistory();
1300 var arg_projectId = "foo";
1301 var arg_requestId = "foo";
1302 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1303 var obj = new api.History.fromJson(json);
1304 checkHistory(obj);
1305
1306 var path = (req.url).path;
1307 var pathOffset = 0;
1308 var index;
1309 var subPart;
1310 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1311 pathOffset += 1;
1312
1313 var query = (req.url).query;
1314 var queryOffset = 0;
1315 var queryMap = {};
1316 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1317 parseBool(n) {
1318 if (n == "true") return true;
1319 if (n == "false") return false;
1320 if (n == null) return null;
1321 throw new core.ArgumentError("Invalid boolean: $n");
1322 }
1323 if (query.length > 0) {
1324 for (var part in query.split("&")) {
1325 var keyvalue = part.split("=");
1326 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1327 }
1328 }
1329 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id));
1330
1331
1332 var h = {
1333 "content-type" : "application/json; charset=utf-8",
1334 };
1335 var resp = convert.JSON.encode(buildHistory());
1336 return new async.Future.value(stringResponse(200, h, resp));
1337 }), true);
1338 res.create(arg_request, arg_projectId, requestId: arg_requestId).then(unit test.expectAsync(((api.History response) {
1339 checkHistory(response);
1340 })));
1341 });
1342
1343 unittest.test("method--get", () {
1344
1345 var mock = new HttpServerMock();
1346 api.ProjectsHistoriesResourceApi res = new api.ToolresultsApi(mock).projec ts.histories;
1347 var arg_projectId = "foo";
1348 var arg_historyId = "foo";
1349 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1350 var path = (req.url).path;
1351 var pathOffset = 0;
1352 var index;
1353 var subPart;
1354 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1355 pathOffset += 1;
1356
1357 var query = (req.url).query;
1358 var queryOffset = 0;
1359 var queryMap = {};
1360 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1361 parseBool(n) {
1362 if (n == "true") return true;
1363 if (n == "false") return false;
1364 if (n == null) return null;
1365 throw new core.ArgumentError("Invalid boolean: $n");
1366 }
1367 if (query.length > 0) {
1368 for (var part in query.split("&")) {
1369 var keyvalue = part.split("=");
1370 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1371 }
1372 }
1373
1374
1375 var h = {
1376 "content-type" : "application/json; charset=utf-8",
1377 };
1378 var resp = convert.JSON.encode(buildHistory());
1379 return new async.Future.value(stringResponse(200, h, resp));
1380 }), true);
1381 res.get(arg_projectId, arg_historyId).then(unittest.expectAsync(((api.Hist ory response) {
1382 checkHistory(response);
1383 })));
1384 });
1385
1386 unittest.test("method--list", () {
1387
1388 var mock = new HttpServerMock();
1389 api.ProjectsHistoriesResourceApi res = new api.ToolresultsApi(mock).projec ts.histories;
1390 var arg_projectId = "foo";
1391 var arg_filterByName = "foo";
1392 var arg_pageSize = 42;
1393 var arg_pageToken = "foo";
1394 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1395 var path = (req.url).path;
1396 var pathOffset = 0;
1397 var index;
1398 var subPart;
1399 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1400 pathOffset += 1;
1401
1402 var query = (req.url).query;
1403 var queryOffset = 0;
1404 var queryMap = {};
1405 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1406 parseBool(n) {
1407 if (n == "true") return true;
1408 if (n == "false") return false;
1409 if (n == null) return null;
1410 throw new core.ArgumentError("Invalid boolean: $n");
1411 }
1412 if (query.length > 0) {
1413 for (var part in query.split("&")) {
1414 var keyvalue = part.split("=");
1415 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1416 }
1417 }
1418 unittest.expect(queryMap["filterByName"].first, unittest.equals(arg_filt erByName));
1419 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
1420 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1421
1422
1423 var h = {
1424 "content-type" : "application/json; charset=utf-8",
1425 };
1426 var resp = convert.JSON.encode(buildListHistoriesResponse());
1427 return new async.Future.value(stringResponse(200, h, resp));
1428 }), true);
1429 res.list(arg_projectId, filterByName: arg_filterByName, pageSize: arg_page Size, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListHistoriesRes ponse response) {
1430 checkListHistoriesResponse(response);
1431 })));
1432 });
1433
1434 });
1435
1436
1437 unittest.group("resource-ProjectsHistoriesExecutionsResourceApi", () {
1438 unittest.test("method--create", () {
1439
1440 var mock = new HttpServerMock();
1441 api.ProjectsHistoriesExecutionsResourceApi res = new api.ToolresultsApi(mo ck).projects.histories.executions;
1442 var arg_request = buildExecution();
1443 var arg_projectId = "foo";
1444 var arg_historyId = "foo";
1445 var arg_requestId = "foo";
1446 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1447 var obj = new api.Execution.fromJson(json);
1448 checkExecution(obj);
1449
1450 var path = (req.url).path;
1451 var pathOffset = 0;
1452 var index;
1453 var subPart;
1454 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1455 pathOffset += 1;
1456
1457 var query = (req.url).query;
1458 var queryOffset = 0;
1459 var queryMap = {};
1460 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1461 parseBool(n) {
1462 if (n == "true") return true;
1463 if (n == "false") return false;
1464 if (n == null) return null;
1465 throw new core.ArgumentError("Invalid boolean: $n");
1466 }
1467 if (query.length > 0) {
1468 for (var part in query.split("&")) {
1469 var keyvalue = part.split("=");
1470 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1471 }
1472 }
1473 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id));
1474
1475
1476 var h = {
1477 "content-type" : "application/json; charset=utf-8",
1478 };
1479 var resp = convert.JSON.encode(buildExecution());
1480 return new async.Future.value(stringResponse(200, h, resp));
1481 }), true);
1482 res.create(arg_request, arg_projectId, arg_historyId, requestId: arg_reque stId).then(unittest.expectAsync(((api.Execution response) {
1483 checkExecution(response);
1484 })));
1485 });
1486
1487 unittest.test("method--get", () {
1488
1489 var mock = new HttpServerMock();
1490 api.ProjectsHistoriesExecutionsResourceApi res = new api.ToolresultsApi(mo ck).projects.histories.executions;
1491 var arg_projectId = "foo";
1492 var arg_historyId = "foo";
1493 var arg_executionId = "foo";
1494 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1495 var path = (req.url).path;
1496 var pathOffset = 0;
1497 var index;
1498 var subPart;
1499 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1500 pathOffset += 1;
1501
1502 var query = (req.url).query;
1503 var queryOffset = 0;
1504 var queryMap = {};
1505 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1506 parseBool(n) {
1507 if (n == "true") return true;
1508 if (n == "false") return false;
1509 if (n == null) return null;
1510 throw new core.ArgumentError("Invalid boolean: $n");
1511 }
1512 if (query.length > 0) {
1513 for (var part in query.split("&")) {
1514 var keyvalue = part.split("=");
1515 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1516 }
1517 }
1518
1519
1520 var h = {
1521 "content-type" : "application/json; charset=utf-8",
1522 };
1523 var resp = convert.JSON.encode(buildExecution());
1524 return new async.Future.value(stringResponse(200, h, resp));
1525 }), true);
1526 res.get(arg_projectId, arg_historyId, arg_executionId).then(unittest.expec tAsync(((api.Execution response) {
1527 checkExecution(response);
1528 })));
1529 });
1530
1531 unittest.test("method--list", () {
1532
1533 var mock = new HttpServerMock();
1534 api.ProjectsHistoriesExecutionsResourceApi res = new api.ToolresultsApi(mo ck).projects.histories.executions;
1535 var arg_projectId = "foo";
1536 var arg_historyId = "foo";
1537 var arg_pageSize = 42;
1538 var arg_pageToken = "foo";
1539 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1540 var path = (req.url).path;
1541 var pathOffset = 0;
1542 var index;
1543 var subPart;
1544 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1545 pathOffset += 1;
1546
1547 var query = (req.url).query;
1548 var queryOffset = 0;
1549 var queryMap = {};
1550 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1551 parseBool(n) {
1552 if (n == "true") return true;
1553 if (n == "false") return false;
1554 if (n == null) return null;
1555 throw new core.ArgumentError("Invalid boolean: $n");
1556 }
1557 if (query.length > 0) {
1558 for (var part in query.split("&")) {
1559 var keyvalue = part.split("=");
1560 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1561 }
1562 }
1563 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
1564 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1565
1566
1567 var h = {
1568 "content-type" : "application/json; charset=utf-8",
1569 };
1570 var resp = convert.JSON.encode(buildListExecutionsResponse());
1571 return new async.Future.value(stringResponse(200, h, resp));
1572 }), true);
1573 res.list(arg_projectId, arg_historyId, pageSize: arg_pageSize, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListExecutionsResponse response) {
1574 checkListExecutionsResponse(response);
1575 })));
1576 });
1577
1578 unittest.test("method--patch", () {
1579
1580 var mock = new HttpServerMock();
1581 api.ProjectsHistoriesExecutionsResourceApi res = new api.ToolresultsApi(mo ck).projects.histories.executions;
1582 var arg_request = buildExecution();
1583 var arg_projectId = "foo";
1584 var arg_historyId = "foo";
1585 var arg_executionId = "foo";
1586 var arg_requestId = "foo";
1587 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1588 var obj = new api.Execution.fromJson(json);
1589 checkExecution(obj);
1590
1591 var path = (req.url).path;
1592 var pathOffset = 0;
1593 var index;
1594 var subPart;
1595 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1596 pathOffset += 1;
1597
1598 var query = (req.url).query;
1599 var queryOffset = 0;
1600 var queryMap = {};
1601 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1602 parseBool(n) {
1603 if (n == "true") return true;
1604 if (n == "false") return false;
1605 if (n == null) return null;
1606 throw new core.ArgumentError("Invalid boolean: $n");
1607 }
1608 if (query.length > 0) {
1609 for (var part in query.split("&")) {
1610 var keyvalue = part.split("=");
1611 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1612 }
1613 }
1614 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id));
1615
1616
1617 var h = {
1618 "content-type" : "application/json; charset=utf-8",
1619 };
1620 var resp = convert.JSON.encode(buildExecution());
1621 return new async.Future.value(stringResponse(200, h, resp));
1622 }), true);
1623 res.patch(arg_request, arg_projectId, arg_historyId, arg_executionId, requ estId: arg_requestId).then(unittest.expectAsync(((api.Execution response) {
1624 checkExecution(response);
1625 })));
1626 });
1627
1628 });
1629
1630
1631 unittest.group("resource-ProjectsHistoriesExecutionsStepsResourceApi", () {
1632 unittest.test("method--create", () {
1633
1634 var mock = new HttpServerMock();
1635 api.ProjectsHistoriesExecutionsStepsResourceApi res = new api.ToolresultsA pi(mock).projects.histories.executions.steps;
1636 var arg_request = buildStep();
1637 var arg_projectId = "foo";
1638 var arg_historyId = "foo";
1639 var arg_executionId = "foo";
1640 var arg_requestId = "foo";
1641 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1642 var obj = new api.Step.fromJson(json);
1643 checkStep(obj);
1644
1645 var path = (req.url).path;
1646 var pathOffset = 0;
1647 var index;
1648 var subPart;
1649 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1650 pathOffset += 1;
1651
1652 var query = (req.url).query;
1653 var queryOffset = 0;
1654 var queryMap = {};
1655 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1656 parseBool(n) {
1657 if (n == "true") return true;
1658 if (n == "false") return false;
1659 if (n == null) return null;
1660 throw new core.ArgumentError("Invalid boolean: $n");
1661 }
1662 if (query.length > 0) {
1663 for (var part in query.split("&")) {
1664 var keyvalue = part.split("=");
1665 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1666 }
1667 }
1668 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id));
1669
1670
1671 var h = {
1672 "content-type" : "application/json; charset=utf-8",
1673 };
1674 var resp = convert.JSON.encode(buildStep());
1675 return new async.Future.value(stringResponse(200, h, resp));
1676 }), true);
1677 res.create(arg_request, arg_projectId, arg_historyId, arg_executionId, req uestId: arg_requestId).then(unittest.expectAsync(((api.Step response) {
1678 checkStep(response);
1679 })));
1680 });
1681
1682 unittest.test("method--get", () {
1683
1684 var mock = new HttpServerMock();
1685 api.ProjectsHistoriesExecutionsStepsResourceApi res = new api.ToolresultsA pi(mock).projects.histories.executions.steps;
1686 var arg_projectId = "foo";
1687 var arg_historyId = "foo";
1688 var arg_executionId = "foo";
1689 var arg_stepId = "foo";
1690 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1691 var path = (req.url).path;
1692 var pathOffset = 0;
1693 var index;
1694 var subPart;
1695 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1696 pathOffset += 1;
1697
1698 var query = (req.url).query;
1699 var queryOffset = 0;
1700 var queryMap = {};
1701 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1702 parseBool(n) {
1703 if (n == "true") return true;
1704 if (n == "false") return false;
1705 if (n == null) return null;
1706 throw new core.ArgumentError("Invalid boolean: $n");
1707 }
1708 if (query.length > 0) {
1709 for (var part in query.split("&")) {
1710 var keyvalue = part.split("=");
1711 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1712 }
1713 }
1714
1715
1716 var h = {
1717 "content-type" : "application/json; charset=utf-8",
1718 };
1719 var resp = convert.JSON.encode(buildStep());
1720 return new async.Future.value(stringResponse(200, h, resp));
1721 }), true);
1722 res.get(arg_projectId, arg_historyId, arg_executionId, arg_stepId).then(un ittest.expectAsync(((api.Step response) {
1723 checkStep(response);
1724 })));
1725 });
1726
1727 unittest.test("method--list", () {
1728
1729 var mock = new HttpServerMock();
1730 api.ProjectsHistoriesExecutionsStepsResourceApi res = new api.ToolresultsA pi(mock).projects.histories.executions.steps;
1731 var arg_projectId = "foo";
1732 var arg_historyId = "foo";
1733 var arg_executionId = "foo";
1734 var arg_pageSize = 42;
1735 var arg_pageToken = "foo";
1736 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1737 var path = (req.url).path;
1738 var pathOffset = 0;
1739 var index;
1740 var subPart;
1741 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1742 pathOffset += 1;
1743
1744 var query = (req.url).query;
1745 var queryOffset = 0;
1746 var queryMap = {};
1747 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1748 parseBool(n) {
1749 if (n == "true") return true;
1750 if (n == "false") return false;
1751 if (n == null) return null;
1752 throw new core.ArgumentError("Invalid boolean: $n");
1753 }
1754 if (query.length > 0) {
1755 for (var part in query.split("&")) {
1756 var keyvalue = part.split("=");
1757 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1758 }
1759 }
1760 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
1761 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1762
1763
1764 var h = {
1765 "content-type" : "application/json; charset=utf-8",
1766 };
1767 var resp = convert.JSON.encode(buildListStepsResponse());
1768 return new async.Future.value(stringResponse(200, h, resp));
1769 }), true);
1770 res.list(arg_projectId, arg_historyId, arg_executionId, pageSize: arg_page Size, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListStepsRespons e response) {
1771 checkListStepsResponse(response);
1772 })));
1773 });
1774
1775 unittest.test("method--patch", () {
1776
1777 var mock = new HttpServerMock();
1778 api.ProjectsHistoriesExecutionsStepsResourceApi res = new api.ToolresultsA pi(mock).projects.histories.executions.steps;
1779 var arg_request = buildStep();
1780 var arg_projectId = "foo";
1781 var arg_historyId = "foo";
1782 var arg_executionId = "foo";
1783 var arg_stepId = "foo";
1784 var arg_requestId = "foo";
1785 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1786 var obj = new api.Step.fromJson(json);
1787 checkStep(obj);
1788
1789 var path = (req.url).path;
1790 var pathOffset = 0;
1791 var index;
1792 var subPart;
1793 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1794 pathOffset += 1;
1795
1796 var query = (req.url).query;
1797 var queryOffset = 0;
1798 var queryMap = {};
1799 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1800 parseBool(n) {
1801 if (n == "true") return true;
1802 if (n == "false") return false;
1803 if (n == null) return null;
1804 throw new core.ArgumentError("Invalid boolean: $n");
1805 }
1806 if (query.length > 0) {
1807 for (var part in query.split("&")) {
1808 var keyvalue = part.split("=");
1809 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1810 }
1811 }
1812 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id));
1813
1814
1815 var h = {
1816 "content-type" : "application/json; charset=utf-8",
1817 };
1818 var resp = convert.JSON.encode(buildStep());
1819 return new async.Future.value(stringResponse(200, h, resp));
1820 }), true);
1821 res.patch(arg_request, arg_projectId, arg_historyId, arg_executionId, arg_ stepId, requestId: arg_requestId).then(unittest.expectAsync(((api.Step response) {
1822 checkStep(response);
1823 })));
1824 });
1825
1826 unittest.test("method--publishXunitXmlFiles", () {
1827
1828 var mock = new HttpServerMock();
1829 api.ProjectsHistoriesExecutionsStepsResourceApi res = new api.ToolresultsA pi(mock).projects.histories.executions.steps;
1830 var arg_request = buildPublishXunitXmlFilesRequest();
1831 var arg_projectId = "foo";
1832 var arg_historyId = "foo";
1833 var arg_executionId = "foo";
1834 var arg_stepId = "foo";
1835 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1836 var obj = new api.PublishXunitXmlFilesRequest.fromJson(json);
1837 checkPublishXunitXmlFilesRequest(obj);
1838
1839 var path = (req.url).path;
1840 var pathOffset = 0;
1841 var index;
1842 var subPart;
1843 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1844 pathOffset += 1;
1845
1846 var query = (req.url).query;
1847 var queryOffset = 0;
1848 var queryMap = {};
1849 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1850 parseBool(n) {
1851 if (n == "true") return true;
1852 if (n == "false") return false;
1853 if (n == null) return null;
1854 throw new core.ArgumentError("Invalid boolean: $n");
1855 }
1856 if (query.length > 0) {
1857 for (var part in query.split("&")) {
1858 var keyvalue = part.split("=");
1859 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1860 }
1861 }
1862
1863
1864 var h = {
1865 "content-type" : "application/json; charset=utf-8",
1866 };
1867 var resp = convert.JSON.encode(buildStep());
1868 return new async.Future.value(stringResponse(200, h, resp));
1869 }), true);
1870 res.publishXunitXmlFiles(arg_request, arg_projectId, arg_historyId, arg_ex ecutionId, arg_stepId).then(unittest.expectAsync(((api.Step response) {
1871 checkStep(response);
1872 })));
1873 });
1874
1875 });
1876
1877
1878 unittest.group("resource-ProjectsHistoriesExecutionsStepsThumbnailsResourceApi ", () {
1879 unittest.test("method--list", () {
1880
1881 var mock = new HttpServerMock();
1882 api.ProjectsHistoriesExecutionsStepsThumbnailsResourceApi res = new api.To olresultsApi(mock).projects.histories.executions.steps.thumbnails;
1883 var arg_projectId = "foo";
1884 var arg_historyId = "foo";
1885 var arg_executionId = "foo";
1886 var arg_stepId = "foo";
1887 var arg_pageSize = 42;
1888 var arg_pageToken = "foo";
1889 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1890 var path = (req.url).path;
1891 var pathOffset = 0;
1892 var index;
1893 var subPart;
1894 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1895 pathOffset += 1;
1896
1897 var query = (req.url).query;
1898 var queryOffset = 0;
1899 var queryMap = {};
1900 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1901 parseBool(n) {
1902 if (n == "true") return true;
1903 if (n == "false") return false;
1904 if (n == null) return null;
1905 throw new core.ArgumentError("Invalid boolean: $n");
1906 }
1907 if (query.length > 0) {
1908 for (var part in query.split("&")) {
1909 var keyvalue = part.split("=");
1910 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1911 }
1912 }
1913 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize));
1914 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1915
1916
1917 var h = {
1918 "content-type" : "application/json; charset=utf-8",
1919 };
1920 var resp = convert.JSON.encode(buildListStepThumbnailsResponse());
1921 return new async.Future.value(stringResponse(200, h, resp));
1922 }), true);
1923 res.list(arg_projectId, arg_historyId, arg_executionId, arg_stepId, pageSi ze: arg_pageSize, pageToken: arg_pageToken).then(unittest.expectAsync(((api.List StepThumbnailsResponse response) {
1924 checkListStepThumbnailsResponse(response);
1925 })));
1926 });
1927
1928 });
1929
1930
1931 }
1932
OLDNEW
« no previous file with comments | « generated/googleapis_beta/test/taskqueue/v1beta2_test.dart ('k') | resources/googleapis/CHANGELOG.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698