| OLD | NEW |
| 1 library googleapis_beta.cloudmonitoring.v2beta2.test; | 1 library googleapis_beta.cloudmonitoring.v2beta2.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 import 'package:googleapis_beta/common/common.dart' as common; | |
| 12 import 'package:googleapis_beta/src/common_internal.dart' as common_internal; | |
| 13 import '../common/common_internal_test.dart' as common_test; | |
| 14 | 11 |
| 15 import 'package:googleapis_beta/cloudmonitoring/v2beta2.dart' as api; | 12 import 'package:googleapis_beta/cloudmonitoring/v2beta2.dart' as api; |
| 16 | 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
| 18 | 53 |
| 19 core.int buildCounterDeleteMetricDescriptorResponse = 0; | 54 core.int buildCounterDeleteMetricDescriptorResponse = 0; |
| 20 buildDeleteMetricDescriptorResponse() { | 55 buildDeleteMetricDescriptorResponse() { |
| 21 var o = new api.DeleteMetricDescriptorResponse(); | 56 var o = new api.DeleteMetricDescriptorResponse(); |
| 22 buildCounterDeleteMetricDescriptorResponse++; | 57 buildCounterDeleteMetricDescriptorResponse++; |
| 23 if (buildCounterDeleteMetricDescriptorResponse < 3) { | 58 if (buildCounterDeleteMetricDescriptorResponse < 3) { |
| 24 o.kind = "foo"; | 59 o.kind = "foo"; |
| 25 } | 60 } |
| 26 buildCounterDeleteMetricDescriptorResponse--; | 61 buildCounterDeleteMetricDescriptorResponse--; |
| 27 return o; | 62 return o; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 47 } | 82 } |
| 48 | 83 |
| 49 checkListMetricDescriptorsRequest(api.ListMetricDescriptorsRequest o) { | 84 checkListMetricDescriptorsRequest(api.ListMetricDescriptorsRequest o) { |
| 50 buildCounterListMetricDescriptorsRequest++; | 85 buildCounterListMetricDescriptorsRequest++; |
| 51 if (buildCounterListMetricDescriptorsRequest < 3) { | 86 if (buildCounterListMetricDescriptorsRequest < 3) { |
| 52 unittest.expect(o.kind, unittest.equals('foo')); | 87 unittest.expect(o.kind, unittest.equals('foo')); |
| 53 } | 88 } |
| 54 buildCounterListMetricDescriptorsRequest--; | 89 buildCounterListMetricDescriptorsRequest--; |
| 55 } | 90 } |
| 56 | 91 |
| 57 buildUnnamed1695() { | 92 buildUnnamed1475() { |
| 58 var o = new core.List<api.MetricDescriptor>(); | 93 var o = new core.List<api.MetricDescriptor>(); |
| 59 o.add(buildMetricDescriptor()); | 94 o.add(buildMetricDescriptor()); |
| 60 o.add(buildMetricDescriptor()); | 95 o.add(buildMetricDescriptor()); |
| 61 return o; | 96 return o; |
| 62 } | 97 } |
| 63 | 98 |
| 64 checkUnnamed1695(core.List<api.MetricDescriptor> o) { | 99 checkUnnamed1475(core.List<api.MetricDescriptor> o) { |
| 65 unittest.expect(o, unittest.hasLength(2)); | 100 unittest.expect(o, unittest.hasLength(2)); |
| 66 checkMetricDescriptor(o[0]); | 101 checkMetricDescriptor(o[0]); |
| 67 checkMetricDescriptor(o[1]); | 102 checkMetricDescriptor(o[1]); |
| 68 } | 103 } |
| 69 | 104 |
| 70 core.int buildCounterListMetricDescriptorsResponse = 0; | 105 core.int buildCounterListMetricDescriptorsResponse = 0; |
| 71 buildListMetricDescriptorsResponse() { | 106 buildListMetricDescriptorsResponse() { |
| 72 var o = new api.ListMetricDescriptorsResponse(); | 107 var o = new api.ListMetricDescriptorsResponse(); |
| 73 buildCounterListMetricDescriptorsResponse++; | 108 buildCounterListMetricDescriptorsResponse++; |
| 74 if (buildCounterListMetricDescriptorsResponse < 3) { | 109 if (buildCounterListMetricDescriptorsResponse < 3) { |
| 75 o.kind = "foo"; | 110 o.kind = "foo"; |
| 76 o.metrics = buildUnnamed1695(); | 111 o.metrics = buildUnnamed1475(); |
| 77 o.nextPageToken = "foo"; | 112 o.nextPageToken = "foo"; |
| 78 } | 113 } |
| 79 buildCounterListMetricDescriptorsResponse--; | 114 buildCounterListMetricDescriptorsResponse--; |
| 80 return o; | 115 return o; |
| 81 } | 116 } |
| 82 | 117 |
| 83 checkListMetricDescriptorsResponse(api.ListMetricDescriptorsResponse o) { | 118 checkListMetricDescriptorsResponse(api.ListMetricDescriptorsResponse o) { |
| 84 buildCounterListMetricDescriptorsResponse++; | 119 buildCounterListMetricDescriptorsResponse++; |
| 85 if (buildCounterListMetricDescriptorsResponse < 3) { | 120 if (buildCounterListMetricDescriptorsResponse < 3) { |
| 86 unittest.expect(o.kind, unittest.equals('foo')); | 121 unittest.expect(o.kind, unittest.equals('foo')); |
| 87 checkUnnamed1695(o.metrics); | 122 checkUnnamed1475(o.metrics); |
| 88 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 123 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 89 } | 124 } |
| 90 buildCounterListMetricDescriptorsResponse--; | 125 buildCounterListMetricDescriptorsResponse--; |
| 91 } | 126 } |
| 92 | 127 |
| 93 core.int buildCounterListTimeseriesDescriptorsRequest = 0; | 128 core.int buildCounterListTimeseriesDescriptorsRequest = 0; |
| 94 buildListTimeseriesDescriptorsRequest() { | 129 buildListTimeseriesDescriptorsRequest() { |
| 95 var o = new api.ListTimeseriesDescriptorsRequest(); | 130 var o = new api.ListTimeseriesDescriptorsRequest(); |
| 96 buildCounterListTimeseriesDescriptorsRequest++; | 131 buildCounterListTimeseriesDescriptorsRequest++; |
| 97 if (buildCounterListTimeseriesDescriptorsRequest < 3) { | 132 if (buildCounterListTimeseriesDescriptorsRequest < 3) { |
| 98 o.kind = "foo"; | 133 o.kind = "foo"; |
| 99 } | 134 } |
| 100 buildCounterListTimeseriesDescriptorsRequest--; | 135 buildCounterListTimeseriesDescriptorsRequest--; |
| 101 return o; | 136 return o; |
| 102 } | 137 } |
| 103 | 138 |
| 104 checkListTimeseriesDescriptorsRequest(api.ListTimeseriesDescriptorsRequest o) { | 139 checkListTimeseriesDescriptorsRequest(api.ListTimeseriesDescriptorsRequest o) { |
| 105 buildCounterListTimeseriesDescriptorsRequest++; | 140 buildCounterListTimeseriesDescriptorsRequest++; |
| 106 if (buildCounterListTimeseriesDescriptorsRequest < 3) { | 141 if (buildCounterListTimeseriesDescriptorsRequest < 3) { |
| 107 unittest.expect(o.kind, unittest.equals('foo')); | 142 unittest.expect(o.kind, unittest.equals('foo')); |
| 108 } | 143 } |
| 109 buildCounterListTimeseriesDescriptorsRequest--; | 144 buildCounterListTimeseriesDescriptorsRequest--; |
| 110 } | 145 } |
| 111 | 146 |
| 112 buildUnnamed1696() { | 147 buildUnnamed1476() { |
| 113 var o = new core.List<api.TimeseriesDescriptor>(); | 148 var o = new core.List<api.TimeseriesDescriptor>(); |
| 114 o.add(buildTimeseriesDescriptor()); | 149 o.add(buildTimeseriesDescriptor()); |
| 115 o.add(buildTimeseriesDescriptor()); | 150 o.add(buildTimeseriesDescriptor()); |
| 116 return o; | 151 return o; |
| 117 } | 152 } |
| 118 | 153 |
| 119 checkUnnamed1696(core.List<api.TimeseriesDescriptor> o) { | 154 checkUnnamed1476(core.List<api.TimeseriesDescriptor> o) { |
| 120 unittest.expect(o, unittest.hasLength(2)); | 155 unittest.expect(o, unittest.hasLength(2)); |
| 121 checkTimeseriesDescriptor(o[0]); | 156 checkTimeseriesDescriptor(o[0]); |
| 122 checkTimeseriesDescriptor(o[1]); | 157 checkTimeseriesDescriptor(o[1]); |
| 123 } | 158 } |
| 124 | 159 |
| 125 core.int buildCounterListTimeseriesDescriptorsResponse = 0; | 160 core.int buildCounterListTimeseriesDescriptorsResponse = 0; |
| 126 buildListTimeseriesDescriptorsResponse() { | 161 buildListTimeseriesDescriptorsResponse() { |
| 127 var o = new api.ListTimeseriesDescriptorsResponse(); | 162 var o = new api.ListTimeseriesDescriptorsResponse(); |
| 128 buildCounterListTimeseriesDescriptorsResponse++; | 163 buildCounterListTimeseriesDescriptorsResponse++; |
| 129 if (buildCounterListTimeseriesDescriptorsResponse < 3) { | 164 if (buildCounterListTimeseriesDescriptorsResponse < 3) { |
| 130 o.kind = "foo"; | 165 o.kind = "foo"; |
| 131 o.nextPageToken = "foo"; | 166 o.nextPageToken = "foo"; |
| 132 o.oldest = core.DateTime.parse("2002-02-27T14:01:02"); | 167 o.oldest = core.DateTime.parse("2002-02-27T14:01:02"); |
| 133 o.timeseries = buildUnnamed1696(); | 168 o.timeseries = buildUnnamed1476(); |
| 134 o.youngest = core.DateTime.parse("2002-02-27T14:01:02"); | 169 o.youngest = core.DateTime.parse("2002-02-27T14:01:02"); |
| 135 } | 170 } |
| 136 buildCounterListTimeseriesDescriptorsResponse--; | 171 buildCounterListTimeseriesDescriptorsResponse--; |
| 137 return o; | 172 return o; |
| 138 } | 173 } |
| 139 | 174 |
| 140 checkListTimeseriesDescriptorsResponse(api.ListTimeseriesDescriptorsResponse o)
{ | 175 checkListTimeseriesDescriptorsResponse(api.ListTimeseriesDescriptorsResponse o)
{ |
| 141 buildCounterListTimeseriesDescriptorsResponse++; | 176 buildCounterListTimeseriesDescriptorsResponse++; |
| 142 if (buildCounterListTimeseriesDescriptorsResponse < 3) { | 177 if (buildCounterListTimeseriesDescriptorsResponse < 3) { |
| 143 unittest.expect(o.kind, unittest.equals('foo')); | 178 unittest.expect(o.kind, unittest.equals('foo')); |
| 144 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 179 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 145 unittest.expect(o.oldest, unittest.equals(core.DateTime.parse("2002-02-27T14
:01:02"))); | 180 unittest.expect(o.oldest, unittest.equals(core.DateTime.parse("2002-02-27T14
:01:02"))); |
| 146 checkUnnamed1696(o.timeseries); | 181 checkUnnamed1476(o.timeseries); |
| 147 unittest.expect(o.youngest, unittest.equals(core.DateTime.parse("2002-02-27T
14:01:02"))); | 182 unittest.expect(o.youngest, unittest.equals(core.DateTime.parse("2002-02-27T
14:01:02"))); |
| 148 } | 183 } |
| 149 buildCounterListTimeseriesDescriptorsResponse--; | 184 buildCounterListTimeseriesDescriptorsResponse--; |
| 150 } | 185 } |
| 151 | 186 |
| 152 core.int buildCounterListTimeseriesRequest = 0; | 187 core.int buildCounterListTimeseriesRequest = 0; |
| 153 buildListTimeseriesRequest() { | 188 buildListTimeseriesRequest() { |
| 154 var o = new api.ListTimeseriesRequest(); | 189 var o = new api.ListTimeseriesRequest(); |
| 155 buildCounterListTimeseriesRequest++; | 190 buildCounterListTimeseriesRequest++; |
| 156 if (buildCounterListTimeseriesRequest < 3) { | 191 if (buildCounterListTimeseriesRequest < 3) { |
| 157 o.kind = "foo"; | 192 o.kind = "foo"; |
| 158 } | 193 } |
| 159 buildCounterListTimeseriesRequest--; | 194 buildCounterListTimeseriesRequest--; |
| 160 return o; | 195 return o; |
| 161 } | 196 } |
| 162 | 197 |
| 163 checkListTimeseriesRequest(api.ListTimeseriesRequest o) { | 198 checkListTimeseriesRequest(api.ListTimeseriesRequest o) { |
| 164 buildCounterListTimeseriesRequest++; | 199 buildCounterListTimeseriesRequest++; |
| 165 if (buildCounterListTimeseriesRequest < 3) { | 200 if (buildCounterListTimeseriesRequest < 3) { |
| 166 unittest.expect(o.kind, unittest.equals('foo')); | 201 unittest.expect(o.kind, unittest.equals('foo')); |
| 167 } | 202 } |
| 168 buildCounterListTimeseriesRequest--; | 203 buildCounterListTimeseriesRequest--; |
| 169 } | 204 } |
| 170 | 205 |
| 171 buildUnnamed1697() { | 206 buildUnnamed1477() { |
| 172 var o = new core.List<api.Timeseries>(); | 207 var o = new core.List<api.Timeseries>(); |
| 173 o.add(buildTimeseries()); | 208 o.add(buildTimeseries()); |
| 174 o.add(buildTimeseries()); | 209 o.add(buildTimeseries()); |
| 175 return o; | 210 return o; |
| 176 } | 211 } |
| 177 | 212 |
| 178 checkUnnamed1697(core.List<api.Timeseries> o) { | 213 checkUnnamed1477(core.List<api.Timeseries> o) { |
| 179 unittest.expect(o, unittest.hasLength(2)); | 214 unittest.expect(o, unittest.hasLength(2)); |
| 180 checkTimeseries(o[0]); | 215 checkTimeseries(o[0]); |
| 181 checkTimeseries(o[1]); | 216 checkTimeseries(o[1]); |
| 182 } | 217 } |
| 183 | 218 |
| 184 core.int buildCounterListTimeseriesResponse = 0; | 219 core.int buildCounterListTimeseriesResponse = 0; |
| 185 buildListTimeseriesResponse() { | 220 buildListTimeseriesResponse() { |
| 186 var o = new api.ListTimeseriesResponse(); | 221 var o = new api.ListTimeseriesResponse(); |
| 187 buildCounterListTimeseriesResponse++; | 222 buildCounterListTimeseriesResponse++; |
| 188 if (buildCounterListTimeseriesResponse < 3) { | 223 if (buildCounterListTimeseriesResponse < 3) { |
| 189 o.kind = "foo"; | 224 o.kind = "foo"; |
| 190 o.nextPageToken = "foo"; | 225 o.nextPageToken = "foo"; |
| 191 o.oldest = core.DateTime.parse("2002-02-27T14:01:02"); | 226 o.oldest = core.DateTime.parse("2002-02-27T14:01:02"); |
| 192 o.timeseries = buildUnnamed1697(); | 227 o.timeseries = buildUnnamed1477(); |
| 193 o.youngest = core.DateTime.parse("2002-02-27T14:01:02"); | 228 o.youngest = core.DateTime.parse("2002-02-27T14:01:02"); |
| 194 } | 229 } |
| 195 buildCounterListTimeseriesResponse--; | 230 buildCounterListTimeseriesResponse--; |
| 196 return o; | 231 return o; |
| 197 } | 232 } |
| 198 | 233 |
| 199 checkListTimeseriesResponse(api.ListTimeseriesResponse o) { | 234 checkListTimeseriesResponse(api.ListTimeseriesResponse o) { |
| 200 buildCounterListTimeseriesResponse++; | 235 buildCounterListTimeseriesResponse++; |
| 201 if (buildCounterListTimeseriesResponse < 3) { | 236 if (buildCounterListTimeseriesResponse < 3) { |
| 202 unittest.expect(o.kind, unittest.equals('foo')); | 237 unittest.expect(o.kind, unittest.equals('foo')); |
| 203 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 238 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 204 unittest.expect(o.oldest, unittest.equals(core.DateTime.parse("2002-02-27T14
:01:02"))); | 239 unittest.expect(o.oldest, unittest.equals(core.DateTime.parse("2002-02-27T14
:01:02"))); |
| 205 checkUnnamed1697(o.timeseries); | 240 checkUnnamed1477(o.timeseries); |
| 206 unittest.expect(o.youngest, unittest.equals(core.DateTime.parse("2002-02-27T
14:01:02"))); | 241 unittest.expect(o.youngest, unittest.equals(core.DateTime.parse("2002-02-27T
14:01:02"))); |
| 207 } | 242 } |
| 208 buildCounterListTimeseriesResponse--; | 243 buildCounterListTimeseriesResponse--; |
| 209 } | 244 } |
| 210 | 245 |
| 211 buildUnnamed1698() { | 246 buildUnnamed1478() { |
| 212 var o = new core.List<api.MetricDescriptorLabelDescriptor>(); | 247 var o = new core.List<api.MetricDescriptorLabelDescriptor>(); |
| 213 o.add(buildMetricDescriptorLabelDescriptor()); | 248 o.add(buildMetricDescriptorLabelDescriptor()); |
| 214 o.add(buildMetricDescriptorLabelDescriptor()); | 249 o.add(buildMetricDescriptorLabelDescriptor()); |
| 215 return o; | 250 return o; |
| 216 } | 251 } |
| 217 | 252 |
| 218 checkUnnamed1698(core.List<api.MetricDescriptorLabelDescriptor> o) { | 253 checkUnnamed1478(core.List<api.MetricDescriptorLabelDescriptor> o) { |
| 219 unittest.expect(o, unittest.hasLength(2)); | 254 unittest.expect(o, unittest.hasLength(2)); |
| 220 checkMetricDescriptorLabelDescriptor(o[0]); | 255 checkMetricDescriptorLabelDescriptor(o[0]); |
| 221 checkMetricDescriptorLabelDescriptor(o[1]); | 256 checkMetricDescriptorLabelDescriptor(o[1]); |
| 222 } | 257 } |
| 223 | 258 |
| 224 core.int buildCounterMetricDescriptor = 0; | 259 core.int buildCounterMetricDescriptor = 0; |
| 225 buildMetricDescriptor() { | 260 buildMetricDescriptor() { |
| 226 var o = new api.MetricDescriptor(); | 261 var o = new api.MetricDescriptor(); |
| 227 buildCounterMetricDescriptor++; | 262 buildCounterMetricDescriptor++; |
| 228 if (buildCounterMetricDescriptor < 3) { | 263 if (buildCounterMetricDescriptor < 3) { |
| 229 o.description = "foo"; | 264 o.description = "foo"; |
| 230 o.labels = buildUnnamed1698(); | 265 o.labels = buildUnnamed1478(); |
| 231 o.name = "foo"; | 266 o.name = "foo"; |
| 232 o.project = "foo"; | 267 o.project = "foo"; |
| 233 o.typeDescriptor = buildMetricDescriptorTypeDescriptor(); | 268 o.typeDescriptor = buildMetricDescriptorTypeDescriptor(); |
| 234 } | 269 } |
| 235 buildCounterMetricDescriptor--; | 270 buildCounterMetricDescriptor--; |
| 236 return o; | 271 return o; |
| 237 } | 272 } |
| 238 | 273 |
| 239 checkMetricDescriptor(api.MetricDescriptor o) { | 274 checkMetricDescriptor(api.MetricDescriptor o) { |
| 240 buildCounterMetricDescriptor++; | 275 buildCounterMetricDescriptor++; |
| 241 if (buildCounterMetricDescriptor < 3) { | 276 if (buildCounterMetricDescriptor < 3) { |
| 242 unittest.expect(o.description, unittest.equals('foo')); | 277 unittest.expect(o.description, unittest.equals('foo')); |
| 243 checkUnnamed1698(o.labels); | 278 checkUnnamed1478(o.labels); |
| 244 unittest.expect(o.name, unittest.equals('foo')); | 279 unittest.expect(o.name, unittest.equals('foo')); |
| 245 unittest.expect(o.project, unittest.equals('foo')); | 280 unittest.expect(o.project, unittest.equals('foo')); |
| 246 checkMetricDescriptorTypeDescriptor(o.typeDescriptor); | 281 checkMetricDescriptorTypeDescriptor(o.typeDescriptor); |
| 247 } | 282 } |
| 248 buildCounterMetricDescriptor--; | 283 buildCounterMetricDescriptor--; |
| 249 } | 284 } |
| 250 | 285 |
| 251 core.int buildCounterMetricDescriptorLabelDescriptor = 0; | 286 core.int buildCounterMetricDescriptorLabelDescriptor = 0; |
| 252 buildMetricDescriptorLabelDescriptor() { | 287 buildMetricDescriptorLabelDescriptor() { |
| 253 var o = new api.MetricDescriptorLabelDescriptor(); | 288 var o = new api.MetricDescriptorLabelDescriptor(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 checkPointDistribution(o.distributionValue); | 349 checkPointDistribution(o.distributionValue); |
| 315 unittest.expect(o.doubleValue, unittest.equals(42.0)); | 350 unittest.expect(o.doubleValue, unittest.equals(42.0)); |
| 316 unittest.expect(o.end, unittest.equals(core.DateTime.parse("2002-02-27T14:01
:02"))); | 351 unittest.expect(o.end, unittest.equals(core.DateTime.parse("2002-02-27T14:01
:02"))); |
| 317 unittest.expect(o.int64Value, unittest.equals('foo')); | 352 unittest.expect(o.int64Value, unittest.equals('foo')); |
| 318 unittest.expect(o.start, unittest.equals(core.DateTime.parse("2002-02-27T14:
01:02"))); | 353 unittest.expect(o.start, unittest.equals(core.DateTime.parse("2002-02-27T14:
01:02"))); |
| 319 unittest.expect(o.stringValue, unittest.equals('foo')); | 354 unittest.expect(o.stringValue, unittest.equals('foo')); |
| 320 } | 355 } |
| 321 buildCounterPoint--; | 356 buildCounterPoint--; |
| 322 } | 357 } |
| 323 | 358 |
| 324 buildUnnamed1699() { | 359 buildUnnamed1479() { |
| 325 var o = new core.List<api.PointDistributionBucket>(); | 360 var o = new core.List<api.PointDistributionBucket>(); |
| 326 o.add(buildPointDistributionBucket()); | 361 o.add(buildPointDistributionBucket()); |
| 327 o.add(buildPointDistributionBucket()); | 362 o.add(buildPointDistributionBucket()); |
| 328 return o; | 363 return o; |
| 329 } | 364 } |
| 330 | 365 |
| 331 checkUnnamed1699(core.List<api.PointDistributionBucket> o) { | 366 checkUnnamed1479(core.List<api.PointDistributionBucket> o) { |
| 332 unittest.expect(o, unittest.hasLength(2)); | 367 unittest.expect(o, unittest.hasLength(2)); |
| 333 checkPointDistributionBucket(o[0]); | 368 checkPointDistributionBucket(o[0]); |
| 334 checkPointDistributionBucket(o[1]); | 369 checkPointDistributionBucket(o[1]); |
| 335 } | 370 } |
| 336 | 371 |
| 337 core.int buildCounterPointDistribution = 0; | 372 core.int buildCounterPointDistribution = 0; |
| 338 buildPointDistribution() { | 373 buildPointDistribution() { |
| 339 var o = new api.PointDistribution(); | 374 var o = new api.PointDistribution(); |
| 340 buildCounterPointDistribution++; | 375 buildCounterPointDistribution++; |
| 341 if (buildCounterPointDistribution < 3) { | 376 if (buildCounterPointDistribution < 3) { |
| 342 o.buckets = buildUnnamed1699(); | 377 o.buckets = buildUnnamed1479(); |
| 343 o.overflowBucket = buildPointDistributionOverflowBucket(); | 378 o.overflowBucket = buildPointDistributionOverflowBucket(); |
| 344 o.underflowBucket = buildPointDistributionUnderflowBucket(); | 379 o.underflowBucket = buildPointDistributionUnderflowBucket(); |
| 345 } | 380 } |
| 346 buildCounterPointDistribution--; | 381 buildCounterPointDistribution--; |
| 347 return o; | 382 return o; |
| 348 } | 383 } |
| 349 | 384 |
| 350 checkPointDistribution(api.PointDistribution o) { | 385 checkPointDistribution(api.PointDistribution o) { |
| 351 buildCounterPointDistribution++; | 386 buildCounterPointDistribution++; |
| 352 if (buildCounterPointDistribution < 3) { | 387 if (buildCounterPointDistribution < 3) { |
| 353 checkUnnamed1699(o.buckets); | 388 checkUnnamed1479(o.buckets); |
| 354 checkPointDistributionOverflowBucket(o.overflowBucket); | 389 checkPointDistributionOverflowBucket(o.overflowBucket); |
| 355 checkPointDistributionUnderflowBucket(o.underflowBucket); | 390 checkPointDistributionUnderflowBucket(o.underflowBucket); |
| 356 } | 391 } |
| 357 buildCounterPointDistribution--; | 392 buildCounterPointDistribution--; |
| 358 } | 393 } |
| 359 | 394 |
| 360 core.int buildCounterPointDistributionBucket = 0; | 395 core.int buildCounterPointDistributionBucket = 0; |
| 361 buildPointDistributionBucket() { | 396 buildPointDistributionBucket() { |
| 362 var o = new api.PointDistributionBucket(); | 397 var o = new api.PointDistributionBucket(); |
| 363 buildCounterPointDistributionBucket++; | 398 buildCounterPointDistributionBucket++; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 450 |
| 416 checkPointDistributionUnderflowBucket(api.PointDistributionUnderflowBucket o) { | 451 checkPointDistributionUnderflowBucket(api.PointDistributionUnderflowBucket o) { |
| 417 buildCounterPointDistributionUnderflowBucket++; | 452 buildCounterPointDistributionUnderflowBucket++; |
| 418 if (buildCounterPointDistributionUnderflowBucket < 3) { | 453 if (buildCounterPointDistributionUnderflowBucket < 3) { |
| 419 unittest.expect(o.count, unittest.equals('foo')); | 454 unittest.expect(o.count, unittest.equals('foo')); |
| 420 unittest.expect(o.upperBound, unittest.equals(42.0)); | 455 unittest.expect(o.upperBound, unittest.equals(42.0)); |
| 421 } | 456 } |
| 422 buildCounterPointDistributionUnderflowBucket--; | 457 buildCounterPointDistributionUnderflowBucket--; |
| 423 } | 458 } |
| 424 | 459 |
| 425 buildUnnamed1700() { | 460 buildUnnamed1480() { |
| 426 var o = new core.List<api.Point>(); | 461 var o = new core.List<api.Point>(); |
| 427 o.add(buildPoint()); | 462 o.add(buildPoint()); |
| 428 o.add(buildPoint()); | 463 o.add(buildPoint()); |
| 429 return o; | 464 return o; |
| 430 } | 465 } |
| 431 | 466 |
| 432 checkUnnamed1700(core.List<api.Point> o) { | 467 checkUnnamed1480(core.List<api.Point> o) { |
| 433 unittest.expect(o, unittest.hasLength(2)); | 468 unittest.expect(o, unittest.hasLength(2)); |
| 434 checkPoint(o[0]); | 469 checkPoint(o[0]); |
| 435 checkPoint(o[1]); | 470 checkPoint(o[1]); |
| 436 } | 471 } |
| 437 | 472 |
| 438 core.int buildCounterTimeseries = 0; | 473 core.int buildCounterTimeseries = 0; |
| 439 buildTimeseries() { | 474 buildTimeseries() { |
| 440 var o = new api.Timeseries(); | 475 var o = new api.Timeseries(); |
| 441 buildCounterTimeseries++; | 476 buildCounterTimeseries++; |
| 442 if (buildCounterTimeseries < 3) { | 477 if (buildCounterTimeseries < 3) { |
| 443 o.points = buildUnnamed1700(); | 478 o.points = buildUnnamed1480(); |
| 444 o.timeseriesDesc = buildTimeseriesDescriptor(); | 479 o.timeseriesDesc = buildTimeseriesDescriptor(); |
| 445 } | 480 } |
| 446 buildCounterTimeseries--; | 481 buildCounterTimeseries--; |
| 447 return o; | 482 return o; |
| 448 } | 483 } |
| 449 | 484 |
| 450 checkTimeseries(api.Timeseries o) { | 485 checkTimeseries(api.Timeseries o) { |
| 451 buildCounterTimeseries++; | 486 buildCounterTimeseries++; |
| 452 if (buildCounterTimeseries < 3) { | 487 if (buildCounterTimeseries < 3) { |
| 453 checkUnnamed1700(o.points); | 488 checkUnnamed1480(o.points); |
| 454 checkTimeseriesDescriptor(o.timeseriesDesc); | 489 checkTimeseriesDescriptor(o.timeseriesDesc); |
| 455 } | 490 } |
| 456 buildCounterTimeseries--; | 491 buildCounterTimeseries--; |
| 457 } | 492 } |
| 458 | 493 |
| 459 buildUnnamed1701() { | 494 buildUnnamed1481() { |
| 460 var o = new core.Map<core.String, core.String>(); | 495 var o = new core.Map<core.String, core.String>(); |
| 461 o["x"] = "foo"; | 496 o["x"] = "foo"; |
| 462 o["y"] = "foo"; | 497 o["y"] = "foo"; |
| 463 return o; | 498 return o; |
| 464 } | 499 } |
| 465 | 500 |
| 466 checkUnnamed1701(core.Map<core.String, core.String> o) { | 501 checkUnnamed1481(core.Map<core.String, core.String> o) { |
| 467 unittest.expect(o, unittest.hasLength(2)); | 502 unittest.expect(o, unittest.hasLength(2)); |
| 468 unittest.expect(o["x"], unittest.equals('foo')); | 503 unittest.expect(o["x"], unittest.equals('foo')); |
| 469 unittest.expect(o["y"], unittest.equals('foo')); | 504 unittest.expect(o["y"], unittest.equals('foo')); |
| 470 } | 505 } |
| 471 | 506 |
| 472 core.int buildCounterTimeseriesDescriptor = 0; | 507 core.int buildCounterTimeseriesDescriptor = 0; |
| 473 buildTimeseriesDescriptor() { | 508 buildTimeseriesDescriptor() { |
| 474 var o = new api.TimeseriesDescriptor(); | 509 var o = new api.TimeseriesDescriptor(); |
| 475 buildCounterTimeseriesDescriptor++; | 510 buildCounterTimeseriesDescriptor++; |
| 476 if (buildCounterTimeseriesDescriptor < 3) { | 511 if (buildCounterTimeseriesDescriptor < 3) { |
| 477 o.labels = buildUnnamed1701(); | 512 o.labels = buildUnnamed1481(); |
| 478 o.metric = "foo"; | 513 o.metric = "foo"; |
| 479 o.project = "foo"; | 514 o.project = "foo"; |
| 480 } | 515 } |
| 481 buildCounterTimeseriesDescriptor--; | 516 buildCounterTimeseriesDescriptor--; |
| 482 return o; | 517 return o; |
| 483 } | 518 } |
| 484 | 519 |
| 485 checkTimeseriesDescriptor(api.TimeseriesDescriptor o) { | 520 checkTimeseriesDescriptor(api.TimeseriesDescriptor o) { |
| 486 buildCounterTimeseriesDescriptor++; | 521 buildCounterTimeseriesDescriptor++; |
| 487 if (buildCounterTimeseriesDescriptor < 3) { | 522 if (buildCounterTimeseriesDescriptor < 3) { |
| 488 checkUnnamed1701(o.labels); | 523 checkUnnamed1481(o.labels); |
| 489 unittest.expect(o.metric, unittest.equals('foo')); | 524 unittest.expect(o.metric, unittest.equals('foo')); |
| 490 unittest.expect(o.project, unittest.equals('foo')); | 525 unittest.expect(o.project, unittest.equals('foo')); |
| 491 } | 526 } |
| 492 buildCounterTimeseriesDescriptor--; | 527 buildCounterTimeseriesDescriptor--; |
| 493 } | 528 } |
| 494 | 529 |
| 495 core.int buildCounterTimeseriesDescriptorLabel = 0; | 530 core.int buildCounterTimeseriesDescriptorLabel = 0; |
| 496 buildTimeseriesDescriptorLabel() { | 531 buildTimeseriesDescriptorLabel() { |
| 497 var o = new api.TimeseriesDescriptorLabel(); | 532 var o = new api.TimeseriesDescriptorLabel(); |
| 498 buildCounterTimeseriesDescriptorLabel++; | 533 buildCounterTimeseriesDescriptorLabel++; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 527 | 562 |
| 528 checkTimeseriesPoint(api.TimeseriesPoint o) { | 563 checkTimeseriesPoint(api.TimeseriesPoint o) { |
| 529 buildCounterTimeseriesPoint++; | 564 buildCounterTimeseriesPoint++; |
| 530 if (buildCounterTimeseriesPoint < 3) { | 565 if (buildCounterTimeseriesPoint < 3) { |
| 531 checkPoint(o.point); | 566 checkPoint(o.point); |
| 532 checkTimeseriesDescriptor(o.timeseriesDesc); | 567 checkTimeseriesDescriptor(o.timeseriesDesc); |
| 533 } | 568 } |
| 534 buildCounterTimeseriesPoint--; | 569 buildCounterTimeseriesPoint--; |
| 535 } | 570 } |
| 536 | 571 |
| 537 buildUnnamed1702() { | 572 buildUnnamed1482() { |
| 538 var o = new core.Map<core.String, core.String>(); | 573 var o = new core.Map<core.String, core.String>(); |
| 539 o["x"] = "foo"; | 574 o["x"] = "foo"; |
| 540 o["y"] = "foo"; | 575 o["y"] = "foo"; |
| 541 return o; | 576 return o; |
| 542 } | 577 } |
| 543 | 578 |
| 544 checkUnnamed1702(core.Map<core.String, core.String> o) { | 579 checkUnnamed1482(core.Map<core.String, core.String> o) { |
| 545 unittest.expect(o, unittest.hasLength(2)); | 580 unittest.expect(o, unittest.hasLength(2)); |
| 546 unittest.expect(o["x"], unittest.equals('foo')); | 581 unittest.expect(o["x"], unittest.equals('foo')); |
| 547 unittest.expect(o["y"], unittest.equals('foo')); | 582 unittest.expect(o["y"], unittest.equals('foo')); |
| 548 } | 583 } |
| 549 | 584 |
| 550 buildUnnamed1703() { | 585 buildUnnamed1483() { |
| 551 var o = new core.List<api.TimeseriesPoint>(); | 586 var o = new core.List<api.TimeseriesPoint>(); |
| 552 o.add(buildTimeseriesPoint()); | 587 o.add(buildTimeseriesPoint()); |
| 553 o.add(buildTimeseriesPoint()); | 588 o.add(buildTimeseriesPoint()); |
| 554 return o; | 589 return o; |
| 555 } | 590 } |
| 556 | 591 |
| 557 checkUnnamed1703(core.List<api.TimeseriesPoint> o) { | 592 checkUnnamed1483(core.List<api.TimeseriesPoint> o) { |
| 558 unittest.expect(o, unittest.hasLength(2)); | 593 unittest.expect(o, unittest.hasLength(2)); |
| 559 checkTimeseriesPoint(o[0]); | 594 checkTimeseriesPoint(o[0]); |
| 560 checkTimeseriesPoint(o[1]); | 595 checkTimeseriesPoint(o[1]); |
| 561 } | 596 } |
| 562 | 597 |
| 563 core.int buildCounterWriteTimeseriesRequest = 0; | 598 core.int buildCounterWriteTimeseriesRequest = 0; |
| 564 buildWriteTimeseriesRequest() { | 599 buildWriteTimeseriesRequest() { |
| 565 var o = new api.WriteTimeseriesRequest(); | 600 var o = new api.WriteTimeseriesRequest(); |
| 566 buildCounterWriteTimeseriesRequest++; | 601 buildCounterWriteTimeseriesRequest++; |
| 567 if (buildCounterWriteTimeseriesRequest < 3) { | 602 if (buildCounterWriteTimeseriesRequest < 3) { |
| 568 o.commonLabels = buildUnnamed1702(); | 603 o.commonLabels = buildUnnamed1482(); |
| 569 o.timeseries = buildUnnamed1703(); | 604 o.timeseries = buildUnnamed1483(); |
| 570 } | 605 } |
| 571 buildCounterWriteTimeseriesRequest--; | 606 buildCounterWriteTimeseriesRequest--; |
| 572 return o; | 607 return o; |
| 573 } | 608 } |
| 574 | 609 |
| 575 checkWriteTimeseriesRequest(api.WriteTimeseriesRequest o) { | 610 checkWriteTimeseriesRequest(api.WriteTimeseriesRequest o) { |
| 576 buildCounterWriteTimeseriesRequest++; | 611 buildCounterWriteTimeseriesRequest++; |
| 577 if (buildCounterWriteTimeseriesRequest < 3) { | 612 if (buildCounterWriteTimeseriesRequest < 3) { |
| 578 checkUnnamed1702(o.commonLabels); | 613 checkUnnamed1482(o.commonLabels); |
| 579 checkUnnamed1703(o.timeseries); | 614 checkUnnamed1483(o.timeseries); |
| 580 } | 615 } |
| 581 buildCounterWriteTimeseriesRequest--; | 616 buildCounterWriteTimeseriesRequest--; |
| 582 } | 617 } |
| 583 | 618 |
| 584 core.int buildCounterWriteTimeseriesResponse = 0; | 619 core.int buildCounterWriteTimeseriesResponse = 0; |
| 585 buildWriteTimeseriesResponse() { | 620 buildWriteTimeseriesResponse() { |
| 586 var o = new api.WriteTimeseriesResponse(); | 621 var o = new api.WriteTimeseriesResponse(); |
| 587 buildCounterWriteTimeseriesResponse++; | 622 buildCounterWriteTimeseriesResponse++; |
| 588 if (buildCounterWriteTimeseriesResponse < 3) { | 623 if (buildCounterWriteTimeseriesResponse < 3) { |
| 589 o.kind = "foo"; | 624 o.kind = "foo"; |
| 590 } | 625 } |
| 591 buildCounterWriteTimeseriesResponse--; | 626 buildCounterWriteTimeseriesResponse--; |
| 592 return o; | 627 return o; |
| 593 } | 628 } |
| 594 | 629 |
| 595 checkWriteTimeseriesResponse(api.WriteTimeseriesResponse o) { | 630 checkWriteTimeseriesResponse(api.WriteTimeseriesResponse o) { |
| 596 buildCounterWriteTimeseriesResponse++; | 631 buildCounterWriteTimeseriesResponse++; |
| 597 if (buildCounterWriteTimeseriesResponse < 3) { | 632 if (buildCounterWriteTimeseriesResponse < 3) { |
| 598 unittest.expect(o.kind, unittest.equals('foo')); | 633 unittest.expect(o.kind, unittest.equals('foo')); |
| 599 } | 634 } |
| 600 buildCounterWriteTimeseriesResponse--; | 635 buildCounterWriteTimeseriesResponse--; |
| 601 } | 636 } |
| 602 | 637 |
| 603 buildUnnamed1704() { | 638 buildUnnamed1484() { |
| 604 var o = new core.List<core.String>(); | 639 var o = new core.List<core.String>(); |
| 605 o.add("foo"); | 640 o.add("foo"); |
| 606 o.add("foo"); | 641 o.add("foo"); |
| 607 return o; | 642 return o; |
| 608 } | 643 } |
| 609 | 644 |
| 610 checkUnnamed1704(core.List<core.String> o) { | 645 checkUnnamed1484(core.List<core.String> o) { |
| 611 unittest.expect(o, unittest.hasLength(2)); | 646 unittest.expect(o, unittest.hasLength(2)); |
| 612 unittest.expect(o[0], unittest.equals('foo')); | 647 unittest.expect(o[0], unittest.equals('foo')); |
| 613 unittest.expect(o[1], unittest.equals('foo')); | 648 unittest.expect(o[1], unittest.equals('foo')); |
| 614 } | 649 } |
| 615 | 650 |
| 616 buildUnnamed1705() { | 651 buildUnnamed1485() { |
| 617 var o = new core.List<core.String>(); | 652 var o = new core.List<core.String>(); |
| 618 o.add("foo"); | 653 o.add("foo"); |
| 619 o.add("foo"); | 654 o.add("foo"); |
| 620 return o; | 655 return o; |
| 621 } | 656 } |
| 622 | 657 |
| 623 checkUnnamed1705(core.List<core.String> o) { | 658 checkUnnamed1485(core.List<core.String> o) { |
| 624 unittest.expect(o, unittest.hasLength(2)); | 659 unittest.expect(o, unittest.hasLength(2)); |
| 625 unittest.expect(o[0], unittest.equals('foo')); | 660 unittest.expect(o[0], unittest.equals('foo')); |
| 626 unittest.expect(o[1], unittest.equals('foo')); | 661 unittest.expect(o[1], unittest.equals('foo')); |
| 627 } | 662 } |
| 628 | 663 |
| 629 | 664 |
| 630 main() { | 665 main() { |
| 631 unittest.group("obj-schema-DeleteMetricDescriptorResponse", () { | 666 unittest.group("obj-schema-DeleteMetricDescriptorResponse", () { |
| 632 unittest.test("to-json--from-json", () { | 667 unittest.test("to-json--from-json", () { |
| 633 var o = buildDeleteMetricDescriptorResponse(); | 668 var o = buildDeleteMetricDescriptorResponse(); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 var o = buildWriteTimeseriesResponse(); | 848 var o = buildWriteTimeseriesResponse(); |
| 814 var od = new api.WriteTimeseriesResponse.fromJson(o.toJson()); | 849 var od = new api.WriteTimeseriesResponse.fromJson(o.toJson()); |
| 815 checkWriteTimeseriesResponse(od); | 850 checkWriteTimeseriesResponse(od); |
| 816 }); | 851 }); |
| 817 }); | 852 }); |
| 818 | 853 |
| 819 | 854 |
| 820 unittest.group("resource-MetricDescriptorsResourceApi", () { | 855 unittest.group("resource-MetricDescriptorsResourceApi", () { |
| 821 unittest.test("method--create", () { | 856 unittest.test("method--create", () { |
| 822 | 857 |
| 823 var mock = new common_test.HttpServerMock(); | 858 var mock = new HttpServerMock(); |
| 824 api.MetricDescriptorsResourceApi res = new api.CloudmonitoringApi(mock).me
tricDescriptors; | 859 api.MetricDescriptorsResourceApi res = new api.CloudmonitoringApi(mock).me
tricDescriptors; |
| 825 var arg_request = buildMetricDescriptor(); | 860 var arg_request = buildMetricDescriptor(); |
| 826 var arg_project = "foo"; | 861 var arg_project = "foo"; |
| 827 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 862 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 828 var obj = new api.MetricDescriptor.fromJson(json); | 863 var obj = new api.MetricDescriptor.fromJson(json); |
| 829 checkMetricDescriptor(obj); | 864 checkMetricDescriptor(obj); |
| 830 | 865 |
| 831 var path = (req.url).path; | 866 var path = (req.url).path; |
| 832 var pathOffset = 0; | 867 var pathOffset = 0; |
| 833 var index; | 868 var index; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 850 var keyvalue = part.split("="); | 885 var keyvalue = part.split("="); |
| 851 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 886 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 852 } | 887 } |
| 853 } | 888 } |
| 854 | 889 |
| 855 | 890 |
| 856 var h = { | 891 var h = { |
| 857 "content-type" : "application/json; charset=utf-8", | 892 "content-type" : "application/json; charset=utf-8", |
| 858 }; | 893 }; |
| 859 var resp = convert.JSON.encode(buildMetricDescriptor()); | 894 var resp = convert.JSON.encode(buildMetricDescriptor()); |
| 860 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 895 return new async.Future.value(stringResponse(200, h, resp)); |
| 861 }), true); | 896 }), true); |
| 862 res.create(arg_request, arg_project).then(unittest.expectAsync(((api.Metri
cDescriptor response) { | 897 res.create(arg_request, arg_project).then(unittest.expectAsync(((api.Metri
cDescriptor response) { |
| 863 checkMetricDescriptor(response); | 898 checkMetricDescriptor(response); |
| 864 }))); | 899 }))); |
| 865 }); | 900 }); |
| 866 | 901 |
| 867 unittest.test("method--delete", () { | 902 unittest.test("method--delete", () { |
| 868 | 903 |
| 869 var mock = new common_test.HttpServerMock(); | 904 var mock = new HttpServerMock(); |
| 870 api.MetricDescriptorsResourceApi res = new api.CloudmonitoringApi(mock).me
tricDescriptors; | 905 api.MetricDescriptorsResourceApi res = new api.CloudmonitoringApi(mock).me
tricDescriptors; |
| 871 var arg_project = "foo"; | 906 var arg_project = "foo"; |
| 872 var arg_metric = "foo"; | 907 var arg_metric = "foo"; |
| 873 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 908 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 874 var path = (req.url).path; | 909 var path = (req.url).path; |
| 875 var pathOffset = 0; | 910 var pathOffset = 0; |
| 876 var index; | 911 var index; |
| 877 var subPart; | 912 var subPart; |
| 878 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 913 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 879 pathOffset += 1; | 914 pathOffset += 1; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 893 var keyvalue = part.split("="); | 928 var keyvalue = part.split("="); |
| 894 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 929 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 895 } | 930 } |
| 896 } | 931 } |
| 897 | 932 |
| 898 | 933 |
| 899 var h = { | 934 var h = { |
| 900 "content-type" : "application/json; charset=utf-8", | 935 "content-type" : "application/json; charset=utf-8", |
| 901 }; | 936 }; |
| 902 var resp = convert.JSON.encode(buildDeleteMetricDescriptorResponse()); | 937 var resp = convert.JSON.encode(buildDeleteMetricDescriptorResponse()); |
| 903 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 938 return new async.Future.value(stringResponse(200, h, resp)); |
| 904 }), true); | 939 }), true); |
| 905 res.delete(arg_project, arg_metric).then(unittest.expectAsync(((api.Delete
MetricDescriptorResponse response) { | 940 res.delete(arg_project, arg_metric).then(unittest.expectAsync(((api.Delete
MetricDescriptorResponse response) { |
| 906 checkDeleteMetricDescriptorResponse(response); | 941 checkDeleteMetricDescriptorResponse(response); |
| 907 }))); | 942 }))); |
| 908 }); | 943 }); |
| 909 | 944 |
| 910 unittest.test("method--list", () { | 945 unittest.test("method--list", () { |
| 911 | 946 |
| 912 var mock = new common_test.HttpServerMock(); | 947 var mock = new HttpServerMock(); |
| 913 api.MetricDescriptorsResourceApi res = new api.CloudmonitoringApi(mock).me
tricDescriptors; | 948 api.MetricDescriptorsResourceApi res = new api.CloudmonitoringApi(mock).me
tricDescriptors; |
| 914 var arg_request = buildListMetricDescriptorsRequest(); | 949 var arg_request = buildListMetricDescriptorsRequest(); |
| 915 var arg_project = "foo"; | 950 var arg_project = "foo"; |
| 916 var arg_count = 42; | 951 var arg_count = 42; |
| 917 var arg_pageToken = "foo"; | 952 var arg_pageToken = "foo"; |
| 918 var arg_query = "foo"; | 953 var arg_query = "foo"; |
| 919 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 954 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 920 var obj = new api.ListMetricDescriptorsRequest.fromJson(json); | 955 var obj = new api.ListMetricDescriptorsRequest.fromJson(json); |
| 921 checkListMetricDescriptorsRequest(obj); | 956 checkListMetricDescriptorsRequest(obj); |
| 922 | 957 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 945 } | 980 } |
| 946 unittest.expect(core.int.parse(queryMap["count"].first), unittest.equals
(arg_count)); | 981 unittest.expect(core.int.parse(queryMap["count"].first), unittest.equals
(arg_count)); |
| 947 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 982 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 948 unittest.expect(queryMap["query"].first, unittest.equals(arg_query)); | 983 unittest.expect(queryMap["query"].first, unittest.equals(arg_query)); |
| 949 | 984 |
| 950 | 985 |
| 951 var h = { | 986 var h = { |
| 952 "content-type" : "application/json; charset=utf-8", | 987 "content-type" : "application/json; charset=utf-8", |
| 953 }; | 988 }; |
| 954 var resp = convert.JSON.encode(buildListMetricDescriptorsResponse()); | 989 var resp = convert.JSON.encode(buildListMetricDescriptorsResponse()); |
| 955 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 990 return new async.Future.value(stringResponse(200, h, resp)); |
| 956 }), true); | 991 }), true); |
| 957 res.list(arg_request, arg_project, count: arg_count, pageToken: arg_pageTo
ken, query: arg_query).then(unittest.expectAsync(((api.ListMetricDescriptorsResp
onse response) { | 992 res.list(arg_request, arg_project, count: arg_count, pageToken: arg_pageTo
ken, query: arg_query).then(unittest.expectAsync(((api.ListMetricDescriptorsResp
onse response) { |
| 958 checkListMetricDescriptorsResponse(response); | 993 checkListMetricDescriptorsResponse(response); |
| 959 }))); | 994 }))); |
| 960 }); | 995 }); |
| 961 | 996 |
| 962 }); | 997 }); |
| 963 | 998 |
| 964 | 999 |
| 965 unittest.group("resource-TimeseriesResourceApi", () { | 1000 unittest.group("resource-TimeseriesResourceApi", () { |
| 966 unittest.test("method--list", () { | 1001 unittest.test("method--list", () { |
| 967 | 1002 |
| 968 var mock = new common_test.HttpServerMock(); | 1003 var mock = new HttpServerMock(); |
| 969 api.TimeseriesResourceApi res = new api.CloudmonitoringApi(mock).timeserie
s; | 1004 api.TimeseriesResourceApi res = new api.CloudmonitoringApi(mock).timeserie
s; |
| 970 var arg_request = buildListTimeseriesRequest(); | 1005 var arg_request = buildListTimeseriesRequest(); |
| 971 var arg_project = "foo"; | 1006 var arg_project = "foo"; |
| 972 var arg_metric = "foo"; | 1007 var arg_metric = "foo"; |
| 973 var arg_youngest = "foo"; | 1008 var arg_youngest = "foo"; |
| 974 var arg_aggregator = "foo"; | 1009 var arg_aggregator = "foo"; |
| 975 var arg_count = 42; | 1010 var arg_count = 42; |
| 976 var arg_labels = buildUnnamed1704(); | 1011 var arg_labels = buildUnnamed1484(); |
| 977 var arg_oldest = "foo"; | 1012 var arg_oldest = "foo"; |
| 978 var arg_pageToken = "foo"; | 1013 var arg_pageToken = "foo"; |
| 979 var arg_timespan = "foo"; | 1014 var arg_timespan = "foo"; |
| 980 var arg_window = "foo"; | 1015 var arg_window = "foo"; |
| 981 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1016 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 982 var obj = new api.ListTimeseriesRequest.fromJson(json); | 1017 var obj = new api.ListTimeseriesRequest.fromJson(json); |
| 983 checkListTimeseriesRequest(obj); | 1018 checkListTimeseriesRequest(obj); |
| 984 | 1019 |
| 985 var path = (req.url).path; | 1020 var path = (req.url).path; |
| 986 var pathOffset = 0; | 1021 var pathOffset = 0; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1012 unittest.expect(queryMap["oldest"].first, unittest.equals(arg_oldest)); | 1047 unittest.expect(queryMap["oldest"].first, unittest.equals(arg_oldest)); |
| 1013 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1048 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1014 unittest.expect(queryMap["timespan"].first, unittest.equals(arg_timespan
)); | 1049 unittest.expect(queryMap["timespan"].first, unittest.equals(arg_timespan
)); |
| 1015 unittest.expect(queryMap["window"].first, unittest.equals(arg_window)); | 1050 unittest.expect(queryMap["window"].first, unittest.equals(arg_window)); |
| 1016 | 1051 |
| 1017 | 1052 |
| 1018 var h = { | 1053 var h = { |
| 1019 "content-type" : "application/json; charset=utf-8", | 1054 "content-type" : "application/json; charset=utf-8", |
| 1020 }; | 1055 }; |
| 1021 var resp = convert.JSON.encode(buildListTimeseriesResponse()); | 1056 var resp = convert.JSON.encode(buildListTimeseriesResponse()); |
| 1022 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1057 return new async.Future.value(stringResponse(200, h, resp)); |
| 1023 }), true); | 1058 }), true); |
| 1024 res.list(arg_request, arg_project, arg_metric, arg_youngest, aggregator: a
rg_aggregator, count: arg_count, labels: arg_labels, oldest: arg_oldest, pageTok
en: arg_pageToken, timespan: arg_timespan, window: arg_window).then(unittest.exp
ectAsync(((api.ListTimeseriesResponse response) { | 1059 res.list(arg_request, arg_project, arg_metric, arg_youngest, aggregator: a
rg_aggregator, count: arg_count, labels: arg_labels, oldest: arg_oldest, pageTok
en: arg_pageToken, timespan: arg_timespan, window: arg_window).then(unittest.exp
ectAsync(((api.ListTimeseriesResponse response) { |
| 1025 checkListTimeseriesResponse(response); | 1060 checkListTimeseriesResponse(response); |
| 1026 }))); | 1061 }))); |
| 1027 }); | 1062 }); |
| 1028 | 1063 |
| 1029 unittest.test("method--write", () { | 1064 unittest.test("method--write", () { |
| 1030 | 1065 |
| 1031 var mock = new common_test.HttpServerMock(); | 1066 var mock = new HttpServerMock(); |
| 1032 api.TimeseriesResourceApi res = new api.CloudmonitoringApi(mock).timeserie
s; | 1067 api.TimeseriesResourceApi res = new api.CloudmonitoringApi(mock).timeserie
s; |
| 1033 var arg_request = buildWriteTimeseriesRequest(); | 1068 var arg_request = buildWriteTimeseriesRequest(); |
| 1034 var arg_project = "foo"; | 1069 var arg_project = "foo"; |
| 1035 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1070 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1036 var obj = new api.WriteTimeseriesRequest.fromJson(json); | 1071 var obj = new api.WriteTimeseriesRequest.fromJson(json); |
| 1037 checkWriteTimeseriesRequest(obj); | 1072 checkWriteTimeseriesRequest(obj); |
| 1038 | 1073 |
| 1039 var path = (req.url).path; | 1074 var path = (req.url).path; |
| 1040 var pathOffset = 0; | 1075 var pathOffset = 0; |
| 1041 var index; | 1076 var index; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1058 var keyvalue = part.split("="); | 1093 var keyvalue = part.split("="); |
| 1059 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1094 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1060 } | 1095 } |
| 1061 } | 1096 } |
| 1062 | 1097 |
| 1063 | 1098 |
| 1064 var h = { | 1099 var h = { |
| 1065 "content-type" : "application/json; charset=utf-8", | 1100 "content-type" : "application/json; charset=utf-8", |
| 1066 }; | 1101 }; |
| 1067 var resp = convert.JSON.encode(buildWriteTimeseriesResponse()); | 1102 var resp = convert.JSON.encode(buildWriteTimeseriesResponse()); |
| 1068 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1103 return new async.Future.value(stringResponse(200, h, resp)); |
| 1069 }), true); | 1104 }), true); |
| 1070 res.write(arg_request, arg_project).then(unittest.expectAsync(((api.WriteT
imeseriesResponse response) { | 1105 res.write(arg_request, arg_project).then(unittest.expectAsync(((api.WriteT
imeseriesResponse response) { |
| 1071 checkWriteTimeseriesResponse(response); | 1106 checkWriteTimeseriesResponse(response); |
| 1072 }))); | 1107 }))); |
| 1073 }); | 1108 }); |
| 1074 | 1109 |
| 1075 }); | 1110 }); |
| 1076 | 1111 |
| 1077 | 1112 |
| 1078 unittest.group("resource-TimeseriesDescriptorsResourceApi", () { | 1113 unittest.group("resource-TimeseriesDescriptorsResourceApi", () { |
| 1079 unittest.test("method--list", () { | 1114 unittest.test("method--list", () { |
| 1080 | 1115 |
| 1081 var mock = new common_test.HttpServerMock(); | 1116 var mock = new HttpServerMock(); |
| 1082 api.TimeseriesDescriptorsResourceApi res = new api.CloudmonitoringApi(mock
).timeseriesDescriptors; | 1117 api.TimeseriesDescriptorsResourceApi res = new api.CloudmonitoringApi(mock
).timeseriesDescriptors; |
| 1083 var arg_request = buildListTimeseriesDescriptorsRequest(); | 1118 var arg_request = buildListTimeseriesDescriptorsRequest(); |
| 1084 var arg_project = "foo"; | 1119 var arg_project = "foo"; |
| 1085 var arg_metric = "foo"; | 1120 var arg_metric = "foo"; |
| 1086 var arg_youngest = "foo"; | 1121 var arg_youngest = "foo"; |
| 1087 var arg_aggregator = "foo"; | 1122 var arg_aggregator = "foo"; |
| 1088 var arg_count = 42; | 1123 var arg_count = 42; |
| 1089 var arg_labels = buildUnnamed1705(); | 1124 var arg_labels = buildUnnamed1485(); |
| 1090 var arg_oldest = "foo"; | 1125 var arg_oldest = "foo"; |
| 1091 var arg_pageToken = "foo"; | 1126 var arg_pageToken = "foo"; |
| 1092 var arg_timespan = "foo"; | 1127 var arg_timespan = "foo"; |
| 1093 var arg_window = "foo"; | 1128 var arg_window = "foo"; |
| 1094 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1129 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1095 var obj = new api.ListTimeseriesDescriptorsRequest.fromJson(json); | 1130 var obj = new api.ListTimeseriesDescriptorsRequest.fromJson(json); |
| 1096 checkListTimeseriesDescriptorsRequest(obj); | 1131 checkListTimeseriesDescriptorsRequest(obj); |
| 1097 | 1132 |
| 1098 var path = (req.url).path; | 1133 var path = (req.url).path; |
| 1099 var pathOffset = 0; | 1134 var pathOffset = 0; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1125 unittest.expect(queryMap["oldest"].first, unittest.equals(arg_oldest)); | 1160 unittest.expect(queryMap["oldest"].first, unittest.equals(arg_oldest)); |
| 1126 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1161 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1127 unittest.expect(queryMap["timespan"].first, unittest.equals(arg_timespan
)); | 1162 unittest.expect(queryMap["timespan"].first, unittest.equals(arg_timespan
)); |
| 1128 unittest.expect(queryMap["window"].first, unittest.equals(arg_window)); | 1163 unittest.expect(queryMap["window"].first, unittest.equals(arg_window)); |
| 1129 | 1164 |
| 1130 | 1165 |
| 1131 var h = { | 1166 var h = { |
| 1132 "content-type" : "application/json; charset=utf-8", | 1167 "content-type" : "application/json; charset=utf-8", |
| 1133 }; | 1168 }; |
| 1134 var resp = convert.JSON.encode(buildListTimeseriesDescriptorsResponse())
; | 1169 var resp = convert.JSON.encode(buildListTimeseriesDescriptorsResponse())
; |
| 1135 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1170 return new async.Future.value(stringResponse(200, h, resp)); |
| 1136 }), true); | 1171 }), true); |
| 1137 res.list(arg_request, arg_project, arg_metric, arg_youngest, aggregator: a
rg_aggregator, count: arg_count, labels: arg_labels, oldest: arg_oldest, pageTok
en: arg_pageToken, timespan: arg_timespan, window: arg_window).then(unittest.exp
ectAsync(((api.ListTimeseriesDescriptorsResponse response) { | 1172 res.list(arg_request, arg_project, arg_metric, arg_youngest, aggregator: a
rg_aggregator, count: arg_count, labels: arg_labels, oldest: arg_oldest, pageTok
en: arg_pageToken, timespan: arg_timespan, window: arg_window).then(unittest.exp
ectAsync(((api.ListTimeseriesDescriptorsResponse response) { |
| 1138 checkListTimeseriesDescriptorsResponse(response); | 1173 checkListTimeseriesDescriptorsResponse(response); |
| 1139 }))); | 1174 }))); |
| 1140 }); | 1175 }); |
| 1141 | 1176 |
| 1142 }); | 1177 }); |
| 1143 | 1178 |
| 1144 | 1179 |
| 1145 } | 1180 } |
| 1146 | 1181 |
| OLD | NEW |