OLD | NEW |
1 library googleapis.tracing.v2.test; | 1 library googleapis.tracing.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:unittest/unittest.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis/tracing/v2.dart' as api; | 12 import 'package:googleapis/tracing/v2.dart' as api; |
13 | 13 |
14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 15 core.Function _callback; |
16 core.bool _expectJson; | 16 core.bool _expectJson; |
17 | 17 |
18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 19 _callback = callback; |
20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 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)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 core.int buildCounterAnnotation = 0; | 54 core.int buildCounterAnnotation = 0; |
55 buildAnnotation() { | 55 buildAnnotation() { |
56 var o = new api.Annotation(); | 56 var o = new api.Annotation(); |
57 buildCounterAnnotation++; | 57 buildCounterAnnotation++; |
58 if (buildCounterAnnotation < 3) { | 58 if (buildCounterAnnotation < 3) { |
59 o.attributes = buildAttributes(); | 59 o.attributes = buildAttributes(); |
(...skipping 28 matching lines...) Expand all 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 buildUnnamed1729() { | 98 buildUnnamed1739() { |
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 checkUnnamed1729(core.Map<core.String, api.AttributeValue> o) { | 105 checkUnnamed1739(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 = buildUnnamed1729(); | 116 o.attributeMap = buildUnnamed1739(); |
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 checkUnnamed1729(o.attributeMap); | 126 checkUnnamed1739(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 buildUnnamed1730() { | 132 buildUnnamed1740() { |
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 checkUnnamed1730(core.List<api.Span> o) { | 139 checkUnnamed1740(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 = buildUnnamed1730(); | 150 o.spans = buildUnnamed1740(); |
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 checkUnnamed1730(o.spans); | 159 checkUnnamed1740(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 24 matching lines...) Expand all Loading... |
194 checkLink(api.Link o) { | 194 checkLink(api.Link o) { |
195 buildCounterLink++; | 195 buildCounterLink++; |
196 if (buildCounterLink < 3) { | 196 if (buildCounterLink < 3) { |
197 unittest.expect(o.spanId, unittest.equals('foo')); | 197 unittest.expect(o.spanId, unittest.equals('foo')); |
198 unittest.expect(o.traceId, unittest.equals('foo')); | 198 unittest.expect(o.traceId, unittest.equals('foo')); |
199 unittest.expect(o.type, unittest.equals('foo')); | 199 unittest.expect(o.type, unittest.equals('foo')); |
200 } | 200 } |
201 buildCounterLink--; | 201 buildCounterLink--; |
202 } | 202 } |
203 | 203 |
204 buildUnnamed1731() { | 204 buildUnnamed1741() { |
205 var o = new core.List<api.Link>(); | 205 var o = new core.List<api.Link>(); |
206 o.add(buildLink()); | 206 o.add(buildLink()); |
207 o.add(buildLink()); | 207 o.add(buildLink()); |
208 return o; | 208 return o; |
209 } | 209 } |
210 | 210 |
211 checkUnnamed1731(core.List<api.Link> o) { | 211 checkUnnamed1741(core.List<api.Link> o) { |
212 unittest.expect(o, unittest.hasLength(2)); | 212 unittest.expect(o, unittest.hasLength(2)); |
213 checkLink(o[0]); | 213 checkLink(o[0]); |
214 checkLink(o[1]); | 214 checkLink(o[1]); |
215 } | 215 } |
216 | 216 |
217 core.int buildCounterLinks = 0; | 217 core.int buildCounterLinks = 0; |
218 buildLinks() { | 218 buildLinks() { |
219 var o = new api.Links(); | 219 var o = new api.Links(); |
220 buildCounterLinks++; | 220 buildCounterLinks++; |
221 if (buildCounterLinks < 3) { | 221 if (buildCounterLinks < 3) { |
222 o.droppedLinksCount = 42; | 222 o.droppedLinksCount = 42; |
223 o.link = buildUnnamed1731(); | 223 o.link = buildUnnamed1741(); |
224 } | 224 } |
225 buildCounterLinks--; | 225 buildCounterLinks--; |
226 return o; | 226 return o; |
227 } | 227 } |
228 | 228 |
229 checkLinks(api.Links o) { | 229 checkLinks(api.Links o) { |
230 buildCounterLinks++; | 230 buildCounterLinks++; |
231 if (buildCounterLinks < 3) { | 231 if (buildCounterLinks < 3) { |
232 unittest.expect(o.droppedLinksCount, unittest.equals(42)); | 232 unittest.expect(o.droppedLinksCount, unittest.equals(42)); |
233 checkUnnamed1731(o.link); | 233 checkUnnamed1741(o.link); |
234 } | 234 } |
235 buildCounterLinks--; | 235 buildCounterLinks--; |
236 } | 236 } |
237 | 237 |
238 buildUnnamed1732() { | 238 buildUnnamed1742() { |
239 var o = new core.List<api.Span>(); | 239 var o = new core.List<api.Span>(); |
240 o.add(buildSpan()); | 240 o.add(buildSpan()); |
241 o.add(buildSpan()); | 241 o.add(buildSpan()); |
242 return o; | 242 return o; |
243 } | 243 } |
244 | 244 |
245 checkUnnamed1732(core.List<api.Span> o) { | 245 checkUnnamed1742(core.List<api.Span> o) { |
246 unittest.expect(o, unittest.hasLength(2)); | 246 unittest.expect(o, unittest.hasLength(2)); |
247 checkSpan(o[0]); | 247 checkSpan(o[0]); |
248 checkSpan(o[1]); | 248 checkSpan(o[1]); |
249 } | 249 } |
250 | 250 |
251 core.int buildCounterListSpansResponse = 0; | 251 core.int buildCounterListSpansResponse = 0; |
252 buildListSpansResponse() { | 252 buildListSpansResponse() { |
253 var o = new api.ListSpansResponse(); | 253 var o = new api.ListSpansResponse(); |
254 buildCounterListSpansResponse++; | 254 buildCounterListSpansResponse++; |
255 if (buildCounterListSpansResponse < 3) { | 255 if (buildCounterListSpansResponse < 3) { |
256 o.nextPageToken = "foo"; | 256 o.nextPageToken = "foo"; |
257 o.spans = buildUnnamed1732(); | 257 o.spans = buildUnnamed1742(); |
258 } | 258 } |
259 buildCounterListSpansResponse--; | 259 buildCounterListSpansResponse--; |
260 return o; | 260 return o; |
261 } | 261 } |
262 | 262 |
263 checkListSpansResponse(api.ListSpansResponse o) { | 263 checkListSpansResponse(api.ListSpansResponse o) { |
264 buildCounterListSpansResponse++; | 264 buildCounterListSpansResponse++; |
265 if (buildCounterListSpansResponse < 3) { | 265 if (buildCounterListSpansResponse < 3) { |
266 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 266 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
267 checkUnnamed1732(o.spans); | 267 checkUnnamed1742(o.spans); |
268 } | 268 } |
269 buildCounterListSpansResponse--; | 269 buildCounterListSpansResponse--; |
270 } | 270 } |
271 | 271 |
272 buildUnnamed1733() { | 272 buildUnnamed1743() { |
273 var o = new core.List<api.Trace>(); | 273 var o = new core.List<api.Trace>(); |
274 o.add(buildTrace()); | 274 o.add(buildTrace()); |
275 o.add(buildTrace()); | 275 o.add(buildTrace()); |
276 return o; | 276 return o; |
277 } | 277 } |
278 | 278 |
279 checkUnnamed1733(core.List<api.Trace> o) { | 279 checkUnnamed1743(core.List<api.Trace> o) { |
280 unittest.expect(o, unittest.hasLength(2)); | 280 unittest.expect(o, unittest.hasLength(2)); |
281 checkTrace(o[0]); | 281 checkTrace(o[0]); |
282 checkTrace(o[1]); | 282 checkTrace(o[1]); |
283 } | 283 } |
284 | 284 |
285 core.int buildCounterListTracesResponse = 0; | 285 core.int buildCounterListTracesResponse = 0; |
286 buildListTracesResponse() { | 286 buildListTracesResponse() { |
287 var o = new api.ListTracesResponse(); | 287 var o = new api.ListTracesResponse(); |
288 buildCounterListTracesResponse++; | 288 buildCounterListTracesResponse++; |
289 if (buildCounterListTracesResponse < 3) { | 289 if (buildCounterListTracesResponse < 3) { |
290 o.nextPageToken = "foo"; | 290 o.nextPageToken = "foo"; |
291 o.traces = buildUnnamed1733(); | 291 o.traces = buildUnnamed1743(); |
292 } | 292 } |
293 buildCounterListTracesResponse--; | 293 buildCounterListTracesResponse--; |
294 return o; | 294 return o; |
295 } | 295 } |
296 | 296 |
297 checkListTracesResponse(api.ListTracesResponse o) { | 297 checkListTracesResponse(api.ListTracesResponse o) { |
298 buildCounterListTracesResponse++; | 298 buildCounterListTracesResponse++; |
299 if (buildCounterListTracesResponse < 3) { | 299 if (buildCounterListTracesResponse < 3) { |
300 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 300 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
301 checkUnnamed1733(o.traces); | 301 checkUnnamed1743(o.traces); |
302 } | 302 } |
303 buildCounterListTracesResponse--; | 303 buildCounterListTracesResponse--; |
304 } | 304 } |
305 | 305 |
306 core.int buildCounterModule = 0; | 306 core.int buildCounterModule = 0; |
307 buildModule() { | 307 buildModule() { |
308 var o = new api.Module(); | 308 var o = new api.Module(); |
309 buildCounterModule++; | 309 buildCounterModule++; |
310 if (buildCounterModule < 3) { | 310 if (buildCounterModule < 3) { |
311 o.buildId = buildTruncatableString(); | 311 o.buildId = buildTruncatableString(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 checkTruncatableString(o.fileName); | 412 checkTruncatableString(o.fileName); |
413 checkTruncatableString(o.functionName); | 413 checkTruncatableString(o.functionName); |
414 unittest.expect(o.lineNumber, unittest.equals('foo')); | 414 unittest.expect(o.lineNumber, unittest.equals('foo')); |
415 checkModule(o.loadModule); | 415 checkModule(o.loadModule); |
416 checkTruncatableString(o.originalFunctionName); | 416 checkTruncatableString(o.originalFunctionName); |
417 checkTruncatableString(o.sourceVersion); | 417 checkTruncatableString(o.sourceVersion); |
418 } | 418 } |
419 buildCounterStackFrame--; | 419 buildCounterStackFrame--; |
420 } | 420 } |
421 | 421 |
422 buildUnnamed1734() { | 422 buildUnnamed1744() { |
423 var o = new core.List<api.StackFrame>(); | 423 var o = new core.List<api.StackFrame>(); |
424 o.add(buildStackFrame()); | 424 o.add(buildStackFrame()); |
425 o.add(buildStackFrame()); | 425 o.add(buildStackFrame()); |
426 return o; | 426 return o; |
427 } | 427 } |
428 | 428 |
429 checkUnnamed1734(core.List<api.StackFrame> o) { | 429 checkUnnamed1744(core.List<api.StackFrame> o) { |
430 unittest.expect(o, unittest.hasLength(2)); | 430 unittest.expect(o, unittest.hasLength(2)); |
431 checkStackFrame(o[0]); | 431 checkStackFrame(o[0]); |
432 checkStackFrame(o[1]); | 432 checkStackFrame(o[1]); |
433 } | 433 } |
434 | 434 |
435 core.int buildCounterStackFrames = 0; | 435 core.int buildCounterStackFrames = 0; |
436 buildStackFrames() { | 436 buildStackFrames() { |
437 var o = new api.StackFrames(); | 437 var o = new api.StackFrames(); |
438 buildCounterStackFrames++; | 438 buildCounterStackFrames++; |
439 if (buildCounterStackFrames < 3) { | 439 if (buildCounterStackFrames < 3) { |
440 o.droppedFramesCount = 42; | 440 o.droppedFramesCount = 42; |
441 o.frame = buildUnnamed1734(); | 441 o.frame = buildUnnamed1744(); |
442 } | 442 } |
443 buildCounterStackFrames--; | 443 buildCounterStackFrames--; |
444 return o; | 444 return o; |
445 } | 445 } |
446 | 446 |
447 checkStackFrames(api.StackFrames o) { | 447 checkStackFrames(api.StackFrames o) { |
448 buildCounterStackFrames++; | 448 buildCounterStackFrames++; |
449 if (buildCounterStackFrames < 3) { | 449 if (buildCounterStackFrames < 3) { |
450 unittest.expect(o.droppedFramesCount, unittest.equals(42)); | 450 unittest.expect(o.droppedFramesCount, unittest.equals(42)); |
451 checkUnnamed1734(o.frame); | 451 checkUnnamed1744(o.frame); |
452 } | 452 } |
453 buildCounterStackFrames--; | 453 buildCounterStackFrames--; |
454 } | 454 } |
455 | 455 |
456 core.int buildCounterStackTrace = 0; | 456 core.int buildCounterStackTrace = 0; |
457 buildStackTrace() { | 457 buildStackTrace() { |
458 var o = new api.StackTrace(); | 458 var o = new api.StackTrace(); |
459 buildCounterStackTrace++; | 459 buildCounterStackTrace++; |
460 if (buildCounterStackTrace < 3) { | 460 if (buildCounterStackTrace < 3) { |
461 o.stackFrames = buildStackFrames(); | 461 o.stackFrames = buildStackFrames(); |
462 o.stackTraceHashId = "foo"; | 462 o.stackTraceHashId = "foo"; |
463 } | 463 } |
464 buildCounterStackTrace--; | 464 buildCounterStackTrace--; |
465 return o; | 465 return o; |
466 } | 466 } |
467 | 467 |
468 checkStackTrace(api.StackTrace o) { | 468 checkStackTrace(api.StackTrace o) { |
469 buildCounterStackTrace++; | 469 buildCounterStackTrace++; |
470 if (buildCounterStackTrace < 3) { | 470 if (buildCounterStackTrace < 3) { |
471 checkStackFrames(o.stackFrames); | 471 checkStackFrames(o.stackFrames); |
472 unittest.expect(o.stackTraceHashId, unittest.equals('foo')); | 472 unittest.expect(o.stackTraceHashId, unittest.equals('foo')); |
473 } | 473 } |
474 buildCounterStackTrace--; | 474 buildCounterStackTrace--; |
475 } | 475 } |
476 | 476 |
477 buildUnnamed1735() { | 477 buildUnnamed1745() { |
478 var o = new core.Map<core.String, core.Object>(); | 478 var o = new core.Map<core.String, core.Object>(); |
479 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 479 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
480 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 480 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
481 return o; | 481 return o; |
482 } | 482 } |
483 | 483 |
484 checkUnnamed1735(core.Map<core.String, core.Object> o) { | 484 checkUnnamed1745(core.Map<core.String, core.Object> o) { |
485 unittest.expect(o, unittest.hasLength(2)); | 485 unittest.expect(o, unittest.hasLength(2)); |
486 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')); | 486 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')); |
487 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')); | 487 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')); |
488 } | 488 } |
489 | 489 |
490 buildUnnamed1736() { | 490 buildUnnamed1746() { |
491 var o = new core.List<core.Map<core.String, core.Object>>(); | 491 var o = new core.List<core.Map<core.String, core.Object>>(); |
492 o.add(buildUnnamed1735()); | 492 o.add(buildUnnamed1745()); |
493 o.add(buildUnnamed1735()); | 493 o.add(buildUnnamed1745()); |
494 return o; | 494 return o; |
495 } | 495 } |
496 | 496 |
497 checkUnnamed1736(core.List<core.Map<core.String, core.Object>> o) { | 497 checkUnnamed1746(core.List<core.Map<core.String, core.Object>> o) { |
498 unittest.expect(o, unittest.hasLength(2)); | 498 unittest.expect(o, unittest.hasLength(2)); |
499 checkUnnamed1735(o[0]); | 499 checkUnnamed1745(o[0]); |
500 checkUnnamed1735(o[1]); | 500 checkUnnamed1745(o[1]); |
501 } | 501 } |
502 | 502 |
503 core.int buildCounterStatus = 0; | 503 core.int buildCounterStatus = 0; |
504 buildStatus() { | 504 buildStatus() { |
505 var o = new api.Status(); | 505 var o = new api.Status(); |
506 buildCounterStatus++; | 506 buildCounterStatus++; |
507 if (buildCounterStatus < 3) { | 507 if (buildCounterStatus < 3) { |
508 o.code = 42; | 508 o.code = 42; |
509 o.details = buildUnnamed1736(); | 509 o.details = buildUnnamed1746(); |
510 o.message = "foo"; | 510 o.message = "foo"; |
511 } | 511 } |
512 buildCounterStatus--; | 512 buildCounterStatus--; |
513 return o; | 513 return o; |
514 } | 514 } |
515 | 515 |
516 checkStatus(api.Status o) { | 516 checkStatus(api.Status o) { |
517 buildCounterStatus++; | 517 buildCounterStatus++; |
518 if (buildCounterStatus < 3) { | 518 if (buildCounterStatus < 3) { |
519 unittest.expect(o.code, unittest.equals(42)); | 519 unittest.expect(o.code, unittest.equals(42)); |
520 checkUnnamed1736(o.details); | 520 checkUnnamed1746(o.details); |
521 unittest.expect(o.message, unittest.equals('foo')); | 521 unittest.expect(o.message, unittest.equals('foo')); |
522 } | 522 } |
523 buildCounterStatus--; | 523 buildCounterStatus--; |
524 } | 524 } |
525 | 525 |
526 core.int buildCounterTimeEvent = 0; | 526 core.int buildCounterTimeEvent = 0; |
527 buildTimeEvent() { | 527 buildTimeEvent() { |
528 var o = new api.TimeEvent(); | 528 var o = new api.TimeEvent(); |
529 buildCounterTimeEvent++; | 529 buildCounterTimeEvent++; |
530 if (buildCounterTimeEvent < 3) { | 530 if (buildCounterTimeEvent < 3) { |
531 o.annotation = buildAnnotation(); | 531 o.annotation = buildAnnotation(); |
532 o.networkEvent = buildNetworkEvent(); | 532 o.networkEvent = buildNetworkEvent(); |
533 o.time = "foo"; | 533 o.time = "foo"; |
534 } | 534 } |
535 buildCounterTimeEvent--; | 535 buildCounterTimeEvent--; |
536 return o; | 536 return o; |
537 } | 537 } |
538 | 538 |
539 checkTimeEvent(api.TimeEvent o) { | 539 checkTimeEvent(api.TimeEvent o) { |
540 buildCounterTimeEvent++; | 540 buildCounterTimeEvent++; |
541 if (buildCounterTimeEvent < 3) { | 541 if (buildCounterTimeEvent < 3) { |
542 checkAnnotation(o.annotation); | 542 checkAnnotation(o.annotation); |
543 checkNetworkEvent(o.networkEvent); | 543 checkNetworkEvent(o.networkEvent); |
544 unittest.expect(o.time, unittest.equals('foo')); | 544 unittest.expect(o.time, unittest.equals('foo')); |
545 } | 545 } |
546 buildCounterTimeEvent--; | 546 buildCounterTimeEvent--; |
547 } | 547 } |
548 | 548 |
549 buildUnnamed1737() { | 549 buildUnnamed1747() { |
550 var o = new core.List<api.TimeEvent>(); | 550 var o = new core.List<api.TimeEvent>(); |
551 o.add(buildTimeEvent()); | 551 o.add(buildTimeEvent()); |
552 o.add(buildTimeEvent()); | 552 o.add(buildTimeEvent()); |
553 return o; | 553 return o; |
554 } | 554 } |
555 | 555 |
556 checkUnnamed1737(core.List<api.TimeEvent> o) { | 556 checkUnnamed1747(core.List<api.TimeEvent> o) { |
557 unittest.expect(o, unittest.hasLength(2)); | 557 unittest.expect(o, unittest.hasLength(2)); |
558 checkTimeEvent(o[0]); | 558 checkTimeEvent(o[0]); |
559 checkTimeEvent(o[1]); | 559 checkTimeEvent(o[1]); |
560 } | 560 } |
561 | 561 |
562 core.int buildCounterTimeEvents = 0; | 562 core.int buildCounterTimeEvents = 0; |
563 buildTimeEvents() { | 563 buildTimeEvents() { |
564 var o = new api.TimeEvents(); | 564 var o = new api.TimeEvents(); |
565 buildCounterTimeEvents++; | 565 buildCounterTimeEvents++; |
566 if (buildCounterTimeEvents < 3) { | 566 if (buildCounterTimeEvents < 3) { |
567 o.droppedAnnotationsCount = 42; | 567 o.droppedAnnotationsCount = 42; |
568 o.droppedNetworkEventsCount = 42; | 568 o.droppedNetworkEventsCount = 42; |
569 o.timeEvent = buildUnnamed1737(); | 569 o.timeEvent = buildUnnamed1747(); |
570 } | 570 } |
571 buildCounterTimeEvents--; | 571 buildCounterTimeEvents--; |
572 return o; | 572 return o; |
573 } | 573 } |
574 | 574 |
575 checkTimeEvents(api.TimeEvents o) { | 575 checkTimeEvents(api.TimeEvents o) { |
576 buildCounterTimeEvents++; | 576 buildCounterTimeEvents++; |
577 if (buildCounterTimeEvents < 3) { | 577 if (buildCounterTimeEvents < 3) { |
578 unittest.expect(o.droppedAnnotationsCount, unittest.equals(42)); | 578 unittest.expect(o.droppedAnnotationsCount, unittest.equals(42)); |
579 unittest.expect(o.droppedNetworkEventsCount, unittest.equals(42)); | 579 unittest.expect(o.droppedNetworkEventsCount, unittest.equals(42)); |
580 checkUnnamed1737(o.timeEvent); | 580 checkUnnamed1747(o.timeEvent); |
581 } | 581 } |
582 buildCounterTimeEvents--; | 582 buildCounterTimeEvents--; |
583 } | 583 } |
584 | 584 |
585 core.int buildCounterTrace = 0; | 585 core.int buildCounterTrace = 0; |
586 buildTrace() { | 586 buildTrace() { |
587 var o = new api.Trace(); | 587 var o = new api.Trace(); |
588 buildCounterTrace++; | 588 buildCounterTrace++; |
589 if (buildCounterTrace < 3) { | 589 if (buildCounterTrace < 3) { |
590 o.name = "foo"; | 590 o.name = "foo"; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 }); | 804 }); |
805 | 805 |
806 | 806 |
807 unittest.group("resource-ProjectsTracesResourceApi", () { | 807 unittest.group("resource-ProjectsTracesResourceApi", () { |
808 unittest.test("method--batchWrite", () { | 808 unittest.test("method--batchWrite", () { |
809 | 809 |
810 var mock = new HttpServerMock(); | 810 var mock = new HttpServerMock(); |
811 api.ProjectsTracesResourceApi res = new api.TracingApi(mock).projects.trac
es; | 811 api.ProjectsTracesResourceApi res = new api.TracingApi(mock).projects.trac
es; |
812 var arg_request = buildBatchWriteSpansRequest(); | 812 var arg_request = buildBatchWriteSpansRequest(); |
813 var arg_name = "foo"; | 813 var arg_name = "foo"; |
814 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 814 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
815 var obj = new api.BatchWriteSpansRequest.fromJson(json); | 815 var obj = new api.BatchWriteSpansRequest.fromJson(json); |
816 checkBatchWriteSpansRequest(obj); | 816 checkBatchWriteSpansRequest(obj); |
817 | 817 |
818 var path = (req.url).path; | 818 var path = (req.url).path; |
819 var pathOffset = 0; | 819 var pathOffset = 0; |
820 var index; | 820 var index; |
821 var subPart; | 821 var subPart; |
822 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 822 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
823 pathOffset += 1; | 823 pathOffset += 1; |
824 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 824 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
842 } | 842 } |
843 } | 843 } |
844 | 844 |
845 | 845 |
846 var h = { | 846 var h = { |
847 "content-type" : "application/json; charset=utf-8", | 847 "content-type" : "application/json; charset=utf-8", |
848 }; | 848 }; |
849 var resp = convert.JSON.encode(buildEmpty()); | 849 var resp = convert.JSON.encode(buildEmpty()); |
850 return new async.Future.value(stringResponse(200, h, resp)); | 850 return new async.Future.value(stringResponse(200, h, resp)); |
851 }), true); | 851 }), true); |
852 res.batchWrite(arg_request, arg_name).then(unittest.expectAsync(((api.Empt
y response) { | 852 res.batchWrite(arg_request, arg_name).then(unittest.expectAsync1(((api.Emp
ty response) { |
853 checkEmpty(response); | 853 checkEmpty(response); |
854 }))); | 854 }))); |
855 }); | 855 }); |
856 | 856 |
857 unittest.test("method--list", () { | 857 unittest.test("method--list", () { |
858 | 858 |
859 var mock = new HttpServerMock(); | 859 var mock = new HttpServerMock(); |
860 api.ProjectsTracesResourceApi res = new api.TracingApi(mock).projects.trac
es; | 860 api.ProjectsTracesResourceApi res = new api.TracingApi(mock).projects.trac
es; |
861 var arg_parent = "foo"; | 861 var arg_parent = "foo"; |
| 862 var arg_orderBy = "foo"; |
862 var arg_filter = "foo"; | 863 var arg_filter = "foo"; |
863 var arg_endTime = "foo"; | 864 var arg_endTime = "foo"; |
864 var arg_pageToken = "foo"; | 865 var arg_pageToken = "foo"; |
865 var arg_startTime = "foo"; | 866 var arg_startTime = "foo"; |
866 var arg_pageSize = 42; | 867 var arg_pageSize = 42; |
867 var arg_orderBy = "foo"; | 868 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
868 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
869 var path = (req.url).path; | 869 var path = (req.url).path; |
870 var pathOffset = 0; | 870 var pathOffset = 0; |
871 var index; | 871 var index; |
872 var subPart; | 872 var subPart; |
873 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 873 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
874 pathOffset += 1; | 874 pathOffset += 1; |
875 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 875 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
876 pathOffset += 3; | 876 pathOffset += 3; |
877 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 877 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
878 | 878 |
879 var query = (req.url).query; | 879 var query = (req.url).query; |
880 var queryOffset = 0; | 880 var queryOffset = 0; |
881 var queryMap = {}; | 881 var queryMap = {}; |
882 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 882 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
883 parseBool(n) { | 883 parseBool(n) { |
884 if (n == "true") return true; | 884 if (n == "true") return true; |
885 if (n == "false") return false; | 885 if (n == "false") return false; |
886 if (n == null) return null; | 886 if (n == null) return null; |
887 throw new core.ArgumentError("Invalid boolean: $n"); | 887 throw new core.ArgumentError("Invalid boolean: $n"); |
888 } | 888 } |
889 if (query.length > 0) { | 889 if (query.length > 0) { |
890 for (var part in query.split("&")) { | 890 for (var part in query.split("&")) { |
891 var keyvalue = part.split("="); | 891 var keyvalue = part.split("="); |
892 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 892 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
893 } | 893 } |
894 } | 894 } |
| 895 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; |
895 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 896 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
896 unittest.expect(queryMap["endTime"].first, unittest.equals(arg_endTime))
; | 897 unittest.expect(queryMap["endTime"].first, unittest.equals(arg_endTime))
; |
897 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 898 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
898 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi
me)); | 899 unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTi
me)); |
899 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 900 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
900 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | |
901 | 901 |
902 | 902 |
903 var h = { | 903 var h = { |
904 "content-type" : "application/json; charset=utf-8", | 904 "content-type" : "application/json; charset=utf-8", |
905 }; | 905 }; |
906 var resp = convert.JSON.encode(buildListTracesResponse()); | 906 var resp = convert.JSON.encode(buildListTracesResponse()); |
907 return new async.Future.value(stringResponse(200, h, resp)); | 907 return new async.Future.value(stringResponse(200, h, resp)); |
908 }), true); | 908 }), true); |
909 res.list(arg_parent, filter: arg_filter, endTime: arg_endTime, pageToken:
arg_pageToken, startTime: arg_startTime, pageSize: arg_pageSize, orderBy: arg_or
derBy).then(unittest.expectAsync(((api.ListTracesResponse response) { | 909 res.list(arg_parent, orderBy: arg_orderBy, filter: arg_filter, endTime: ar
g_endTime, pageToken: arg_pageToken, startTime: arg_startTime, pageSize: arg_pag
eSize).then(unittest.expectAsync1(((api.ListTracesResponse response) { |
910 checkListTracesResponse(response); | 910 checkListTracesResponse(response); |
911 }))); | 911 }))); |
912 }); | 912 }); |
913 | 913 |
914 unittest.test("method--listSpans", () { | 914 unittest.test("method--listSpans", () { |
915 | 915 |
916 var mock = new HttpServerMock(); | 916 var mock = new HttpServerMock(); |
917 api.ProjectsTracesResourceApi res = new api.TracingApi(mock).projects.trac
es; | 917 api.ProjectsTracesResourceApi res = new api.TracingApi(mock).projects.trac
es; |
918 var arg_parent = "foo"; | 918 var arg_parent = "foo"; |
919 var arg_pageToken = "foo"; | 919 var arg_pageToken = "foo"; |
920 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 920 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
921 var path = (req.url).path; | 921 var path = (req.url).path; |
922 var pathOffset = 0; | 922 var pathOffset = 0; |
923 var index; | 923 var index; |
924 var subPart; | 924 var subPart; |
925 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 925 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
926 pathOffset += 1; | 926 pathOffset += 1; |
927 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 927 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
928 pathOffset += 3; | 928 pathOffset += 3; |
929 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 929 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
930 | 930 |
(...skipping 15 matching lines...) Expand all Loading... |
946 } | 946 } |
947 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 947 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
948 | 948 |
949 | 949 |
950 var h = { | 950 var h = { |
951 "content-type" : "application/json; charset=utf-8", | 951 "content-type" : "application/json; charset=utf-8", |
952 }; | 952 }; |
953 var resp = convert.JSON.encode(buildListSpansResponse()); | 953 var resp = convert.JSON.encode(buildListSpansResponse()); |
954 return new async.Future.value(stringResponse(200, h, resp)); | 954 return new async.Future.value(stringResponse(200, h, resp)); |
955 }), true); | 955 }), true); |
956 res.listSpans(arg_parent, pageToken: arg_pageToken).then(unittest.expectAs
ync(((api.ListSpansResponse response) { | 956 res.listSpans(arg_parent, pageToken: arg_pageToken).then(unittest.expectAs
ync1(((api.ListSpansResponse response) { |
957 checkListSpansResponse(response); | 957 checkListSpansResponse(response); |
958 }))); | 958 }))); |
959 }); | 959 }); |
960 | 960 |
961 }); | 961 }); |
962 | 962 |
963 | 963 |
964 unittest.group("resource-ProjectsTracesSpansResourceApi", () { | 964 unittest.group("resource-ProjectsTracesSpansResourceApi", () { |
965 unittest.test("method--create", () { | 965 unittest.test("method--create", () { |
966 | 966 |
967 var mock = new HttpServerMock(); | 967 var mock = new HttpServerMock(); |
968 api.ProjectsTracesSpansResourceApi res = new api.TracingApi(mock).projects
.traces.spans; | 968 api.ProjectsTracesSpansResourceApi res = new api.TracingApi(mock).projects
.traces.spans; |
969 var arg_request = buildSpan(); | 969 var arg_request = buildSpan(); |
970 var arg_name = "foo"; | 970 var arg_name = "foo"; |
971 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 971 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
972 var obj = new api.Span.fromJson(json); | 972 var obj = new api.Span.fromJson(json); |
973 checkSpan(obj); | 973 checkSpan(obj); |
974 | 974 |
975 var path = (req.url).path; | 975 var path = (req.url).path; |
976 var pathOffset = 0; | 976 var pathOffset = 0; |
977 var index; | 977 var index; |
978 var subPart; | 978 var subPart; |
979 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 979 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
980 pathOffset += 1; | 980 pathOffset += 1; |
981 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 981 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
999 } | 999 } |
1000 } | 1000 } |
1001 | 1001 |
1002 | 1002 |
1003 var h = { | 1003 var h = { |
1004 "content-type" : "application/json; charset=utf-8", | 1004 "content-type" : "application/json; charset=utf-8", |
1005 }; | 1005 }; |
1006 var resp = convert.JSON.encode(buildSpan()); | 1006 var resp = convert.JSON.encode(buildSpan()); |
1007 return new async.Future.value(stringResponse(200, h, resp)); | 1007 return new async.Future.value(stringResponse(200, h, resp)); |
1008 }), true); | 1008 }), true); |
1009 res.create(arg_request, arg_name).then(unittest.expectAsync(((api.Span res
ponse) { | 1009 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Span re
sponse) { |
1010 checkSpan(response); | 1010 checkSpan(response); |
1011 }))); | 1011 }))); |
1012 }); | 1012 }); |
1013 | 1013 |
1014 }); | 1014 }); |
1015 | 1015 |
1016 | 1016 |
1017 } | 1017 } |
1018 | 1018 |
OLD | NEW |