OLD | NEW |
1 library googleapis.cloudtrace.v2.test; | 1 library googleapis.cloudtrace.v2.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:test/test.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 checkAttributeValue(api.AttributeValue o) { | 88 checkAttributeValue(api.AttributeValue o) { |
89 buildCounterAttributeValue++; | 89 buildCounterAttributeValue++; |
90 if (buildCounterAttributeValue < 3) { | 90 if (buildCounterAttributeValue < 3) { |
91 unittest.expect(o.boolValue, unittest.isTrue); | 91 unittest.expect(o.boolValue, unittest.isTrue); |
92 unittest.expect(o.intValue, unittest.equals('foo')); | 92 unittest.expect(o.intValue, unittest.equals('foo')); |
93 checkTruncatableString(o.stringValue); | 93 checkTruncatableString(o.stringValue); |
94 } | 94 } |
95 buildCounterAttributeValue--; | 95 buildCounterAttributeValue--; |
96 } | 96 } |
97 | 97 |
98 buildUnnamed1087() { | 98 buildUnnamed1104() { |
99 var o = new core.Map<core.String, api.AttributeValue>(); | 99 var o = new core.Map<core.String, api.AttributeValue>(); |
100 o["x"] = buildAttributeValue(); | 100 o["x"] = buildAttributeValue(); |
101 o["y"] = buildAttributeValue(); | 101 o["y"] = buildAttributeValue(); |
102 return o; | 102 return o; |
103 } | 103 } |
104 | 104 |
105 checkUnnamed1087(core.Map<core.String, api.AttributeValue> o) { | 105 checkUnnamed1104(core.Map<core.String, api.AttributeValue> o) { |
106 unittest.expect(o, unittest.hasLength(2)); | 106 unittest.expect(o, unittest.hasLength(2)); |
107 checkAttributeValue(o["x"]); | 107 checkAttributeValue(o["x"]); |
108 checkAttributeValue(o["y"]); | 108 checkAttributeValue(o["y"]); |
109 } | 109 } |
110 | 110 |
111 core.int buildCounterAttributes = 0; | 111 core.int buildCounterAttributes = 0; |
112 buildAttributes() { | 112 buildAttributes() { |
113 var o = new api.Attributes(); | 113 var o = new api.Attributes(); |
114 buildCounterAttributes++; | 114 buildCounterAttributes++; |
115 if (buildCounterAttributes < 3) { | 115 if (buildCounterAttributes < 3) { |
116 o.attributeMap = buildUnnamed1087(); | 116 o.attributeMap = buildUnnamed1104(); |
117 o.droppedAttributesCount = 42; | 117 o.droppedAttributesCount = 42; |
118 } | 118 } |
119 buildCounterAttributes--; | 119 buildCounterAttributes--; |
120 return o; | 120 return o; |
121 } | 121 } |
122 | 122 |
123 checkAttributes(api.Attributes o) { | 123 checkAttributes(api.Attributes o) { |
124 buildCounterAttributes++; | 124 buildCounterAttributes++; |
125 if (buildCounterAttributes < 3) { | 125 if (buildCounterAttributes < 3) { |
126 checkUnnamed1087(o.attributeMap); | 126 checkUnnamed1104(o.attributeMap); |
127 unittest.expect(o.droppedAttributesCount, unittest.equals(42)); | 127 unittest.expect(o.droppedAttributesCount, unittest.equals(42)); |
128 } | 128 } |
129 buildCounterAttributes--; | 129 buildCounterAttributes--; |
130 } | 130 } |
131 | 131 |
132 buildUnnamed1088() { | 132 buildUnnamed1105() { |
133 var o = new core.List<api.Span>(); | 133 var o = new core.List<api.Span>(); |
134 o.add(buildSpan()); | 134 o.add(buildSpan()); |
135 o.add(buildSpan()); | 135 o.add(buildSpan()); |
136 return o; | 136 return o; |
137 } | 137 } |
138 | 138 |
139 checkUnnamed1088(core.List<api.Span> o) { | 139 checkUnnamed1105(core.List<api.Span> o) { |
140 unittest.expect(o, unittest.hasLength(2)); | 140 unittest.expect(o, unittest.hasLength(2)); |
141 checkSpan(o[0]); | 141 checkSpan(o[0]); |
142 checkSpan(o[1]); | 142 checkSpan(o[1]); |
143 } | 143 } |
144 | 144 |
145 core.int buildCounterBatchWriteSpansRequest = 0; | 145 core.int buildCounterBatchWriteSpansRequest = 0; |
146 buildBatchWriteSpansRequest() { | 146 buildBatchWriteSpansRequest() { |
147 var o = new api.BatchWriteSpansRequest(); | 147 var o = new api.BatchWriteSpansRequest(); |
148 buildCounterBatchWriteSpansRequest++; | 148 buildCounterBatchWriteSpansRequest++; |
149 if (buildCounterBatchWriteSpansRequest < 3) { | 149 if (buildCounterBatchWriteSpansRequest < 3) { |
150 o.spans = buildUnnamed1088(); | 150 o.spans = buildUnnamed1105(); |
151 } | 151 } |
152 buildCounterBatchWriteSpansRequest--; | 152 buildCounterBatchWriteSpansRequest--; |
153 return o; | 153 return o; |
154 } | 154 } |
155 | 155 |
156 checkBatchWriteSpansRequest(api.BatchWriteSpansRequest o) { | 156 checkBatchWriteSpansRequest(api.BatchWriteSpansRequest o) { |
157 buildCounterBatchWriteSpansRequest++; | 157 buildCounterBatchWriteSpansRequest++; |
158 if (buildCounterBatchWriteSpansRequest < 3) { | 158 if (buildCounterBatchWriteSpansRequest < 3) { |
159 checkUnnamed1088(o.spans); | 159 checkUnnamed1105(o.spans); |
160 } | 160 } |
161 buildCounterBatchWriteSpansRequest--; | 161 buildCounterBatchWriteSpansRequest--; |
162 } | 162 } |
163 | 163 |
164 core.int buildCounterEmpty = 0; | 164 core.int buildCounterEmpty = 0; |
165 buildEmpty() { | 165 buildEmpty() { |
166 var o = new api.Empty(); | 166 var o = new api.Empty(); |
167 buildCounterEmpty++; | 167 buildCounterEmpty++; |
168 if (buildCounterEmpty < 3) { | 168 if (buildCounterEmpty < 3) { |
169 } | 169 } |
(...skipping 26 matching lines...) Expand all Loading... |
196 buildCounterLink++; | 196 buildCounterLink++; |
197 if (buildCounterLink < 3) { | 197 if (buildCounterLink < 3) { |
198 checkAttributes(o.attributes); | 198 checkAttributes(o.attributes); |
199 unittest.expect(o.spanId, unittest.equals('foo')); | 199 unittest.expect(o.spanId, unittest.equals('foo')); |
200 unittest.expect(o.traceId, unittest.equals('foo')); | 200 unittest.expect(o.traceId, unittest.equals('foo')); |
201 unittest.expect(o.type, unittest.equals('foo')); | 201 unittest.expect(o.type, unittest.equals('foo')); |
202 } | 202 } |
203 buildCounterLink--; | 203 buildCounterLink--; |
204 } | 204 } |
205 | 205 |
206 buildUnnamed1089() { | 206 buildUnnamed1106() { |
207 var o = new core.List<api.Link>(); | 207 var o = new core.List<api.Link>(); |
208 o.add(buildLink()); | 208 o.add(buildLink()); |
209 o.add(buildLink()); | 209 o.add(buildLink()); |
210 return o; | 210 return o; |
211 } | 211 } |
212 | 212 |
213 checkUnnamed1089(core.List<api.Link> o) { | 213 checkUnnamed1106(core.List<api.Link> o) { |
214 unittest.expect(o, unittest.hasLength(2)); | 214 unittest.expect(o, unittest.hasLength(2)); |
215 checkLink(o[0]); | 215 checkLink(o[0]); |
216 checkLink(o[1]); | 216 checkLink(o[1]); |
217 } | 217 } |
218 | 218 |
219 core.int buildCounterLinks = 0; | 219 core.int buildCounterLinks = 0; |
220 buildLinks() { | 220 buildLinks() { |
221 var o = new api.Links(); | 221 var o = new api.Links(); |
222 buildCounterLinks++; | 222 buildCounterLinks++; |
223 if (buildCounterLinks < 3) { | 223 if (buildCounterLinks < 3) { |
224 o.droppedLinksCount = 42; | 224 o.droppedLinksCount = 42; |
225 o.link = buildUnnamed1089(); | 225 o.link = buildUnnamed1106(); |
226 } | 226 } |
227 buildCounterLinks--; | 227 buildCounterLinks--; |
228 return o; | 228 return o; |
229 } | 229 } |
230 | 230 |
231 checkLinks(api.Links o) { | 231 checkLinks(api.Links o) { |
232 buildCounterLinks++; | 232 buildCounterLinks++; |
233 if (buildCounterLinks < 3) { | 233 if (buildCounterLinks < 3) { |
234 unittest.expect(o.droppedLinksCount, unittest.equals(42)); | 234 unittest.expect(o.droppedLinksCount, unittest.equals(42)); |
235 checkUnnamed1089(o.link); | 235 checkUnnamed1106(o.link); |
236 } | 236 } |
237 buildCounterLinks--; | 237 buildCounterLinks--; |
238 } | 238 } |
239 | 239 |
240 buildUnnamed1090() { | 240 buildUnnamed1107() { |
241 var o = new core.List<api.Span>(); | 241 var o = new core.List<api.Span>(); |
242 o.add(buildSpan()); | 242 o.add(buildSpan()); |
243 o.add(buildSpan()); | 243 o.add(buildSpan()); |
244 return o; | 244 return o; |
245 } | 245 } |
246 | 246 |
247 checkUnnamed1090(core.List<api.Span> o) { | 247 checkUnnamed1107(core.List<api.Span> o) { |
248 unittest.expect(o, unittest.hasLength(2)); | 248 unittest.expect(o, unittest.hasLength(2)); |
249 checkSpan(o[0]); | 249 checkSpan(o[0]); |
250 checkSpan(o[1]); | 250 checkSpan(o[1]); |
251 } | 251 } |
252 | 252 |
253 core.int buildCounterListSpansResponse = 0; | 253 core.int buildCounterListSpansResponse = 0; |
254 buildListSpansResponse() { | 254 buildListSpansResponse() { |
255 var o = new api.ListSpansResponse(); | 255 var o = new api.ListSpansResponse(); |
256 buildCounterListSpansResponse++; | 256 buildCounterListSpansResponse++; |
257 if (buildCounterListSpansResponse < 3) { | 257 if (buildCounterListSpansResponse < 3) { |
258 o.nextPageToken = "foo"; | 258 o.nextPageToken = "foo"; |
259 o.spans = buildUnnamed1090(); | 259 o.spans = buildUnnamed1107(); |
260 } | 260 } |
261 buildCounterListSpansResponse--; | 261 buildCounterListSpansResponse--; |
262 return o; | 262 return o; |
263 } | 263 } |
264 | 264 |
265 checkListSpansResponse(api.ListSpansResponse o) { | 265 checkListSpansResponse(api.ListSpansResponse o) { |
266 buildCounterListSpansResponse++; | 266 buildCounterListSpansResponse++; |
267 if (buildCounterListSpansResponse < 3) { | 267 if (buildCounterListSpansResponse < 3) { |
268 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 268 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
269 checkUnnamed1090(o.spans); | 269 checkUnnamed1107(o.spans); |
270 } | 270 } |
271 buildCounterListSpansResponse--; | 271 buildCounterListSpansResponse--; |
272 } | 272 } |
273 | 273 |
274 buildUnnamed1091() { | 274 buildUnnamed1108() { |
275 var o = new core.List<api.Trace>(); | 275 var o = new core.List<api.Trace>(); |
276 o.add(buildTrace()); | 276 o.add(buildTrace()); |
277 o.add(buildTrace()); | 277 o.add(buildTrace()); |
278 return o; | 278 return o; |
279 } | 279 } |
280 | 280 |
281 checkUnnamed1091(core.List<api.Trace> o) { | 281 checkUnnamed1108(core.List<api.Trace> o) { |
282 unittest.expect(o, unittest.hasLength(2)); | 282 unittest.expect(o, unittest.hasLength(2)); |
283 checkTrace(o[0]); | 283 checkTrace(o[0]); |
284 checkTrace(o[1]); | 284 checkTrace(o[1]); |
285 } | 285 } |
286 | 286 |
287 core.int buildCounterListTracesResponse = 0; | 287 core.int buildCounterListTracesResponse = 0; |
288 buildListTracesResponse() { | 288 buildListTracesResponse() { |
289 var o = new api.ListTracesResponse(); | 289 var o = new api.ListTracesResponse(); |
290 buildCounterListTracesResponse++; | 290 buildCounterListTracesResponse++; |
291 if (buildCounterListTracesResponse < 3) { | 291 if (buildCounterListTracesResponse < 3) { |
292 o.nextPageToken = "foo"; | 292 o.nextPageToken = "foo"; |
293 o.traces = buildUnnamed1091(); | 293 o.traces = buildUnnamed1108(); |
294 } | 294 } |
295 buildCounterListTracesResponse--; | 295 buildCounterListTracesResponse--; |
296 return o; | 296 return o; |
297 } | 297 } |
298 | 298 |
299 checkListTracesResponse(api.ListTracesResponse o) { | 299 checkListTracesResponse(api.ListTracesResponse o) { |
300 buildCounterListTracesResponse++; | 300 buildCounterListTracesResponse++; |
301 if (buildCounterListTracesResponse < 3) { | 301 if (buildCounterListTracesResponse < 3) { |
302 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 302 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
303 checkUnnamed1091(o.traces); | 303 checkUnnamed1108(o.traces); |
304 } | 304 } |
305 buildCounterListTracesResponse--; | 305 buildCounterListTracesResponse--; |
306 } | 306 } |
307 | 307 |
308 core.int buildCounterModule = 0; | 308 core.int buildCounterModule = 0; |
309 buildModule() { | 309 buildModule() { |
310 var o = new api.Module(); | 310 var o = new api.Module(); |
311 buildCounterModule++; | 311 buildCounterModule++; |
312 if (buildCounterModule < 3) { | 312 if (buildCounterModule < 3) { |
313 o.buildId = buildTruncatableString(); | 313 o.buildId = buildTruncatableString(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 checkTruncatableString(o.fileName); | 418 checkTruncatableString(o.fileName); |
419 checkTruncatableString(o.functionName); | 419 checkTruncatableString(o.functionName); |
420 unittest.expect(o.lineNumber, unittest.equals('foo')); | 420 unittest.expect(o.lineNumber, unittest.equals('foo')); |
421 checkModule(o.loadModule); | 421 checkModule(o.loadModule); |
422 checkTruncatableString(o.originalFunctionName); | 422 checkTruncatableString(o.originalFunctionName); |
423 checkTruncatableString(o.sourceVersion); | 423 checkTruncatableString(o.sourceVersion); |
424 } | 424 } |
425 buildCounterStackFrame--; | 425 buildCounterStackFrame--; |
426 } | 426 } |
427 | 427 |
428 buildUnnamed1092() { | 428 buildUnnamed1109() { |
429 var o = new core.List<api.StackFrame>(); | 429 var o = new core.List<api.StackFrame>(); |
430 o.add(buildStackFrame()); | 430 o.add(buildStackFrame()); |
431 o.add(buildStackFrame()); | 431 o.add(buildStackFrame()); |
432 return o; | 432 return o; |
433 } | 433 } |
434 | 434 |
435 checkUnnamed1092(core.List<api.StackFrame> o) { | 435 checkUnnamed1109(core.List<api.StackFrame> o) { |
436 unittest.expect(o, unittest.hasLength(2)); | 436 unittest.expect(o, unittest.hasLength(2)); |
437 checkStackFrame(o[0]); | 437 checkStackFrame(o[0]); |
438 checkStackFrame(o[1]); | 438 checkStackFrame(o[1]); |
439 } | 439 } |
440 | 440 |
441 core.int buildCounterStackFrames = 0; | 441 core.int buildCounterStackFrames = 0; |
442 buildStackFrames() { | 442 buildStackFrames() { |
443 var o = new api.StackFrames(); | 443 var o = new api.StackFrames(); |
444 buildCounterStackFrames++; | 444 buildCounterStackFrames++; |
445 if (buildCounterStackFrames < 3) { | 445 if (buildCounterStackFrames < 3) { |
446 o.droppedFramesCount = 42; | 446 o.droppedFramesCount = 42; |
447 o.frame = buildUnnamed1092(); | 447 o.frame = buildUnnamed1109(); |
448 } | 448 } |
449 buildCounterStackFrames--; | 449 buildCounterStackFrames--; |
450 return o; | 450 return o; |
451 } | 451 } |
452 | 452 |
453 checkStackFrames(api.StackFrames o) { | 453 checkStackFrames(api.StackFrames o) { |
454 buildCounterStackFrames++; | 454 buildCounterStackFrames++; |
455 if (buildCounterStackFrames < 3) { | 455 if (buildCounterStackFrames < 3) { |
456 unittest.expect(o.droppedFramesCount, unittest.equals(42)); | 456 unittest.expect(o.droppedFramesCount, unittest.equals(42)); |
457 checkUnnamed1092(o.frame); | 457 checkUnnamed1109(o.frame); |
458 } | 458 } |
459 buildCounterStackFrames--; | 459 buildCounterStackFrames--; |
460 } | 460 } |
461 | 461 |
462 core.int buildCounterStackTrace = 0; | 462 core.int buildCounterStackTrace = 0; |
463 buildStackTrace() { | 463 buildStackTrace() { |
464 var o = new api.StackTrace(); | 464 var o = new api.StackTrace(); |
465 buildCounterStackTrace++; | 465 buildCounterStackTrace++; |
466 if (buildCounterStackTrace < 3) { | 466 if (buildCounterStackTrace < 3) { |
467 o.stackFrames = buildStackFrames(); | 467 o.stackFrames = buildStackFrames(); |
468 o.stackTraceHashId = "foo"; | 468 o.stackTraceHashId = "foo"; |
469 } | 469 } |
470 buildCounterStackTrace--; | 470 buildCounterStackTrace--; |
471 return o; | 471 return o; |
472 } | 472 } |
473 | 473 |
474 checkStackTrace(api.StackTrace o) { | 474 checkStackTrace(api.StackTrace o) { |
475 buildCounterStackTrace++; | 475 buildCounterStackTrace++; |
476 if (buildCounterStackTrace < 3) { | 476 if (buildCounterStackTrace < 3) { |
477 checkStackFrames(o.stackFrames); | 477 checkStackFrames(o.stackFrames); |
478 unittest.expect(o.stackTraceHashId, unittest.equals('foo')); | 478 unittest.expect(o.stackTraceHashId, unittest.equals('foo')); |
479 } | 479 } |
480 buildCounterStackTrace--; | 480 buildCounterStackTrace--; |
481 } | 481 } |
482 | 482 |
483 buildUnnamed1093() { | 483 buildUnnamed1110() { |
484 var o = new core.Map<core.String, core.Object>(); | 484 var o = new core.Map<core.String, core.Object>(); |
485 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 485 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
486 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 486 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
487 return o; | 487 return o; |
488 } | 488 } |
489 | 489 |
490 checkUnnamed1093(core.Map<core.String, core.Object> o) { | 490 checkUnnamed1110(core.Map<core.String, core.Object> o) { |
491 unittest.expect(o, unittest.hasLength(2)); | 491 unittest.expect(o, unittest.hasLength(2)); |
492 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')); | 492 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')); |
493 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')); | 493 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')); |
494 } | 494 } |
495 | 495 |
496 buildUnnamed1094() { | 496 buildUnnamed1111() { |
497 var o = new core.List<core.Map<core.String, core.Object>>(); | 497 var o = new core.List<core.Map<core.String, core.Object>>(); |
498 o.add(buildUnnamed1093()); | 498 o.add(buildUnnamed1110()); |
499 o.add(buildUnnamed1093()); | 499 o.add(buildUnnamed1110()); |
500 return o; | 500 return o; |
501 } | 501 } |
502 | 502 |
503 checkUnnamed1094(core.List<core.Map<core.String, core.Object>> o) { | 503 checkUnnamed1111(core.List<core.Map<core.String, core.Object>> o) { |
504 unittest.expect(o, unittest.hasLength(2)); | 504 unittest.expect(o, unittest.hasLength(2)); |
505 checkUnnamed1093(o[0]); | 505 checkUnnamed1110(o[0]); |
506 checkUnnamed1093(o[1]); | 506 checkUnnamed1110(o[1]); |
507 } | 507 } |
508 | 508 |
509 core.int buildCounterStatus = 0; | 509 core.int buildCounterStatus = 0; |
510 buildStatus() { | 510 buildStatus() { |
511 var o = new api.Status(); | 511 var o = new api.Status(); |
512 buildCounterStatus++; | 512 buildCounterStatus++; |
513 if (buildCounterStatus < 3) { | 513 if (buildCounterStatus < 3) { |
514 o.code = 42; | 514 o.code = 42; |
515 o.details = buildUnnamed1094(); | 515 o.details = buildUnnamed1111(); |
516 o.message = "foo"; | 516 o.message = "foo"; |
517 } | 517 } |
518 buildCounterStatus--; | 518 buildCounterStatus--; |
519 return o; | 519 return o; |
520 } | 520 } |
521 | 521 |
522 checkStatus(api.Status o) { | 522 checkStatus(api.Status o) { |
523 buildCounterStatus++; | 523 buildCounterStatus++; |
524 if (buildCounterStatus < 3) { | 524 if (buildCounterStatus < 3) { |
525 unittest.expect(o.code, unittest.equals(42)); | 525 unittest.expect(o.code, unittest.equals(42)); |
526 checkUnnamed1094(o.details); | 526 checkUnnamed1111(o.details); |
527 unittest.expect(o.message, unittest.equals('foo')); | 527 unittest.expect(o.message, unittest.equals('foo')); |
528 } | 528 } |
529 buildCounterStatus--; | 529 buildCounterStatus--; |
530 } | 530 } |
531 | 531 |
532 core.int buildCounterTimeEvent = 0; | 532 core.int buildCounterTimeEvent = 0; |
533 buildTimeEvent() { | 533 buildTimeEvent() { |
534 var o = new api.TimeEvent(); | 534 var o = new api.TimeEvent(); |
535 buildCounterTimeEvent++; | 535 buildCounterTimeEvent++; |
536 if (buildCounterTimeEvent < 3) { | 536 if (buildCounterTimeEvent < 3) { |
537 o.annotation = buildAnnotation(); | 537 o.annotation = buildAnnotation(); |
538 o.networkEvent = buildNetworkEvent(); | 538 o.networkEvent = buildNetworkEvent(); |
539 o.time = "foo"; | 539 o.time = "foo"; |
540 } | 540 } |
541 buildCounterTimeEvent--; | 541 buildCounterTimeEvent--; |
542 return o; | 542 return o; |
543 } | 543 } |
544 | 544 |
545 checkTimeEvent(api.TimeEvent o) { | 545 checkTimeEvent(api.TimeEvent o) { |
546 buildCounterTimeEvent++; | 546 buildCounterTimeEvent++; |
547 if (buildCounterTimeEvent < 3) { | 547 if (buildCounterTimeEvent < 3) { |
548 checkAnnotation(o.annotation); | 548 checkAnnotation(o.annotation); |
549 checkNetworkEvent(o.networkEvent); | 549 checkNetworkEvent(o.networkEvent); |
550 unittest.expect(o.time, unittest.equals('foo')); | 550 unittest.expect(o.time, unittest.equals('foo')); |
551 } | 551 } |
552 buildCounterTimeEvent--; | 552 buildCounterTimeEvent--; |
553 } | 553 } |
554 | 554 |
555 buildUnnamed1095() { | 555 buildUnnamed1112() { |
556 var o = new core.List<api.TimeEvent>(); | 556 var o = new core.List<api.TimeEvent>(); |
557 o.add(buildTimeEvent()); | 557 o.add(buildTimeEvent()); |
558 o.add(buildTimeEvent()); | 558 o.add(buildTimeEvent()); |
559 return o; | 559 return o; |
560 } | 560 } |
561 | 561 |
562 checkUnnamed1095(core.List<api.TimeEvent> o) { | 562 checkUnnamed1112(core.List<api.TimeEvent> o) { |
563 unittest.expect(o, unittest.hasLength(2)); | 563 unittest.expect(o, unittest.hasLength(2)); |
564 checkTimeEvent(o[0]); | 564 checkTimeEvent(o[0]); |
565 checkTimeEvent(o[1]); | 565 checkTimeEvent(o[1]); |
566 } | 566 } |
567 | 567 |
568 core.int buildCounterTimeEvents = 0; | 568 core.int buildCounterTimeEvents = 0; |
569 buildTimeEvents() { | 569 buildTimeEvents() { |
570 var o = new api.TimeEvents(); | 570 var o = new api.TimeEvents(); |
571 buildCounterTimeEvents++; | 571 buildCounterTimeEvents++; |
572 if (buildCounterTimeEvents < 3) { | 572 if (buildCounterTimeEvents < 3) { |
573 o.droppedAnnotationsCount = 42; | 573 o.droppedAnnotationsCount = 42; |
574 o.droppedNetworkEventsCount = 42; | 574 o.droppedNetworkEventsCount = 42; |
575 o.timeEvent = buildUnnamed1095(); | 575 o.timeEvent = buildUnnamed1112(); |
576 } | 576 } |
577 buildCounterTimeEvents--; | 577 buildCounterTimeEvents--; |
578 return o; | 578 return o; |
579 } | 579 } |
580 | 580 |
581 checkTimeEvents(api.TimeEvents o) { | 581 checkTimeEvents(api.TimeEvents o) { |
582 buildCounterTimeEvents++; | 582 buildCounterTimeEvents++; |
583 if (buildCounterTimeEvents < 3) { | 583 if (buildCounterTimeEvents < 3) { |
584 unittest.expect(o.droppedAnnotationsCount, unittest.equals(42)); | 584 unittest.expect(o.droppedAnnotationsCount, unittest.equals(42)); |
585 unittest.expect(o.droppedNetworkEventsCount, unittest.equals(42)); | 585 unittest.expect(o.droppedNetworkEventsCount, unittest.equals(42)); |
586 checkUnnamed1095(o.timeEvent); | 586 checkUnnamed1112(o.timeEvent); |
587 } | 587 } |
588 buildCounterTimeEvents--; | 588 buildCounterTimeEvents--; |
589 } | 589 } |
590 | 590 |
591 core.int buildCounterTrace = 0; | 591 core.int buildCounterTrace = 0; |
592 buildTrace() { | 592 buildTrace() { |
593 var o = new api.Trace(); | 593 var o = new api.Trace(); |
594 buildCounterTrace++; | 594 buildCounterTrace++; |
595 if (buildCounterTrace < 3) { | 595 if (buildCounterTrace < 3) { |
596 o.name = "foo"; | 596 o.name = "foo"; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 res.batchWrite(arg_request, arg_name).then(unittest.expectAsync1(((api.Emp
ty response) { | 858 res.batchWrite(arg_request, arg_name).then(unittest.expectAsync1(((api.Emp
ty response) { |
859 checkEmpty(response); | 859 checkEmpty(response); |
860 }))); | 860 }))); |
861 }); | 861 }); |
862 | 862 |
863 unittest.test("method--list", () { | 863 unittest.test("method--list", () { |
864 | 864 |
865 var mock = new HttpServerMock(); | 865 var mock = new HttpServerMock(); |
866 api.ProjectsTracesResourceApi res = new api.CloudtraceApi(mock).projects.t
races; | 866 api.ProjectsTracesResourceApi res = new api.CloudtraceApi(mock).projects.t
races; |
867 var arg_parent = "foo"; | 867 var arg_parent = "foo"; |
868 var arg_orderBy = "foo"; | |
869 var arg_filter = "foo"; | 868 var arg_filter = "foo"; |
870 var arg_endTime = "foo"; | 869 var arg_endTime = "foo"; |
871 var arg_startTime = "foo"; | 870 var arg_startTime = "foo"; |
872 var arg_pageToken = "foo"; | 871 var arg_pageToken = "foo"; |
873 var arg_pageSize = 42; | 872 var arg_pageSize = 42; |
| 873 var arg_orderBy = "foo"; |
874 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 874 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
875 var path = (req.url).path; | 875 var path = (req.url).path; |
876 var pathOffset = 0; | 876 var pathOffset = 0; |
877 var index; | 877 var index; |
878 var subPart; | 878 var subPart; |
879 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 879 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
880 pathOffset += 1; | 880 pathOffset += 1; |
881 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 881 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
882 pathOffset += 3; | 882 pathOffset += 3; |
883 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 883 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
884 | 884 |
885 var query = (req.url).query; | 885 var query = (req.url).query; |
886 var queryOffset = 0; | 886 var queryOffset = 0; |
887 var queryMap = {}; | 887 var queryMap = {}; |
888 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 888 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
889 parseBool(n) { | 889 parseBool(n) { |
890 if (n == "true") return true; | 890 if (n == "true") return true; |
891 if (n == "false") return false; | 891 if (n == "false") return false; |
892 if (n == null) return null; | 892 if (n == null) return null; |
893 throw new core.ArgumentError("Invalid boolean: $n"); | 893 throw new core.ArgumentError("Invalid boolean: $n"); |
894 } | 894 } |
895 if (query.length > 0) { | 895 if (query.length > 0) { |
896 for (var part in query.split("&")) { | 896 for (var part in query.split("&")) { |
897 var keyvalue = part.split("="); | 897 var keyvalue = part.split("="); |
898 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 898 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
899 } | 899 } |
900 } | 900 } |
901 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | |
902 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 901 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
903 unittest.expect(queryMap["endTime"].first, unittest.equals(arg_endTime))
; | 902 unittest.expect(queryMap["endTime"].first, unittest.equals(arg_endTime))
; |
904 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi
me)); | 903 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi
me)); |
905 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 904 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
906 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 905 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 906 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; |
907 | 907 |
908 | 908 |
909 var h = { | 909 var h = { |
910 "content-type" : "application/json; charset=utf-8", | 910 "content-type" : "application/json; charset=utf-8", |
911 }; | 911 }; |
912 var resp = convert.JSON.encode(buildListTracesResponse()); | 912 var resp = convert.JSON.encode(buildListTracesResponse()); |
913 return new async.Future.value(stringResponse(200, h, resp)); | 913 return new async.Future.value(stringResponse(200, h, resp)); |
914 }), true); | 914 }), true); |
915 res.list(arg_parent, orderBy: arg_orderBy, filter: arg_filter, endTime: ar
g_endTime, startTime: arg_startTime, pageToken: arg_pageToken, pageSize: arg_pag
eSize).then(unittest.expectAsync1(((api.ListTracesResponse response) { | 915 res.list(arg_parent, filter: arg_filter, endTime: arg_endTime, startTime:
arg_startTime, pageToken: arg_pageToken, pageSize: arg_pageSize, orderBy: arg_or
derBy).then(unittest.expectAsync1(((api.ListTracesResponse response) { |
916 checkListTracesResponse(response); | 916 checkListTracesResponse(response); |
917 }))); | 917 }))); |
918 }); | 918 }); |
919 | 919 |
920 unittest.test("method--listSpans", () { | 920 unittest.test("method--listSpans", () { |
921 | 921 |
922 var mock = new HttpServerMock(); | 922 var mock = new HttpServerMock(); |
923 api.ProjectsTracesResourceApi res = new api.CloudtraceApi(mock).projects.t
races; | 923 api.ProjectsTracesResourceApi res = new api.CloudtraceApi(mock).projects.t
races; |
924 var arg_parent = "foo"; | 924 var arg_parent = "foo"; |
925 var arg_pageToken = "foo"; | 925 var arg_pageToken = "foo"; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Span re
sponse) { | 1015 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Span re
sponse) { |
1016 checkSpan(response); | 1016 checkSpan(response); |
1017 }))); | 1017 }))); |
1018 }); | 1018 }); |
1019 | 1019 |
1020 }); | 1020 }); |
1021 | 1021 |
1022 | 1022 |
1023 } | 1023 } |
1024 | 1024 |
OLD | NEW |