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