| library googleapis.dataproc.v1.test; |
| |
| import "dart:core" as core; |
| import "dart:collection" as collection; |
| import "dart:async" as async; |
| import "dart:convert" as convert; |
| |
| import 'package:http/http.dart' as http; |
| import 'package:http/testing.dart' as http_testing; |
| import 'package:unittest/unittest.dart' as unittest; |
| |
| import 'package:googleapis/dataproc/v1.dart' as api; |
| |
| class HttpServerMock extends http.BaseClient { |
| core.Function _callback; |
| core.bool _expectJson; |
| |
| void register(core.Function callback, core.bool expectJson) { |
| _callback = callback; |
| _expectJson = expectJson; |
| } |
| |
| async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| if (_expectJson) { |
| return request.finalize() |
| .transform(convert.UTF8.decoder) |
| .join('') |
| .then((core.String jsonString) { |
| if (jsonString.isEmpty) { |
| return _callback(request, null); |
| } else { |
| return _callback(request, convert.JSON.decode(jsonString)); |
| } |
| }); |
| } else { |
| var stream = request.finalize(); |
| if (stream == null) { |
| return _callback(request, []); |
| } else { |
| return stream.toBytes().then((data) { |
| return _callback(request, data); |
| }); |
| } |
| } |
| } |
| } |
| |
| http.StreamedResponse stringResponse( |
| core.int status, core.Map headers, core.String body) { |
| var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| return new http.StreamedResponse(stream, status, headers: headers); |
| } |
| |
| core.int buildCounterCancelJobRequest = 0; |
| buildCancelJobRequest() { |
| var o = new api.CancelJobRequest(); |
| buildCounterCancelJobRequest++; |
| if (buildCounterCancelJobRequest < 3) { |
| } |
| buildCounterCancelJobRequest--; |
| return o; |
| } |
| |
| checkCancelJobRequest(api.CancelJobRequest o) { |
| buildCounterCancelJobRequest++; |
| if (buildCounterCancelJobRequest < 3) { |
| } |
| buildCounterCancelJobRequest--; |
| } |
| |
| buildUnnamed427() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed427(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed428() { |
| var o = new core.List<api.ClusterStatus>(); |
| o.add(buildClusterStatus()); |
| o.add(buildClusterStatus()); |
| return o; |
| } |
| |
| checkUnnamed428(core.List<api.ClusterStatus> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkClusterStatus(o[0]); |
| checkClusterStatus(o[1]); |
| } |
| |
| core.int buildCounterCluster = 0; |
| buildCluster() { |
| var o = new api.Cluster(); |
| buildCounterCluster++; |
| if (buildCounterCluster < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| o.config = buildClusterConfig(); |
| o.labels = buildUnnamed427(); |
| o.metrics = buildClusterMetrics(); |
| o.projectId = "foo"; |
| o.status = buildClusterStatus(); |
| o.statusHistory = buildUnnamed428(); |
| } |
| buildCounterCluster--; |
| return o; |
| } |
| |
| checkCluster(api.Cluster o) { |
| buildCounterCluster++; |
| if (buildCounterCluster < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| checkClusterConfig(o.config); |
| checkUnnamed427(o.labels); |
| checkClusterMetrics(o.metrics); |
| unittest.expect(o.projectId, unittest.equals('foo')); |
| checkClusterStatus(o.status); |
| checkUnnamed428(o.statusHistory); |
| } |
| buildCounterCluster--; |
| } |
| |
| buildUnnamed429() { |
| var o = new core.List<api.NodeInitializationAction>(); |
| o.add(buildNodeInitializationAction()); |
| o.add(buildNodeInitializationAction()); |
| return o; |
| } |
| |
| checkUnnamed429(core.List<api.NodeInitializationAction> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkNodeInitializationAction(o[0]); |
| checkNodeInitializationAction(o[1]); |
| } |
| |
| core.int buildCounterClusterConfig = 0; |
| buildClusterConfig() { |
| var o = new api.ClusterConfig(); |
| buildCounterClusterConfig++; |
| if (buildCounterClusterConfig < 3) { |
| o.configBucket = "foo"; |
| o.gceClusterConfig = buildGceClusterConfig(); |
| o.initializationActions = buildUnnamed429(); |
| o.masterConfig = buildInstanceGroupConfig(); |
| o.secondaryWorkerConfig = buildInstanceGroupConfig(); |
| o.softwareConfig = buildSoftwareConfig(); |
| o.workerConfig = buildInstanceGroupConfig(); |
| } |
| buildCounterClusterConfig--; |
| return o; |
| } |
| |
| checkClusterConfig(api.ClusterConfig o) { |
| buildCounterClusterConfig++; |
| if (buildCounterClusterConfig < 3) { |
| unittest.expect(o.configBucket, unittest.equals('foo')); |
| checkGceClusterConfig(o.gceClusterConfig); |
| checkUnnamed429(o.initializationActions); |
| checkInstanceGroupConfig(o.masterConfig); |
| checkInstanceGroupConfig(o.secondaryWorkerConfig); |
| checkSoftwareConfig(o.softwareConfig); |
| checkInstanceGroupConfig(o.workerConfig); |
| } |
| buildCounterClusterConfig--; |
| } |
| |
| buildUnnamed430() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed430(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed431() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed431(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterClusterMetrics = 0; |
| buildClusterMetrics() { |
| var o = new api.ClusterMetrics(); |
| buildCounterClusterMetrics++; |
| if (buildCounterClusterMetrics < 3) { |
| o.hdfsMetrics = buildUnnamed430(); |
| o.yarnMetrics = buildUnnamed431(); |
| } |
| buildCounterClusterMetrics--; |
| return o; |
| } |
| |
| checkClusterMetrics(api.ClusterMetrics o) { |
| buildCounterClusterMetrics++; |
| if (buildCounterClusterMetrics < 3) { |
| checkUnnamed430(o.hdfsMetrics); |
| checkUnnamed431(o.yarnMetrics); |
| } |
| buildCounterClusterMetrics--; |
| } |
| |
| buildUnnamed432() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed432(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed433() { |
| var o = new core.List<api.ClusterOperationStatus>(); |
| o.add(buildClusterOperationStatus()); |
| o.add(buildClusterOperationStatus()); |
| return o; |
| } |
| |
| checkUnnamed433(core.List<api.ClusterOperationStatus> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkClusterOperationStatus(o[0]); |
| checkClusterOperationStatus(o[1]); |
| } |
| |
| core.int buildCounterClusterOperationMetadata = 0; |
| buildClusterOperationMetadata() { |
| var o = new api.ClusterOperationMetadata(); |
| buildCounterClusterOperationMetadata++; |
| if (buildCounterClusterOperationMetadata < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| o.description = "foo"; |
| o.labels = buildUnnamed432(); |
| o.operationType = "foo"; |
| o.status = buildClusterOperationStatus(); |
| o.statusHistory = buildUnnamed433(); |
| } |
| buildCounterClusterOperationMetadata--; |
| return o; |
| } |
| |
| checkClusterOperationMetadata(api.ClusterOperationMetadata o) { |
| buildCounterClusterOperationMetadata++; |
| if (buildCounterClusterOperationMetadata < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| unittest.expect(o.description, unittest.equals('foo')); |
| checkUnnamed432(o.labels); |
| unittest.expect(o.operationType, unittest.equals('foo')); |
| checkClusterOperationStatus(o.status); |
| checkUnnamed433(o.statusHistory); |
| } |
| buildCounterClusterOperationMetadata--; |
| } |
| |
| core.int buildCounterClusterOperationStatus = 0; |
| buildClusterOperationStatus() { |
| var o = new api.ClusterOperationStatus(); |
| buildCounterClusterOperationStatus++; |
| if (buildCounterClusterOperationStatus < 3) { |
| o.details = "foo"; |
| o.innerState = "foo"; |
| o.state = "foo"; |
| o.stateStartTime = "foo"; |
| } |
| buildCounterClusterOperationStatus--; |
| return o; |
| } |
| |
| checkClusterOperationStatus(api.ClusterOperationStatus o) { |
| buildCounterClusterOperationStatus++; |
| if (buildCounterClusterOperationStatus < 3) { |
| unittest.expect(o.details, unittest.equals('foo')); |
| unittest.expect(o.innerState, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateStartTime, unittest.equals('foo')); |
| } |
| buildCounterClusterOperationStatus--; |
| } |
| |
| core.int buildCounterClusterStatus = 0; |
| buildClusterStatus() { |
| var o = new api.ClusterStatus(); |
| buildCounterClusterStatus++; |
| if (buildCounterClusterStatus < 3) { |
| o.detail = "foo"; |
| o.state = "foo"; |
| o.stateStartTime = "foo"; |
| } |
| buildCounterClusterStatus--; |
| return o; |
| } |
| |
| checkClusterStatus(api.ClusterStatus o) { |
| buildCounterClusterStatus++; |
| if (buildCounterClusterStatus < 3) { |
| unittest.expect(o.detail, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateStartTime, unittest.equals('foo')); |
| } |
| buildCounterClusterStatus--; |
| } |
| |
| core.int buildCounterDiagnoseClusterOutputLocation = 0; |
| buildDiagnoseClusterOutputLocation() { |
| var o = new api.DiagnoseClusterOutputLocation(); |
| buildCounterDiagnoseClusterOutputLocation++; |
| if (buildCounterDiagnoseClusterOutputLocation < 3) { |
| o.outputUri = "foo"; |
| } |
| buildCounterDiagnoseClusterOutputLocation--; |
| return o; |
| } |
| |
| checkDiagnoseClusterOutputLocation(api.DiagnoseClusterOutputLocation o) { |
| buildCounterDiagnoseClusterOutputLocation++; |
| if (buildCounterDiagnoseClusterOutputLocation < 3) { |
| unittest.expect(o.outputUri, unittest.equals('foo')); |
| } |
| buildCounterDiagnoseClusterOutputLocation--; |
| } |
| |
| core.int buildCounterDiagnoseClusterRequest = 0; |
| buildDiagnoseClusterRequest() { |
| var o = new api.DiagnoseClusterRequest(); |
| buildCounterDiagnoseClusterRequest++; |
| if (buildCounterDiagnoseClusterRequest < 3) { |
| } |
| buildCounterDiagnoseClusterRequest--; |
| return o; |
| } |
| |
| checkDiagnoseClusterRequest(api.DiagnoseClusterRequest o) { |
| buildCounterDiagnoseClusterRequest++; |
| if (buildCounterDiagnoseClusterRequest < 3) { |
| } |
| buildCounterDiagnoseClusterRequest--; |
| } |
| |
| core.int buildCounterDiagnoseClusterResults = 0; |
| buildDiagnoseClusterResults() { |
| var o = new api.DiagnoseClusterResults(); |
| buildCounterDiagnoseClusterResults++; |
| if (buildCounterDiagnoseClusterResults < 3) { |
| o.outputUri = "foo"; |
| } |
| buildCounterDiagnoseClusterResults--; |
| return o; |
| } |
| |
| checkDiagnoseClusterResults(api.DiagnoseClusterResults o) { |
| buildCounterDiagnoseClusterResults++; |
| if (buildCounterDiagnoseClusterResults < 3) { |
| unittest.expect(o.outputUri, unittest.equals('foo')); |
| } |
| buildCounterDiagnoseClusterResults--; |
| } |
| |
| core.int buildCounterDiskConfig = 0; |
| buildDiskConfig() { |
| var o = new api.DiskConfig(); |
| buildCounterDiskConfig++; |
| if (buildCounterDiskConfig < 3) { |
| o.bootDiskSizeGb = 42; |
| o.numLocalSsds = 42; |
| } |
| buildCounterDiskConfig--; |
| return o; |
| } |
| |
| checkDiskConfig(api.DiskConfig o) { |
| buildCounterDiskConfig++; |
| if (buildCounterDiskConfig < 3) { |
| unittest.expect(o.bootDiskSizeGb, unittest.equals(42)); |
| unittest.expect(o.numLocalSsds, unittest.equals(42)); |
| } |
| buildCounterDiskConfig--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| buildEmpty() { |
| var o = new api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) { |
| } |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) { |
| } |
| buildCounterEmpty--; |
| } |
| |
| buildUnnamed434() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed434(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed435() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed435(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed436() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed436(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterGceClusterConfig = 0; |
| buildGceClusterConfig() { |
| var o = new api.GceClusterConfig(); |
| buildCounterGceClusterConfig++; |
| if (buildCounterGceClusterConfig < 3) { |
| o.internalIpOnly = true; |
| o.metadata = buildUnnamed434(); |
| o.networkUri = "foo"; |
| o.serviceAccountScopes = buildUnnamed435(); |
| o.subnetworkUri = "foo"; |
| o.tags = buildUnnamed436(); |
| o.zoneUri = "foo"; |
| } |
| buildCounterGceClusterConfig--; |
| return o; |
| } |
| |
| checkGceClusterConfig(api.GceClusterConfig o) { |
| buildCounterGceClusterConfig++; |
| if (buildCounterGceClusterConfig < 3) { |
| unittest.expect(o.internalIpOnly, unittest.isTrue); |
| checkUnnamed434(o.metadata); |
| unittest.expect(o.networkUri, unittest.equals('foo')); |
| checkUnnamed435(o.serviceAccountScopes); |
| unittest.expect(o.subnetworkUri, unittest.equals('foo')); |
| checkUnnamed436(o.tags); |
| unittest.expect(o.zoneUri, unittest.equals('foo')); |
| } |
| buildCounterGceClusterConfig--; |
| } |
| |
| buildUnnamed437() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed437(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed438() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed438(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed439() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed439(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed440() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed440(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed441() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed441(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterHadoopJob = 0; |
| buildHadoopJob() { |
| var o = new api.HadoopJob(); |
| buildCounterHadoopJob++; |
| if (buildCounterHadoopJob < 3) { |
| o.archiveUris = buildUnnamed437(); |
| o.args = buildUnnamed438(); |
| o.fileUris = buildUnnamed439(); |
| o.jarFileUris = buildUnnamed440(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.mainClass = "foo"; |
| o.mainJarFileUri = "foo"; |
| o.properties = buildUnnamed441(); |
| } |
| buildCounterHadoopJob--; |
| return o; |
| } |
| |
| checkHadoopJob(api.HadoopJob o) { |
| buildCounterHadoopJob++; |
| if (buildCounterHadoopJob < 3) { |
| checkUnnamed437(o.archiveUris); |
| checkUnnamed438(o.args); |
| checkUnnamed439(o.fileUris); |
| checkUnnamed440(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.mainClass, unittest.equals('foo')); |
| unittest.expect(o.mainJarFileUri, unittest.equals('foo')); |
| checkUnnamed441(o.properties); |
| } |
| buildCounterHadoopJob--; |
| } |
| |
| buildUnnamed442() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed442(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed443() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed443(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed444() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed444(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterHiveJob = 0; |
| buildHiveJob() { |
| var o = new api.HiveJob(); |
| buildCounterHiveJob++; |
| if (buildCounterHiveJob < 3) { |
| o.continueOnFailure = true; |
| o.jarFileUris = buildUnnamed442(); |
| o.properties = buildUnnamed443(); |
| o.queryFileUri = "foo"; |
| o.queryList = buildQueryList(); |
| o.scriptVariables = buildUnnamed444(); |
| } |
| buildCounterHiveJob--; |
| return o; |
| } |
| |
| checkHiveJob(api.HiveJob o) { |
| buildCounterHiveJob++; |
| if (buildCounterHiveJob < 3) { |
| unittest.expect(o.continueOnFailure, unittest.isTrue); |
| checkUnnamed442(o.jarFileUris); |
| checkUnnamed443(o.properties); |
| unittest.expect(o.queryFileUri, unittest.equals('foo')); |
| checkQueryList(o.queryList); |
| checkUnnamed444(o.scriptVariables); |
| } |
| buildCounterHiveJob--; |
| } |
| |
| buildUnnamed445() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed445(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterInstanceGroupConfig = 0; |
| buildInstanceGroupConfig() { |
| var o = new api.InstanceGroupConfig(); |
| buildCounterInstanceGroupConfig++; |
| if (buildCounterInstanceGroupConfig < 3) { |
| o.diskConfig = buildDiskConfig(); |
| o.imageUri = "foo"; |
| o.instanceNames = buildUnnamed445(); |
| o.isPreemptible = true; |
| o.machineTypeUri = "foo"; |
| o.managedGroupConfig = buildManagedGroupConfig(); |
| o.numInstances = 42; |
| } |
| buildCounterInstanceGroupConfig--; |
| return o; |
| } |
| |
| checkInstanceGroupConfig(api.InstanceGroupConfig o) { |
| buildCounterInstanceGroupConfig++; |
| if (buildCounterInstanceGroupConfig < 3) { |
| checkDiskConfig(o.diskConfig); |
| unittest.expect(o.imageUri, unittest.equals('foo')); |
| checkUnnamed445(o.instanceNames); |
| unittest.expect(o.isPreemptible, unittest.isTrue); |
| unittest.expect(o.machineTypeUri, unittest.equals('foo')); |
| checkManagedGroupConfig(o.managedGroupConfig); |
| unittest.expect(o.numInstances, unittest.equals(42)); |
| } |
| buildCounterInstanceGroupConfig--; |
| } |
| |
| buildUnnamed446() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed446(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed447() { |
| var o = new core.List<api.JobStatus>(); |
| o.add(buildJobStatus()); |
| o.add(buildJobStatus()); |
| return o; |
| } |
| |
| checkUnnamed447(core.List<api.JobStatus> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkJobStatus(o[0]); |
| checkJobStatus(o[1]); |
| } |
| |
| buildUnnamed448() { |
| var o = new core.List<api.YarnApplication>(); |
| o.add(buildYarnApplication()); |
| o.add(buildYarnApplication()); |
| return o; |
| } |
| |
| checkUnnamed448(core.List<api.YarnApplication> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkYarnApplication(o[0]); |
| checkYarnApplication(o[1]); |
| } |
| |
| core.int buildCounterJob = 0; |
| buildJob() { |
| var o = new api.Job(); |
| buildCounterJob++; |
| if (buildCounterJob < 3) { |
| o.driverControlFilesUri = "foo"; |
| o.driverOutputResourceUri = "foo"; |
| o.hadoopJob = buildHadoopJob(); |
| o.hiveJob = buildHiveJob(); |
| o.labels = buildUnnamed446(); |
| o.pigJob = buildPigJob(); |
| o.placement = buildJobPlacement(); |
| o.pysparkJob = buildPySparkJob(); |
| o.reference = buildJobReference(); |
| o.sparkJob = buildSparkJob(); |
| o.sparkSqlJob = buildSparkSqlJob(); |
| o.status = buildJobStatus(); |
| o.statusHistory = buildUnnamed447(); |
| o.yarnApplications = buildUnnamed448(); |
| } |
| buildCounterJob--; |
| return o; |
| } |
| |
| checkJob(api.Job o) { |
| buildCounterJob++; |
| if (buildCounterJob < 3) { |
| unittest.expect(o.driverControlFilesUri, unittest.equals('foo')); |
| unittest.expect(o.driverOutputResourceUri, unittest.equals('foo')); |
| checkHadoopJob(o.hadoopJob); |
| checkHiveJob(o.hiveJob); |
| checkUnnamed446(o.labels); |
| checkPigJob(o.pigJob); |
| checkJobPlacement(o.placement); |
| checkPySparkJob(o.pysparkJob); |
| checkJobReference(o.reference); |
| checkSparkJob(o.sparkJob); |
| checkSparkSqlJob(o.sparkSqlJob); |
| checkJobStatus(o.status); |
| checkUnnamed447(o.statusHistory); |
| checkUnnamed448(o.yarnApplications); |
| } |
| buildCounterJob--; |
| } |
| |
| core.int buildCounterJobPlacement = 0; |
| buildJobPlacement() { |
| var o = new api.JobPlacement(); |
| buildCounterJobPlacement++; |
| if (buildCounterJobPlacement < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| } |
| buildCounterJobPlacement--; |
| return o; |
| } |
| |
| checkJobPlacement(api.JobPlacement o) { |
| buildCounterJobPlacement++; |
| if (buildCounterJobPlacement < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| } |
| buildCounterJobPlacement--; |
| } |
| |
| core.int buildCounterJobReference = 0; |
| buildJobReference() { |
| var o = new api.JobReference(); |
| buildCounterJobReference++; |
| if (buildCounterJobReference < 3) { |
| o.jobId = "foo"; |
| o.projectId = "foo"; |
| } |
| buildCounterJobReference--; |
| return o; |
| } |
| |
| checkJobReference(api.JobReference o) { |
| buildCounterJobReference++; |
| if (buildCounterJobReference < 3) { |
| unittest.expect(o.jobId, unittest.equals('foo')); |
| unittest.expect(o.projectId, unittest.equals('foo')); |
| } |
| buildCounterJobReference--; |
| } |
| |
| core.int buildCounterJobStatus = 0; |
| buildJobStatus() { |
| var o = new api.JobStatus(); |
| buildCounterJobStatus++; |
| if (buildCounterJobStatus < 3) { |
| o.details = "foo"; |
| o.state = "foo"; |
| o.stateStartTime = "foo"; |
| } |
| buildCounterJobStatus--; |
| return o; |
| } |
| |
| checkJobStatus(api.JobStatus o) { |
| buildCounterJobStatus++; |
| if (buildCounterJobStatus < 3) { |
| unittest.expect(o.details, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateStartTime, unittest.equals('foo')); |
| } |
| buildCounterJobStatus--; |
| } |
| |
| buildUnnamed449() { |
| var o = new core.List<api.Cluster>(); |
| o.add(buildCluster()); |
| o.add(buildCluster()); |
| return o; |
| } |
| |
| checkUnnamed449(core.List<api.Cluster> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCluster(o[0]); |
| checkCluster(o[1]); |
| } |
| |
| core.int buildCounterListClustersResponse = 0; |
| buildListClustersResponse() { |
| var o = new api.ListClustersResponse(); |
| buildCounterListClustersResponse++; |
| if (buildCounterListClustersResponse < 3) { |
| o.clusters = buildUnnamed449(); |
| o.nextPageToken = "foo"; |
| } |
| buildCounterListClustersResponse--; |
| return o; |
| } |
| |
| checkListClustersResponse(api.ListClustersResponse o) { |
| buildCounterListClustersResponse++; |
| if (buildCounterListClustersResponse < 3) { |
| checkUnnamed449(o.clusters); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListClustersResponse--; |
| } |
| |
| buildUnnamed450() { |
| var o = new core.List<api.Job>(); |
| o.add(buildJob()); |
| o.add(buildJob()); |
| return o; |
| } |
| |
| checkUnnamed450(core.List<api.Job> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkJob(o[0]); |
| checkJob(o[1]); |
| } |
| |
| core.int buildCounterListJobsResponse = 0; |
| buildListJobsResponse() { |
| var o = new api.ListJobsResponse(); |
| buildCounterListJobsResponse++; |
| if (buildCounterListJobsResponse < 3) { |
| o.jobs = buildUnnamed450(); |
| o.nextPageToken = "foo"; |
| } |
| buildCounterListJobsResponse--; |
| return o; |
| } |
| |
| checkListJobsResponse(api.ListJobsResponse o) { |
| buildCounterListJobsResponse++; |
| if (buildCounterListJobsResponse < 3) { |
| checkUnnamed450(o.jobs); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListJobsResponse--; |
| } |
| |
| buildUnnamed451() { |
| var o = new core.List<api.Operation>(); |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| checkUnnamed451(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| buildListOperationsResponse() { |
| var o = new api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = "foo"; |
| o.operations = buildUnnamed451(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed451(o.operations); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| buildUnnamed452() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed452(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterLoggingConfig = 0; |
| buildLoggingConfig() { |
| var o = new api.LoggingConfig(); |
| buildCounterLoggingConfig++; |
| if (buildCounterLoggingConfig < 3) { |
| o.driverLogLevels = buildUnnamed452(); |
| } |
| buildCounterLoggingConfig--; |
| return o; |
| } |
| |
| checkLoggingConfig(api.LoggingConfig o) { |
| buildCounterLoggingConfig++; |
| if (buildCounterLoggingConfig < 3) { |
| checkUnnamed452(o.driverLogLevels); |
| } |
| buildCounterLoggingConfig--; |
| } |
| |
| core.int buildCounterManagedGroupConfig = 0; |
| buildManagedGroupConfig() { |
| var o = new api.ManagedGroupConfig(); |
| buildCounterManagedGroupConfig++; |
| if (buildCounterManagedGroupConfig < 3) { |
| o.instanceGroupManagerName = "foo"; |
| o.instanceTemplateName = "foo"; |
| } |
| buildCounterManagedGroupConfig--; |
| return o; |
| } |
| |
| checkManagedGroupConfig(api.ManagedGroupConfig o) { |
| buildCounterManagedGroupConfig++; |
| if (buildCounterManagedGroupConfig < 3) { |
| unittest.expect(o.instanceGroupManagerName, unittest.equals('foo')); |
| unittest.expect(o.instanceTemplateName, unittest.equals('foo')); |
| } |
| buildCounterManagedGroupConfig--; |
| } |
| |
| core.int buildCounterNodeInitializationAction = 0; |
| buildNodeInitializationAction() { |
| var o = new api.NodeInitializationAction(); |
| buildCounterNodeInitializationAction++; |
| if (buildCounterNodeInitializationAction < 3) { |
| o.executableFile = "foo"; |
| o.executionTimeout = "foo"; |
| } |
| buildCounterNodeInitializationAction--; |
| return o; |
| } |
| |
| checkNodeInitializationAction(api.NodeInitializationAction o) { |
| buildCounterNodeInitializationAction++; |
| if (buildCounterNodeInitializationAction < 3) { |
| unittest.expect(o.executableFile, unittest.equals('foo')); |
| unittest.expect(o.executionTimeout, unittest.equals('foo')); |
| } |
| buildCounterNodeInitializationAction--; |
| } |
| |
| buildUnnamed453() { |
| var o = new core.Map<core.String, core.Object>(); |
| o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| return o; |
| } |
| |
| checkUnnamed453(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLength(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo')); |
| var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLength(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed454() { |
| var o = new core.Map<core.String, core.Object>(); |
| o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| return o; |
| } |
| |
| checkUnnamed454(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLength(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo')); |
| var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLength(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.expect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterOperation = 0; |
| buildOperation() { |
| var o = new api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed453(); |
| o.name = "foo"; |
| o.response = buildUnnamed454(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| checkStatus(o.error); |
| checkUnnamed453(o.metadata); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed454(o.response); |
| } |
| buildCounterOperation--; |
| } |
| |
| buildUnnamed455() { |
| var o = new core.List<api.OperationStatus>(); |
| o.add(buildOperationStatus()); |
| o.add(buildOperationStatus()); |
| return o; |
| } |
| |
| checkUnnamed455(core.List<api.OperationStatus> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperationStatus(o[0]); |
| checkOperationStatus(o[1]); |
| } |
| |
| core.int buildCounterOperationMetadata = 0; |
| buildOperationMetadata() { |
| var o = new api.OperationMetadata(); |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| o.description = "foo"; |
| o.details = "foo"; |
| o.endTime = "foo"; |
| o.innerState = "foo"; |
| o.insertTime = "foo"; |
| o.operationType = "foo"; |
| o.startTime = "foo"; |
| o.state = "foo"; |
| o.status = buildOperationStatus(); |
| o.statusHistory = buildUnnamed455(); |
| } |
| buildCounterOperationMetadata--; |
| return o; |
| } |
| |
| checkOperationMetadata(api.OperationMetadata o) { |
| buildCounterOperationMetadata++; |
| if (buildCounterOperationMetadata < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| unittest.expect(o.description, unittest.equals('foo')); |
| unittest.expect(o.details, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.innerState, unittest.equals('foo')); |
| unittest.expect(o.insertTime, unittest.equals('foo')); |
| unittest.expect(o.operationType, unittest.equals('foo')); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| checkOperationStatus(o.status); |
| checkUnnamed455(o.statusHistory); |
| } |
| buildCounterOperationMetadata--; |
| } |
| |
| core.int buildCounterOperationStatus = 0; |
| buildOperationStatus() { |
| var o = new api.OperationStatus(); |
| buildCounterOperationStatus++; |
| if (buildCounterOperationStatus < 3) { |
| o.details = "foo"; |
| o.innerState = "foo"; |
| o.state = "foo"; |
| o.stateStartTime = "foo"; |
| } |
| buildCounterOperationStatus--; |
| return o; |
| } |
| |
| checkOperationStatus(api.OperationStatus o) { |
| buildCounterOperationStatus++; |
| if (buildCounterOperationStatus < 3) { |
| unittest.expect(o.details, unittest.equals('foo')); |
| unittest.expect(o.innerState, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateStartTime, unittest.equals('foo')); |
| } |
| buildCounterOperationStatus--; |
| } |
| |
| buildUnnamed456() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed456(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed457() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed457(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed458() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed458(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterPigJob = 0; |
| buildPigJob() { |
| var o = new api.PigJob(); |
| buildCounterPigJob++; |
| if (buildCounterPigJob < 3) { |
| o.continueOnFailure = true; |
| o.jarFileUris = buildUnnamed456(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.properties = buildUnnamed457(); |
| o.queryFileUri = "foo"; |
| o.queryList = buildQueryList(); |
| o.scriptVariables = buildUnnamed458(); |
| } |
| buildCounterPigJob--; |
| return o; |
| } |
| |
| checkPigJob(api.PigJob o) { |
| buildCounterPigJob++; |
| if (buildCounterPigJob < 3) { |
| unittest.expect(o.continueOnFailure, unittest.isTrue); |
| checkUnnamed456(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| checkUnnamed457(o.properties); |
| unittest.expect(o.queryFileUri, unittest.equals('foo')); |
| checkQueryList(o.queryList); |
| checkUnnamed458(o.scriptVariables); |
| } |
| buildCounterPigJob--; |
| } |
| |
| buildUnnamed459() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed459(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed460() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed460(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed461() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed461(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed462() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed462(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed463() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed463(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed464() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed464(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterPySparkJob = 0; |
| buildPySparkJob() { |
| var o = new api.PySparkJob(); |
| buildCounterPySparkJob++; |
| if (buildCounterPySparkJob < 3) { |
| o.archiveUris = buildUnnamed459(); |
| o.args = buildUnnamed460(); |
| o.fileUris = buildUnnamed461(); |
| o.jarFileUris = buildUnnamed462(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.mainPythonFileUri = "foo"; |
| o.properties = buildUnnamed463(); |
| o.pythonFileUris = buildUnnamed464(); |
| } |
| buildCounterPySparkJob--; |
| return o; |
| } |
| |
| checkPySparkJob(api.PySparkJob o) { |
| buildCounterPySparkJob++; |
| if (buildCounterPySparkJob < 3) { |
| checkUnnamed459(o.archiveUris); |
| checkUnnamed460(o.args); |
| checkUnnamed461(o.fileUris); |
| checkUnnamed462(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.mainPythonFileUri, unittest.equals('foo')); |
| checkUnnamed463(o.properties); |
| checkUnnamed464(o.pythonFileUris); |
| } |
| buildCounterPySparkJob--; |
| } |
| |
| buildUnnamed465() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed465(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterQueryList = 0; |
| buildQueryList() { |
| var o = new api.QueryList(); |
| buildCounterQueryList++; |
| if (buildCounterQueryList < 3) { |
| o.queries = buildUnnamed465(); |
| } |
| buildCounterQueryList--; |
| return o; |
| } |
| |
| checkQueryList(api.QueryList o) { |
| buildCounterQueryList++; |
| if (buildCounterQueryList < 3) { |
| checkUnnamed465(o.queries); |
| } |
| buildCounterQueryList--; |
| } |
| |
| buildUnnamed466() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed466(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterSoftwareConfig = 0; |
| buildSoftwareConfig() { |
| var o = new api.SoftwareConfig(); |
| buildCounterSoftwareConfig++; |
| if (buildCounterSoftwareConfig < 3) { |
| o.imageVersion = "foo"; |
| o.properties = buildUnnamed466(); |
| } |
| buildCounterSoftwareConfig--; |
| return o; |
| } |
| |
| checkSoftwareConfig(api.SoftwareConfig o) { |
| buildCounterSoftwareConfig++; |
| if (buildCounterSoftwareConfig < 3) { |
| unittest.expect(o.imageVersion, unittest.equals('foo')); |
| checkUnnamed466(o.properties); |
| } |
| buildCounterSoftwareConfig--; |
| } |
| |
| buildUnnamed467() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed467(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed468() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed468(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed469() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed469(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed470() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed470(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed471() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed471(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterSparkJob = 0; |
| buildSparkJob() { |
| var o = new api.SparkJob(); |
| buildCounterSparkJob++; |
| if (buildCounterSparkJob < 3) { |
| o.archiveUris = buildUnnamed467(); |
| o.args = buildUnnamed468(); |
| o.fileUris = buildUnnamed469(); |
| o.jarFileUris = buildUnnamed470(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.mainClass = "foo"; |
| o.mainJarFileUri = "foo"; |
| o.properties = buildUnnamed471(); |
| } |
| buildCounterSparkJob--; |
| return o; |
| } |
| |
| checkSparkJob(api.SparkJob o) { |
| buildCounterSparkJob++; |
| if (buildCounterSparkJob < 3) { |
| checkUnnamed467(o.archiveUris); |
| checkUnnamed468(o.args); |
| checkUnnamed469(o.fileUris); |
| checkUnnamed470(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.mainClass, unittest.equals('foo')); |
| unittest.expect(o.mainJarFileUri, unittest.equals('foo')); |
| checkUnnamed471(o.properties); |
| } |
| buildCounterSparkJob--; |
| } |
| |
| buildUnnamed472() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed472(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| buildUnnamed473() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed473(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed474() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed474(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o["x"], unittest.equals('foo')); |
| unittest.expect(o["y"], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterSparkSqlJob = 0; |
| buildSparkSqlJob() { |
| var o = new api.SparkSqlJob(); |
| buildCounterSparkSqlJob++; |
| if (buildCounterSparkSqlJob < 3) { |
| o.jarFileUris = buildUnnamed472(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.properties = buildUnnamed473(); |
| o.queryFileUri = "foo"; |
| o.queryList = buildQueryList(); |
| o.scriptVariables = buildUnnamed474(); |
| } |
| buildCounterSparkSqlJob--; |
| return o; |
| } |
| |
| checkSparkSqlJob(api.SparkSqlJob o) { |
| buildCounterSparkSqlJob++; |
| if (buildCounterSparkSqlJob < 3) { |
| checkUnnamed472(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| checkUnnamed473(o.properties); |
| unittest.expect(o.queryFileUri, unittest.equals('foo')); |
| checkQueryList(o.queryList); |
| checkUnnamed474(o.scriptVariables); |
| } |
| buildCounterSparkSqlJob--; |
| } |
| |
| buildUnnamed475() { |
| var o = new core.Map<core.String, core.Object>(); |
| o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| return o; |
| } |
| |
| checkUnnamed475(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLength(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.expect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], unittest.equals('foo')); |
| var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLength(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.expect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], unittest.equals('foo')); |
| } |
| |
| buildUnnamed476() { |
| var o = new core.List<core.Map<core.String, core.Object>>(); |
| o.add(buildUnnamed475()); |
| o.add(buildUnnamed475()); |
| return o; |
| } |
| |
| checkUnnamed476(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed475(o[0]); |
| checkUnnamed475(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| buildStatus() { |
| var o = new api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed476(); |
| o.message = "foo"; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code, unittest.equals(42)); |
| checkUnnamed476(o.details); |
| unittest.expect(o.message, unittest.equals('foo')); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterSubmitJobRequest = 0; |
| buildSubmitJobRequest() { |
| var o = new api.SubmitJobRequest(); |
| buildCounterSubmitJobRequest++; |
| if (buildCounterSubmitJobRequest < 3) { |
| o.job = buildJob(); |
| } |
| buildCounterSubmitJobRequest--; |
| return o; |
| } |
| |
| checkSubmitJobRequest(api.SubmitJobRequest o) { |
| buildCounterSubmitJobRequest++; |
| if (buildCounterSubmitJobRequest < 3) { |
| checkJob(o.job); |
| } |
| buildCounterSubmitJobRequest--; |
| } |
| |
| core.int buildCounterYarnApplication = 0; |
| buildYarnApplication() { |
| var o = new api.YarnApplication(); |
| buildCounterYarnApplication++; |
| if (buildCounterYarnApplication < 3) { |
| o.name = "foo"; |
| o.progress = 42.0; |
| o.state = "foo"; |
| o.trackingUrl = "foo"; |
| } |
| buildCounterYarnApplication--; |
| return o; |
| } |
| |
| checkYarnApplication(api.YarnApplication o) { |
| buildCounterYarnApplication++; |
| if (buildCounterYarnApplication < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.progress, unittest.equals(42.0)); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.trackingUrl, unittest.equals('foo')); |
| } |
| buildCounterYarnApplication--; |
| } |
| |
| |
| main() { |
| unittest.group("obj-schema-CancelJobRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCancelJobRequest(); |
| var od = new api.CancelJobRequest.fromJson(o.toJson()); |
| checkCancelJobRequest(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-Cluster", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCluster(); |
| var od = new api.Cluster.fromJson(o.toJson()); |
| checkCluster(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ClusterConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterConfig(); |
| var od = new api.ClusterConfig.fromJson(o.toJson()); |
| checkClusterConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ClusterMetrics", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterMetrics(); |
| var od = new api.ClusterMetrics.fromJson(o.toJson()); |
| checkClusterMetrics(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ClusterOperationMetadata", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterOperationMetadata(); |
| var od = new api.ClusterOperationMetadata.fromJson(o.toJson()); |
| checkClusterOperationMetadata(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ClusterOperationStatus", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterOperationStatus(); |
| var od = new api.ClusterOperationStatus.fromJson(o.toJson()); |
| checkClusterOperationStatus(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ClusterStatus", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterStatus(); |
| var od = new api.ClusterStatus.fromJson(o.toJson()); |
| checkClusterStatus(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-DiagnoseClusterOutputLocation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDiagnoseClusterOutputLocation(); |
| var od = new api.DiagnoseClusterOutputLocation.fromJson(o.toJson()); |
| checkDiagnoseClusterOutputLocation(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-DiagnoseClusterRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDiagnoseClusterRequest(); |
| var od = new api.DiagnoseClusterRequest.fromJson(o.toJson()); |
| checkDiagnoseClusterRequest(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-DiagnoseClusterResults", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDiagnoseClusterResults(); |
| var od = new api.DiagnoseClusterResults.fromJson(o.toJson()); |
| checkDiagnoseClusterResults(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-DiskConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDiskConfig(); |
| var od = new api.DiskConfig.fromJson(o.toJson()); |
| checkDiskConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-Empty", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildEmpty(); |
| var od = new api.Empty.fromJson(o.toJson()); |
| checkEmpty(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-GceClusterConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGceClusterConfig(); |
| var od = new api.GceClusterConfig.fromJson(o.toJson()); |
| checkGceClusterConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-HadoopJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildHadoopJob(); |
| var od = new api.HadoopJob.fromJson(o.toJson()); |
| checkHadoopJob(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-HiveJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildHiveJob(); |
| var od = new api.HiveJob.fromJson(o.toJson()); |
| checkHiveJob(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-InstanceGroupConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildInstanceGroupConfig(); |
| var od = new api.InstanceGroupConfig.fromJson(o.toJson()); |
| checkInstanceGroupConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-Job", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJob(); |
| var od = new api.Job.fromJson(o.toJson()); |
| checkJob(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-JobPlacement", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobPlacement(); |
| var od = new api.JobPlacement.fromJson(o.toJson()); |
| checkJobPlacement(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-JobReference", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobReference(); |
| var od = new api.JobReference.fromJson(o.toJson()); |
| checkJobReference(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-JobStatus", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobStatus(); |
| var od = new api.JobStatus.fromJson(o.toJson()); |
| checkJobStatus(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ListClustersResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListClustersResponse(); |
| var od = new api.ListClustersResponse.fromJson(o.toJson()); |
| checkListClustersResponse(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ListJobsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListJobsResponse(); |
| var od = new api.ListJobsResponse.fromJson(o.toJson()); |
| checkListJobsResponse(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ListOperationsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListOperationsResponse(); |
| var od = new api.ListOperationsResponse.fromJson(o.toJson()); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-LoggingConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildLoggingConfig(); |
| var od = new api.LoggingConfig.fromJson(o.toJson()); |
| checkLoggingConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-ManagedGroupConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildManagedGroupConfig(); |
| var od = new api.ManagedGroupConfig.fromJson(o.toJson()); |
| checkManagedGroupConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-NodeInitializationAction", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildNodeInitializationAction(); |
| var od = new api.NodeInitializationAction.fromJson(o.toJson()); |
| checkNodeInitializationAction(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-Operation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOperation(); |
| var od = new api.Operation.fromJson(o.toJson()); |
| checkOperation(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-OperationMetadata", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOperationMetadata(); |
| var od = new api.OperationMetadata.fromJson(o.toJson()); |
| checkOperationMetadata(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-OperationStatus", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOperationStatus(); |
| var od = new api.OperationStatus.fromJson(o.toJson()); |
| checkOperationStatus(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PigJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPigJob(); |
| var od = new api.PigJob.fromJson(o.toJson()); |
| checkPigJob(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-PySparkJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPySparkJob(); |
| var od = new api.PySparkJob.fromJson(o.toJson()); |
| checkPySparkJob(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-QueryList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildQueryList(); |
| var od = new api.QueryList.fromJson(o.toJson()); |
| checkQueryList(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-SoftwareConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSoftwareConfig(); |
| var od = new api.SoftwareConfig.fromJson(o.toJson()); |
| checkSoftwareConfig(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-SparkJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSparkJob(); |
| var od = new api.SparkJob.fromJson(o.toJson()); |
| checkSparkJob(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-SparkSqlJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSparkSqlJob(); |
| var od = new api.SparkSqlJob.fromJson(o.toJson()); |
| checkSparkSqlJob(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-Status", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildStatus(); |
| var od = new api.Status.fromJson(o.toJson()); |
| checkStatus(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-SubmitJobRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSubmitJobRequest(); |
| var od = new api.SubmitJobRequest.fromJson(o.toJson()); |
| checkSubmitJobRequest(od); |
| }); |
| }); |
| |
| |
| unittest.group("obj-schema-YarnApplication", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildYarnApplication(); |
| var od = new api.YarnApplication.fromJson(o.toJson()); |
| checkYarnApplication(od); |
| }); |
| }); |
| |
| |
| unittest.group("resource-ProjectsRegionsClustersResourceApi", () { |
| unittest.test("method--create", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildCluster(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.Cluster.fromJson(json); |
| checkCluster(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/clusters")); |
| pathOffset += 9; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.create(arg_request, arg_projectId, arg_region).then(unittest.expectAsync(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("/clusters/")); |
| pathOffset += 10; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.delete(arg_projectId, arg_region, arg_clusterName).then(unittest.expectAsync(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--diagnose", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildDiagnoseClusterRequest(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.DiagnoseClusterRequest.fromJson(json); |
| checkDiagnoseClusterRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("/clusters/")); |
| pathOffset += 10; |
| index = path.indexOf(":diagnose", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals(":diagnose")); |
| pathOffset += 9; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.diagnose(arg_request, arg_projectId, arg_region, arg_clusterName).then(unittest.expectAsync(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("/clusters/")); |
| pathOffset += 10; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildCluster()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_projectId, arg_region, arg_clusterName).then(unittest.expectAsync(((api.Cluster response) { |
| checkCluster(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_filter = "foo"; |
| var arg_pageSize = 42; |
| var arg_pageToken = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/clusters")); |
| pathOffset += 9; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildListClustersResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.list(arg_projectId, arg_region, filter: arg_filter, pageSize: arg_pageSize, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListClustersResponse response) { |
| checkListClustersResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--patch", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildCluster(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| var arg_updateMask = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.Cluster.fromJson(json); |
| checkCluster(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("/clusters/")); |
| pathOffset += 10; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.patch(arg_request, arg_projectId, arg_region, arg_clusterName, updateMask: arg_updateMask).then(unittest.expectAsync(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| unittest.group("resource-ProjectsRegionsJobsResourceApi", () { |
| unittest.test("method--cancel", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildCancelJobRequest(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_jobId = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.CancelJobRequest.fromJson(json); |
| checkCancelJobRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("/jobs/")); |
| pathOffset += 6; |
| index = path.indexOf(":cancel", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals(":cancel")); |
| pathOffset += 7; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildJob()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.cancel(arg_request, arg_projectId, arg_region, arg_jobId).then(unittest.expectAsync(((api.Job response) { |
| checkJob(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_jobId = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("/jobs/")); |
| pathOffset += 6; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.delete(arg_projectId, arg_region, arg_jobId).then(unittest.expectAsync(((api.Empty response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_jobId = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("/jobs/")); |
| pathOffset += 6; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildJob()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_projectId, arg_region, arg_jobId).then(unittest.expectAsync(((api.Job response) { |
| checkJob(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_pageSize = 42; |
| var arg_pageToken = "foo"; |
| var arg_clusterName = "foo"; |
| var arg_jobStateMatcher = "foo"; |
| var arg_filter = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equals("/jobs")); |
| pathOffset += 5; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["clusterName"].first, unittest.equals(arg_clusterName)); |
| unittest.expect(queryMap["jobStateMatcher"].first, unittest.equals(arg_jobStateMatcher)); |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildListJobsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.list(arg_projectId, arg_region, pageSize: arg_pageSize, pageToken: arg_pageToken, clusterName: arg_clusterName, jobStateMatcher: arg_jobStateMatcher, filter: arg_filter).then(unittest.expectAsync(((api.ListJobsResponse response) { |
| checkListJobsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--submit", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildSubmitJobRequest(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var obj = new api.SubmitJobRequest.fromJson(json); |
| checkSubmitJobRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs:submit", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("/jobs:submit")); |
| pathOffset += 12; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildJob()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.submit(arg_request, arg_projectId, arg_region).then(unittest.expectAsync(((api.Job response) { |
| checkJob(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| unittest.group("resource-ProjectsRegionsOperationsResourceApi", () { |
| unittest.test("method--cancel", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.cancel(arg_name).then(unittest.expectAsync(((api.Empty response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| var arg_filter = "foo"; |
| var arg_pageSize = 42; |
| var arg_pageToken = "foo"; |
| mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = {}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| |
| |
| var h = { |
| "content-type" : "application/json; charset=utf-8", |
| }; |
| var resp = convert.JSON.encode(buildListOperationsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res.list(arg_name, filter: arg_filter, pageSize: arg_pageSize, pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListOperationsResponse response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| |
| }); |
| |
| |
| } |
| |