| OLD | NEW |
| 1 library googleapis_beta.clouderrorreporting.v1beta1.test; | 1 library googleapis_beta.clouderrorreporting.v1beta1.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:unittest/unittest.dart' as unittest; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 buildCounterErrorEvent++; | 109 buildCounterErrorEvent++; |
| 110 if (buildCounterErrorEvent < 3) { | 110 if (buildCounterErrorEvent < 3) { |
| 111 checkErrorContext(o.context); | 111 checkErrorContext(o.context); |
| 112 unittest.expect(o.eventTime, unittest.equals('foo')); | 112 unittest.expect(o.eventTime, unittest.equals('foo')); |
| 113 unittest.expect(o.message, unittest.equals('foo')); | 113 unittest.expect(o.message, unittest.equals('foo')); |
| 114 checkServiceContext(o.serviceContext); | 114 checkServiceContext(o.serviceContext); |
| 115 } | 115 } |
| 116 buildCounterErrorEvent--; | 116 buildCounterErrorEvent--; |
| 117 } | 117 } |
| 118 | 118 |
| 119 buildUnnamed3043() { | 119 buildUnnamed3278() { |
| 120 var o = new core.List<api.TrackingIssue>(); | 120 var o = new core.List<api.TrackingIssue>(); |
| 121 o.add(buildTrackingIssue()); | 121 o.add(buildTrackingIssue()); |
| 122 o.add(buildTrackingIssue()); | 122 o.add(buildTrackingIssue()); |
| 123 return o; | 123 return o; |
| 124 } | 124 } |
| 125 | 125 |
| 126 checkUnnamed3043(core.List<api.TrackingIssue> o) { | 126 checkUnnamed3278(core.List<api.TrackingIssue> o) { |
| 127 unittest.expect(o, unittest.hasLength(2)); | 127 unittest.expect(o, unittest.hasLength(2)); |
| 128 checkTrackingIssue(o[0]); | 128 checkTrackingIssue(o[0]); |
| 129 checkTrackingIssue(o[1]); | 129 checkTrackingIssue(o[1]); |
| 130 } | 130 } |
| 131 | 131 |
| 132 core.int buildCounterErrorGroup = 0; | 132 core.int buildCounterErrorGroup = 0; |
| 133 buildErrorGroup() { | 133 buildErrorGroup() { |
| 134 var o = new api.ErrorGroup(); | 134 var o = new api.ErrorGroup(); |
| 135 buildCounterErrorGroup++; | 135 buildCounterErrorGroup++; |
| 136 if (buildCounterErrorGroup < 3) { | 136 if (buildCounterErrorGroup < 3) { |
| 137 o.groupId = "foo"; | 137 o.groupId = "foo"; |
| 138 o.name = "foo"; | 138 o.name = "foo"; |
| 139 o.trackingIssues = buildUnnamed3043(); | 139 o.trackingIssues = buildUnnamed3278(); |
| 140 } | 140 } |
| 141 buildCounterErrorGroup--; | 141 buildCounterErrorGroup--; |
| 142 return o; | 142 return o; |
| 143 } | 143 } |
| 144 | 144 |
| 145 checkErrorGroup(api.ErrorGroup o) { | 145 checkErrorGroup(api.ErrorGroup o) { |
| 146 buildCounterErrorGroup++; | 146 buildCounterErrorGroup++; |
| 147 if (buildCounterErrorGroup < 3) { | 147 if (buildCounterErrorGroup < 3) { |
| 148 unittest.expect(o.groupId, unittest.equals('foo')); | 148 unittest.expect(o.groupId, unittest.equals('foo')); |
| 149 unittest.expect(o.name, unittest.equals('foo')); | 149 unittest.expect(o.name, unittest.equals('foo')); |
| 150 checkUnnamed3043(o.trackingIssues); | 150 checkUnnamed3278(o.trackingIssues); |
| 151 } | 151 } |
| 152 buildCounterErrorGroup--; | 152 buildCounterErrorGroup--; |
| 153 } | 153 } |
| 154 | 154 |
| 155 buildUnnamed3044() { | 155 buildUnnamed3279() { |
| 156 var o = new core.List<api.ServiceContext>(); | 156 var o = new core.List<api.ServiceContext>(); |
| 157 o.add(buildServiceContext()); | 157 o.add(buildServiceContext()); |
| 158 o.add(buildServiceContext()); | 158 o.add(buildServiceContext()); |
| 159 return o; | 159 return o; |
| 160 } | 160 } |
| 161 | 161 |
| 162 checkUnnamed3044(core.List<api.ServiceContext> o) { | 162 checkUnnamed3279(core.List<api.ServiceContext> o) { |
| 163 unittest.expect(o, unittest.hasLength(2)); | 163 unittest.expect(o, unittest.hasLength(2)); |
| 164 checkServiceContext(o[0]); | 164 checkServiceContext(o[0]); |
| 165 checkServiceContext(o[1]); | 165 checkServiceContext(o[1]); |
| 166 } | 166 } |
| 167 | 167 |
| 168 buildUnnamed3045() { | 168 buildUnnamed3280() { |
| 169 var o = new core.List<api.TimedCount>(); | 169 var o = new core.List<api.TimedCount>(); |
| 170 o.add(buildTimedCount()); | 170 o.add(buildTimedCount()); |
| 171 o.add(buildTimedCount()); | 171 o.add(buildTimedCount()); |
| 172 return o; | 172 return o; |
| 173 } | 173 } |
| 174 | 174 |
| 175 checkUnnamed3045(core.List<api.TimedCount> o) { | 175 checkUnnamed3280(core.List<api.TimedCount> o) { |
| 176 unittest.expect(o, unittest.hasLength(2)); | 176 unittest.expect(o, unittest.hasLength(2)); |
| 177 checkTimedCount(o[0]); | 177 checkTimedCount(o[0]); |
| 178 checkTimedCount(o[1]); | 178 checkTimedCount(o[1]); |
| 179 } | 179 } |
| 180 | 180 |
| 181 core.int buildCounterErrorGroupStats = 0; | 181 core.int buildCounterErrorGroupStats = 0; |
| 182 buildErrorGroupStats() { | 182 buildErrorGroupStats() { |
| 183 var o = new api.ErrorGroupStats(); | 183 var o = new api.ErrorGroupStats(); |
| 184 buildCounterErrorGroupStats++; | 184 buildCounterErrorGroupStats++; |
| 185 if (buildCounterErrorGroupStats < 3) { | 185 if (buildCounterErrorGroupStats < 3) { |
| 186 o.affectedServices = buildUnnamed3044(); | 186 o.affectedServices = buildUnnamed3279(); |
| 187 o.affectedUsersCount = "foo"; | 187 o.affectedUsersCount = "foo"; |
| 188 o.count = "foo"; | 188 o.count = "foo"; |
| 189 o.firstSeenTime = "foo"; | 189 o.firstSeenTime = "foo"; |
| 190 o.group = buildErrorGroup(); | 190 o.group = buildErrorGroup(); |
| 191 o.lastSeenTime = "foo"; | 191 o.lastSeenTime = "foo"; |
| 192 o.numAffectedServices = 42; | 192 o.numAffectedServices = 42; |
| 193 o.representative = buildErrorEvent(); | 193 o.representative = buildErrorEvent(); |
| 194 o.timedCounts = buildUnnamed3045(); | 194 o.timedCounts = buildUnnamed3280(); |
| 195 } | 195 } |
| 196 buildCounterErrorGroupStats--; | 196 buildCounterErrorGroupStats--; |
| 197 return o; | 197 return o; |
| 198 } | 198 } |
| 199 | 199 |
| 200 checkErrorGroupStats(api.ErrorGroupStats o) { | 200 checkErrorGroupStats(api.ErrorGroupStats o) { |
| 201 buildCounterErrorGroupStats++; | 201 buildCounterErrorGroupStats++; |
| 202 if (buildCounterErrorGroupStats < 3) { | 202 if (buildCounterErrorGroupStats < 3) { |
| 203 checkUnnamed3044(o.affectedServices); | 203 checkUnnamed3279(o.affectedServices); |
| 204 unittest.expect(o.affectedUsersCount, unittest.equals('foo')); | 204 unittest.expect(o.affectedUsersCount, unittest.equals('foo')); |
| 205 unittest.expect(o.count, unittest.equals('foo')); | 205 unittest.expect(o.count, unittest.equals('foo')); |
| 206 unittest.expect(o.firstSeenTime, unittest.equals('foo')); | 206 unittest.expect(o.firstSeenTime, unittest.equals('foo')); |
| 207 checkErrorGroup(o.group); | 207 checkErrorGroup(o.group); |
| 208 unittest.expect(o.lastSeenTime, unittest.equals('foo')); | 208 unittest.expect(o.lastSeenTime, unittest.equals('foo')); |
| 209 unittest.expect(o.numAffectedServices, unittest.equals(42)); | 209 unittest.expect(o.numAffectedServices, unittest.equals(42)); |
| 210 checkErrorEvent(o.representative); | 210 checkErrorEvent(o.representative); |
| 211 checkUnnamed3045(o.timedCounts); | 211 checkUnnamed3280(o.timedCounts); |
| 212 } | 212 } |
| 213 buildCounterErrorGroupStats--; | 213 buildCounterErrorGroupStats--; |
| 214 } | 214 } |
| 215 | 215 |
| 216 core.int buildCounterHttpRequestContext = 0; | 216 core.int buildCounterHttpRequestContext = 0; |
| 217 buildHttpRequestContext() { | 217 buildHttpRequestContext() { |
| 218 var o = new api.HttpRequestContext(); | 218 var o = new api.HttpRequestContext(); |
| 219 buildCounterHttpRequestContext++; | 219 buildCounterHttpRequestContext++; |
| 220 if (buildCounterHttpRequestContext < 3) { | 220 if (buildCounterHttpRequestContext < 3) { |
| 221 o.method = "foo"; | 221 o.method = "foo"; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 235 unittest.expect(o.method, unittest.equals('foo')); | 235 unittest.expect(o.method, unittest.equals('foo')); |
| 236 unittest.expect(o.referrer, unittest.equals('foo')); | 236 unittest.expect(o.referrer, unittest.equals('foo')); |
| 237 unittest.expect(o.remoteIp, unittest.equals('foo')); | 237 unittest.expect(o.remoteIp, unittest.equals('foo')); |
| 238 unittest.expect(o.responseStatusCode, unittest.equals(42)); | 238 unittest.expect(o.responseStatusCode, unittest.equals(42)); |
| 239 unittest.expect(o.url, unittest.equals('foo')); | 239 unittest.expect(o.url, unittest.equals('foo')); |
| 240 unittest.expect(o.userAgent, unittest.equals('foo')); | 240 unittest.expect(o.userAgent, unittest.equals('foo')); |
| 241 } | 241 } |
| 242 buildCounterHttpRequestContext--; | 242 buildCounterHttpRequestContext--; |
| 243 } | 243 } |
| 244 | 244 |
| 245 buildUnnamed3046() { | 245 buildUnnamed3281() { |
| 246 var o = new core.List<api.ErrorEvent>(); | 246 var o = new core.List<api.ErrorEvent>(); |
| 247 o.add(buildErrorEvent()); | 247 o.add(buildErrorEvent()); |
| 248 o.add(buildErrorEvent()); | 248 o.add(buildErrorEvent()); |
| 249 return o; | 249 return o; |
| 250 } | 250 } |
| 251 | 251 |
| 252 checkUnnamed3046(core.List<api.ErrorEvent> o) { | 252 checkUnnamed3281(core.List<api.ErrorEvent> o) { |
| 253 unittest.expect(o, unittest.hasLength(2)); | 253 unittest.expect(o, unittest.hasLength(2)); |
| 254 checkErrorEvent(o[0]); | 254 checkErrorEvent(o[0]); |
| 255 checkErrorEvent(o[1]); | 255 checkErrorEvent(o[1]); |
| 256 } | 256 } |
| 257 | 257 |
| 258 core.int buildCounterListEventsResponse = 0; | 258 core.int buildCounterListEventsResponse = 0; |
| 259 buildListEventsResponse() { | 259 buildListEventsResponse() { |
| 260 var o = new api.ListEventsResponse(); | 260 var o = new api.ListEventsResponse(); |
| 261 buildCounterListEventsResponse++; | 261 buildCounterListEventsResponse++; |
| 262 if (buildCounterListEventsResponse < 3) { | 262 if (buildCounterListEventsResponse < 3) { |
| 263 o.errorEvents = buildUnnamed3046(); | 263 o.errorEvents = buildUnnamed3281(); |
| 264 o.nextPageToken = "foo"; | 264 o.nextPageToken = "foo"; |
| 265 } | 265 } |
| 266 buildCounterListEventsResponse--; | 266 buildCounterListEventsResponse--; |
| 267 return o; | 267 return o; |
| 268 } | 268 } |
| 269 | 269 |
| 270 checkListEventsResponse(api.ListEventsResponse o) { | 270 checkListEventsResponse(api.ListEventsResponse o) { |
| 271 buildCounterListEventsResponse++; | 271 buildCounterListEventsResponse++; |
| 272 if (buildCounterListEventsResponse < 3) { | 272 if (buildCounterListEventsResponse < 3) { |
| 273 checkUnnamed3046(o.errorEvents); | 273 checkUnnamed3281(o.errorEvents); |
| 274 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 274 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 275 } | 275 } |
| 276 buildCounterListEventsResponse--; | 276 buildCounterListEventsResponse--; |
| 277 } | 277 } |
| 278 | 278 |
| 279 buildUnnamed3047() { | 279 buildUnnamed3282() { |
| 280 var o = new core.List<api.ErrorGroupStats>(); | 280 var o = new core.List<api.ErrorGroupStats>(); |
| 281 o.add(buildErrorGroupStats()); | 281 o.add(buildErrorGroupStats()); |
| 282 o.add(buildErrorGroupStats()); | 282 o.add(buildErrorGroupStats()); |
| 283 return o; | 283 return o; |
| 284 } | 284 } |
| 285 | 285 |
| 286 checkUnnamed3047(core.List<api.ErrorGroupStats> o) { | 286 checkUnnamed3282(core.List<api.ErrorGroupStats> o) { |
| 287 unittest.expect(o, unittest.hasLength(2)); | 287 unittest.expect(o, unittest.hasLength(2)); |
| 288 checkErrorGroupStats(o[0]); | 288 checkErrorGroupStats(o[0]); |
| 289 checkErrorGroupStats(o[1]); | 289 checkErrorGroupStats(o[1]); |
| 290 } | 290 } |
| 291 | 291 |
| 292 core.int buildCounterListGroupStatsResponse = 0; | 292 core.int buildCounterListGroupStatsResponse = 0; |
| 293 buildListGroupStatsResponse() { | 293 buildListGroupStatsResponse() { |
| 294 var o = new api.ListGroupStatsResponse(); | 294 var o = new api.ListGroupStatsResponse(); |
| 295 buildCounterListGroupStatsResponse++; | 295 buildCounterListGroupStatsResponse++; |
| 296 if (buildCounterListGroupStatsResponse < 3) { | 296 if (buildCounterListGroupStatsResponse < 3) { |
| 297 o.errorGroupStats = buildUnnamed3047(); | 297 o.errorGroupStats = buildUnnamed3282(); |
| 298 o.nextPageToken = "foo"; | 298 o.nextPageToken = "foo"; |
| 299 } | 299 } |
| 300 buildCounterListGroupStatsResponse--; | 300 buildCounterListGroupStatsResponse--; |
| 301 return o; | 301 return o; |
| 302 } | 302 } |
| 303 | 303 |
| 304 checkListGroupStatsResponse(api.ListGroupStatsResponse o) { | 304 checkListGroupStatsResponse(api.ListGroupStatsResponse o) { |
| 305 buildCounterListGroupStatsResponse++; | 305 buildCounterListGroupStatsResponse++; |
| 306 if (buildCounterListGroupStatsResponse < 3) { | 306 if (buildCounterListGroupStatsResponse < 3) { |
| 307 checkUnnamed3047(o.errorGroupStats); | 307 checkUnnamed3282(o.errorGroupStats); |
| 308 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 308 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 309 } | 309 } |
| 310 buildCounterListGroupStatsResponse--; | 310 buildCounterListGroupStatsResponse--; |
| 311 } | 311 } |
| 312 | 312 |
| 313 core.int buildCounterReportErrorEventResponse = 0; |
| 314 buildReportErrorEventResponse() { |
| 315 var o = new api.ReportErrorEventResponse(); |
| 316 buildCounterReportErrorEventResponse++; |
| 317 if (buildCounterReportErrorEventResponse < 3) { |
| 318 } |
| 319 buildCounterReportErrorEventResponse--; |
| 320 return o; |
| 321 } |
| 322 |
| 323 checkReportErrorEventResponse(api.ReportErrorEventResponse o) { |
| 324 buildCounterReportErrorEventResponse++; |
| 325 if (buildCounterReportErrorEventResponse < 3) { |
| 326 } |
| 327 buildCounterReportErrorEventResponse--; |
| 328 } |
| 329 |
| 330 core.int buildCounterReportedErrorEvent = 0; |
| 331 buildReportedErrorEvent() { |
| 332 var o = new api.ReportedErrorEvent(); |
| 333 buildCounterReportedErrorEvent++; |
| 334 if (buildCounterReportedErrorEvent < 3) { |
| 335 o.context = buildErrorContext(); |
| 336 o.eventTime = "foo"; |
| 337 o.message = "foo"; |
| 338 o.serviceContext = buildServiceContext(); |
| 339 } |
| 340 buildCounterReportedErrorEvent--; |
| 341 return o; |
| 342 } |
| 343 |
| 344 checkReportedErrorEvent(api.ReportedErrorEvent o) { |
| 345 buildCounterReportedErrorEvent++; |
| 346 if (buildCounterReportedErrorEvent < 3) { |
| 347 checkErrorContext(o.context); |
| 348 unittest.expect(o.eventTime, unittest.equals('foo')); |
| 349 unittest.expect(o.message, unittest.equals('foo')); |
| 350 checkServiceContext(o.serviceContext); |
| 351 } |
| 352 buildCounterReportedErrorEvent--; |
| 353 } |
| 354 |
| 313 core.int buildCounterServiceContext = 0; | 355 core.int buildCounterServiceContext = 0; |
| 314 buildServiceContext() { | 356 buildServiceContext() { |
| 315 var o = new api.ServiceContext(); | 357 var o = new api.ServiceContext(); |
| 316 buildCounterServiceContext++; | 358 buildCounterServiceContext++; |
| 317 if (buildCounterServiceContext < 3) { | 359 if (buildCounterServiceContext < 3) { |
| 318 o.service = "foo"; | 360 o.service = "foo"; |
| 319 o.version = "foo"; | 361 o.version = "foo"; |
| 320 } | 362 } |
| 321 buildCounterServiceContext--; | 363 buildCounterServiceContext--; |
| 322 return o; | 364 return o; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } | 431 } |
| 390 | 432 |
| 391 checkTrackingIssue(api.TrackingIssue o) { | 433 checkTrackingIssue(api.TrackingIssue o) { |
| 392 buildCounterTrackingIssue++; | 434 buildCounterTrackingIssue++; |
| 393 if (buildCounterTrackingIssue < 3) { | 435 if (buildCounterTrackingIssue < 3) { |
| 394 unittest.expect(o.url, unittest.equals('foo')); | 436 unittest.expect(o.url, unittest.equals('foo')); |
| 395 } | 437 } |
| 396 buildCounterTrackingIssue--; | 438 buildCounterTrackingIssue--; |
| 397 } | 439 } |
| 398 | 440 |
| 399 buildUnnamed3048() { | 441 buildUnnamed3283() { |
| 400 var o = new core.List<core.String>(); | 442 var o = new core.List<core.String>(); |
| 401 o.add("foo"); | 443 o.add("foo"); |
| 402 o.add("foo"); | 444 o.add("foo"); |
| 403 return o; | 445 return o; |
| 404 } | 446 } |
| 405 | 447 |
| 406 checkUnnamed3048(core.List<core.String> o) { | 448 checkUnnamed3283(core.List<core.String> o) { |
| 407 unittest.expect(o, unittest.hasLength(2)); | 449 unittest.expect(o, unittest.hasLength(2)); |
| 408 unittest.expect(o[0], unittest.equals('foo')); | 450 unittest.expect(o[0], unittest.equals('foo')); |
| 409 unittest.expect(o[1], unittest.equals('foo')); | 451 unittest.expect(o[1], unittest.equals('foo')); |
| 410 } | 452 } |
| 411 | 453 |
| 412 | 454 |
| 413 main() { | 455 main() { |
| 414 unittest.group("obj-schema-DeleteEventsResponse", () { | 456 unittest.group("obj-schema-DeleteEventsResponse", () { |
| 415 unittest.test("to-json--from-json", () { | 457 unittest.test("to-json--from-json", () { |
| 416 var o = buildDeleteEventsResponse(); | 458 var o = buildDeleteEventsResponse(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 518 |
| 477 unittest.group("obj-schema-ListGroupStatsResponse", () { | 519 unittest.group("obj-schema-ListGroupStatsResponse", () { |
| 478 unittest.test("to-json--from-json", () { | 520 unittest.test("to-json--from-json", () { |
| 479 var o = buildListGroupStatsResponse(); | 521 var o = buildListGroupStatsResponse(); |
| 480 var od = new api.ListGroupStatsResponse.fromJson(o.toJson()); | 522 var od = new api.ListGroupStatsResponse.fromJson(o.toJson()); |
| 481 checkListGroupStatsResponse(od); | 523 checkListGroupStatsResponse(od); |
| 482 }); | 524 }); |
| 483 }); | 525 }); |
| 484 | 526 |
| 485 | 527 |
| 528 unittest.group("obj-schema-ReportErrorEventResponse", () { |
| 529 unittest.test("to-json--from-json", () { |
| 530 var o = buildReportErrorEventResponse(); |
| 531 var od = new api.ReportErrorEventResponse.fromJson(o.toJson()); |
| 532 checkReportErrorEventResponse(od); |
| 533 }); |
| 534 }); |
| 535 |
| 536 |
| 537 unittest.group("obj-schema-ReportedErrorEvent", () { |
| 538 unittest.test("to-json--from-json", () { |
| 539 var o = buildReportedErrorEvent(); |
| 540 var od = new api.ReportedErrorEvent.fromJson(o.toJson()); |
| 541 checkReportedErrorEvent(od); |
| 542 }); |
| 543 }); |
| 544 |
| 545 |
| 486 unittest.group("obj-schema-ServiceContext", () { | 546 unittest.group("obj-schema-ServiceContext", () { |
| 487 unittest.test("to-json--from-json", () { | 547 unittest.test("to-json--from-json", () { |
| 488 var o = buildServiceContext(); | 548 var o = buildServiceContext(); |
| 489 var od = new api.ServiceContext.fromJson(o.toJson()); | 549 var od = new api.ServiceContext.fromJson(o.toJson()); |
| 490 checkServiceContext(od); | 550 checkServiceContext(od); |
| 491 }); | 551 }); |
| 492 }); | 552 }); |
| 493 | 553 |
| 494 | 554 |
| 495 unittest.group("obj-schema-SourceLocation", () { | 555 unittest.group("obj-schema-SourceLocation", () { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 "content-type" : "application/json; charset=utf-8", | 679 "content-type" : "application/json; charset=utf-8", |
| 620 }; | 680 }; |
| 621 var resp = convert.JSON.encode(buildListEventsResponse()); | 681 var resp = convert.JSON.encode(buildListEventsResponse()); |
| 622 return new async.Future.value(stringResponse(200, h, resp)); | 682 return new async.Future.value(stringResponse(200, h, resp)); |
| 623 }), true); | 683 }), true); |
| 624 res.list(arg_projectName, timeRange_period: arg_timeRange_period, serviceF
ilter_service: arg_serviceFilter_service, groupId: arg_groupId, serviceFilter_ve
rsion: arg_serviceFilter_version, pageSize: arg_pageSize, pageToken: arg_pageTok
en).then(unittest.expectAsync(((api.ListEventsResponse response) { | 684 res.list(arg_projectName, timeRange_period: arg_timeRange_period, serviceF
ilter_service: arg_serviceFilter_service, groupId: arg_groupId, serviceFilter_ve
rsion: arg_serviceFilter_version, pageSize: arg_pageSize, pageToken: arg_pageTok
en).then(unittest.expectAsync(((api.ListEventsResponse response) { |
| 625 checkListEventsResponse(response); | 685 checkListEventsResponse(response); |
| 626 }))); | 686 }))); |
| 627 }); | 687 }); |
| 628 | 688 |
| 689 unittest.test("method--report", () { |
| 690 |
| 691 var mock = new HttpServerMock(); |
| 692 api.ProjectsEventsResourceApi res = new api.ClouderrorreportingApi(mock).p
rojects.events; |
| 693 var arg_request = buildReportedErrorEvent(); |
| 694 var arg_projectName = "foo"; |
| 695 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 696 var obj = new api.ReportedErrorEvent.fromJson(json); |
| 697 checkReportedErrorEvent(obj); |
| 698 |
| 699 var path = (req.url).path; |
| 700 var pathOffset = 0; |
| 701 var index; |
| 702 var subPart; |
| 703 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 704 pathOffset += 1; |
| 705 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 706 pathOffset += 8; |
| 707 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 708 |
| 709 var query = (req.url).query; |
| 710 var queryOffset = 0; |
| 711 var queryMap = {}; |
| 712 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 713 parseBool(n) { |
| 714 if (n == "true") return true; |
| 715 if (n == "false") return false; |
| 716 if (n == null) return null; |
| 717 throw new core.ArgumentError("Invalid boolean: $n"); |
| 718 } |
| 719 if (query.length > 0) { |
| 720 for (var part in query.split("&")) { |
| 721 var keyvalue = part.split("="); |
| 722 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 723 } |
| 724 } |
| 725 |
| 726 |
| 727 var h = { |
| 728 "content-type" : "application/json; charset=utf-8", |
| 729 }; |
| 730 var resp = convert.JSON.encode(buildReportErrorEventResponse()); |
| 731 return new async.Future.value(stringResponse(200, h, resp)); |
| 732 }), true); |
| 733 res.report(arg_request, arg_projectName).then(unittest.expectAsync(((api.R
eportErrorEventResponse response) { |
| 734 checkReportErrorEventResponse(response); |
| 735 }))); |
| 736 }); |
| 737 |
| 629 }); | 738 }); |
| 630 | 739 |
| 631 | 740 |
| 632 unittest.group("resource-ProjectsGroupStatsResourceApi", () { | 741 unittest.group("resource-ProjectsGroupStatsResourceApi", () { |
| 633 unittest.test("method--list", () { | 742 unittest.test("method--list", () { |
| 634 | 743 |
| 635 var mock = new HttpServerMock(); | 744 var mock = new HttpServerMock(); |
| 636 api.ProjectsGroupStatsResourceApi res = new api.ClouderrorreportingApi(moc
k).projects.groupStats; | 745 api.ProjectsGroupStatsResourceApi res = new api.ClouderrorreportingApi(moc
k).projects.groupStats; |
| 637 var arg_projectName = "foo"; | 746 var arg_projectName = "foo"; |
| 638 var arg_alignment = "foo"; | 747 var arg_alignment = "foo"; |
| 639 var arg_timeRange_period = "foo"; | 748 var arg_timeRange_period = "foo"; |
| 640 var arg_order = "foo"; | 749 var arg_order = "foo"; |
| 641 var arg_groupId = buildUnnamed3048(); | 750 var arg_groupId = buildUnnamed3283(); |
| 642 var arg_serviceFilter_service = "foo"; | 751 var arg_serviceFilter_service = "foo"; |
| 643 var arg_alignmentTime = "foo"; | 752 var arg_alignmentTime = "foo"; |
| 644 var arg_serviceFilter_version = "foo"; | 753 var arg_serviceFilter_version = "foo"; |
| 645 var arg_pageSize = 42; | 754 var arg_pageSize = 42; |
| 646 var arg_timedCountDuration = "foo"; | 755 var arg_timedCountDuration = "foo"; |
| 647 var arg_pageToken = "foo"; | 756 var arg_pageToken = "foo"; |
| 648 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 757 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 649 var path = (req.url).path; | 758 var path = (req.url).path; |
| 650 var pathOffset = 0; | 759 var pathOffset = 0; |
| 651 var index; | 760 var index; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 res.update(arg_request, arg_name).then(unittest.expectAsync(((api.ErrorGro
up response) { | 900 res.update(arg_request, arg_name).then(unittest.expectAsync(((api.ErrorGro
up response) { |
| 792 checkErrorGroup(response); | 901 checkErrorGroup(response); |
| 793 }))); | 902 }))); |
| 794 }); | 903 }); |
| 795 | 904 |
| 796 }); | 905 }); |
| 797 | 906 |
| 798 | 907 |
| 799 } | 908 } |
| 800 | 909 |
| OLD | NEW |