OLD | NEW |
1 library googleapis_beta.clouderrorreporting.v1beta1.test; | 1 library googleapis_beta.clouderrorreporting.v1beta1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 buildCounterErrorEvent++; | 109 buildCounterErrorEvent++; |
110 if (buildCounterErrorEvent < 3) { | 110 if (buildCounterErrorEvent < 3) { |
111 checkErrorContext(o.context); | 111 checkErrorContext(o.context); |
112 unittest.expect(o.eventTime, unittest.equals('foo')); | 112 unittest.expect(o.eventTime, unittest.equals('foo')); |
113 unittest.expect(o.message, unittest.equals('foo')); | 113 unittest.expect(o.message, unittest.equals('foo')); |
114 checkServiceContext(o.serviceContext); | 114 checkServiceContext(o.serviceContext); |
115 } | 115 } |
116 buildCounterErrorEvent--; | 116 buildCounterErrorEvent--; |
117 } | 117 } |
118 | 118 |
119 buildUnnamed3287() { | 119 buildUnnamed3379() { |
120 var o = new core.List<api.TrackingIssue>(); | 120 var o = new core.List<api.TrackingIssue>(); |
121 o.add(buildTrackingIssue()); | 121 o.add(buildTrackingIssue()); |
122 o.add(buildTrackingIssue()); | 122 o.add(buildTrackingIssue()); |
123 return o; | 123 return o; |
124 } | 124 } |
125 | 125 |
126 checkUnnamed3287(core.List<api.TrackingIssue> o) { | 126 checkUnnamed3379(core.List<api.TrackingIssue> o) { |
127 unittest.expect(o, unittest.hasLength(2)); | 127 unittest.expect(o, unittest.hasLength(2)); |
128 checkTrackingIssue(o[0]); | 128 checkTrackingIssue(o[0]); |
129 checkTrackingIssue(o[1]); | 129 checkTrackingIssue(o[1]); |
130 } | 130 } |
131 | 131 |
132 core.int buildCounterErrorGroup = 0; | 132 core.int buildCounterErrorGroup = 0; |
133 buildErrorGroup() { | 133 buildErrorGroup() { |
134 var o = new api.ErrorGroup(); | 134 var o = new api.ErrorGroup(); |
135 buildCounterErrorGroup++; | 135 buildCounterErrorGroup++; |
136 if (buildCounterErrorGroup < 3) { | 136 if (buildCounterErrorGroup < 3) { |
137 o.groupId = "foo"; | 137 o.groupId = "foo"; |
138 o.name = "foo"; | 138 o.name = "foo"; |
139 o.trackingIssues = buildUnnamed3287(); | 139 o.trackingIssues = buildUnnamed3379(); |
140 } | 140 } |
141 buildCounterErrorGroup--; | 141 buildCounterErrorGroup--; |
142 return o; | 142 return o; |
143 } | 143 } |
144 | 144 |
145 checkErrorGroup(api.ErrorGroup o) { | 145 checkErrorGroup(api.ErrorGroup o) { |
146 buildCounterErrorGroup++; | 146 buildCounterErrorGroup++; |
147 if (buildCounterErrorGroup < 3) { | 147 if (buildCounterErrorGroup < 3) { |
148 unittest.expect(o.groupId, unittest.equals('foo')); | 148 unittest.expect(o.groupId, unittest.equals('foo')); |
149 unittest.expect(o.name, unittest.equals('foo')); | 149 unittest.expect(o.name, unittest.equals('foo')); |
150 checkUnnamed3287(o.trackingIssues); | 150 checkUnnamed3379(o.trackingIssues); |
151 } | 151 } |
152 buildCounterErrorGroup--; | 152 buildCounterErrorGroup--; |
153 } | 153 } |
154 | 154 |
155 buildUnnamed3288() { | 155 buildUnnamed3380() { |
156 var o = new core.List<api.ServiceContext>(); | 156 var o = new core.List<api.ServiceContext>(); |
157 o.add(buildServiceContext()); | 157 o.add(buildServiceContext()); |
158 o.add(buildServiceContext()); | 158 o.add(buildServiceContext()); |
159 return o; | 159 return o; |
160 } | 160 } |
161 | 161 |
162 checkUnnamed3288(core.List<api.ServiceContext> o) { | 162 checkUnnamed3380(core.List<api.ServiceContext> o) { |
163 unittest.expect(o, unittest.hasLength(2)); | 163 unittest.expect(o, unittest.hasLength(2)); |
164 checkServiceContext(o[0]); | 164 checkServiceContext(o[0]); |
165 checkServiceContext(o[1]); | 165 checkServiceContext(o[1]); |
166 } | 166 } |
167 | 167 |
168 buildUnnamed3289() { | 168 buildUnnamed3381() { |
169 var o = new core.List<api.TimedCount>(); | 169 var o = new core.List<api.TimedCount>(); |
170 o.add(buildTimedCount()); | 170 o.add(buildTimedCount()); |
171 o.add(buildTimedCount()); | 171 o.add(buildTimedCount()); |
172 return o; | 172 return o; |
173 } | 173 } |
174 | 174 |
175 checkUnnamed3289(core.List<api.TimedCount> o) { | 175 checkUnnamed3381(core.List<api.TimedCount> o) { |
176 unittest.expect(o, unittest.hasLength(2)); | 176 unittest.expect(o, unittest.hasLength(2)); |
177 checkTimedCount(o[0]); | 177 checkTimedCount(o[0]); |
178 checkTimedCount(o[1]); | 178 checkTimedCount(o[1]); |
179 } | 179 } |
180 | 180 |
181 core.int buildCounterErrorGroupStats = 0; | 181 core.int buildCounterErrorGroupStats = 0; |
182 buildErrorGroupStats() { | 182 buildErrorGroupStats() { |
183 var o = new api.ErrorGroupStats(); | 183 var o = new api.ErrorGroupStats(); |
184 buildCounterErrorGroupStats++; | 184 buildCounterErrorGroupStats++; |
185 if (buildCounterErrorGroupStats < 3) { | 185 if (buildCounterErrorGroupStats < 3) { |
186 o.affectedServices = buildUnnamed3288(); | 186 o.affectedServices = buildUnnamed3380(); |
187 o.affectedUsersCount = "foo"; | 187 o.affectedUsersCount = "foo"; |
188 o.count = "foo"; | 188 o.count = "foo"; |
189 o.firstSeenTime = "foo"; | 189 o.firstSeenTime = "foo"; |
190 o.group = buildErrorGroup(); | 190 o.group = buildErrorGroup(); |
191 o.lastSeenTime = "foo"; | 191 o.lastSeenTime = "foo"; |
192 o.numAffectedServices = 42; | 192 o.numAffectedServices = 42; |
193 o.representative = buildErrorEvent(); | 193 o.representative = buildErrorEvent(); |
194 o.timedCounts = buildUnnamed3289(); | 194 o.timedCounts = buildUnnamed3381(); |
195 } | 195 } |
196 buildCounterErrorGroupStats--; | 196 buildCounterErrorGroupStats--; |
197 return o; | 197 return o; |
198 } | 198 } |
199 | 199 |
200 checkErrorGroupStats(api.ErrorGroupStats o) { | 200 checkErrorGroupStats(api.ErrorGroupStats o) { |
201 buildCounterErrorGroupStats++; | 201 buildCounterErrorGroupStats++; |
202 if (buildCounterErrorGroupStats < 3) { | 202 if (buildCounterErrorGroupStats < 3) { |
203 checkUnnamed3288(o.affectedServices); | 203 checkUnnamed3380(o.affectedServices); |
204 unittest.expect(o.affectedUsersCount, unittest.equals('foo')); | 204 unittest.expect(o.affectedUsersCount, unittest.equals('foo')); |
205 unittest.expect(o.count, unittest.equals('foo')); | 205 unittest.expect(o.count, unittest.equals('foo')); |
206 unittest.expect(o.firstSeenTime, unittest.equals('foo')); | 206 unittest.expect(o.firstSeenTime, unittest.equals('foo')); |
207 checkErrorGroup(o.group); | 207 checkErrorGroup(o.group); |
208 unittest.expect(o.lastSeenTime, unittest.equals('foo')); | 208 unittest.expect(o.lastSeenTime, unittest.equals('foo')); |
209 unittest.expect(o.numAffectedServices, unittest.equals(42)); | 209 unittest.expect(o.numAffectedServices, unittest.equals(42)); |
210 checkErrorEvent(o.representative); | 210 checkErrorEvent(o.representative); |
211 checkUnnamed3289(o.timedCounts); | 211 checkUnnamed3381(o.timedCounts); |
212 } | 212 } |
213 buildCounterErrorGroupStats--; | 213 buildCounterErrorGroupStats--; |
214 } | 214 } |
215 | 215 |
216 core.int buildCounterHttpRequestContext = 0; | 216 core.int buildCounterHttpRequestContext = 0; |
217 buildHttpRequestContext() { | 217 buildHttpRequestContext() { |
218 var o = new api.HttpRequestContext(); | 218 var o = new api.HttpRequestContext(); |
219 buildCounterHttpRequestContext++; | 219 buildCounterHttpRequestContext++; |
220 if (buildCounterHttpRequestContext < 3) { | 220 if (buildCounterHttpRequestContext < 3) { |
221 o.method = "foo"; | 221 o.method = "foo"; |
(...skipping 13 matching lines...) Expand all Loading... |
235 unittest.expect(o.method, unittest.equals('foo')); | 235 unittest.expect(o.method, unittest.equals('foo')); |
236 unittest.expect(o.referrer, unittest.equals('foo')); | 236 unittest.expect(o.referrer, unittest.equals('foo')); |
237 unittest.expect(o.remoteIp, unittest.equals('foo')); | 237 unittest.expect(o.remoteIp, unittest.equals('foo')); |
238 unittest.expect(o.responseStatusCode, unittest.equals(42)); | 238 unittest.expect(o.responseStatusCode, unittest.equals(42)); |
239 unittest.expect(o.url, unittest.equals('foo')); | 239 unittest.expect(o.url, unittest.equals('foo')); |
240 unittest.expect(o.userAgent, unittest.equals('foo')); | 240 unittest.expect(o.userAgent, unittest.equals('foo')); |
241 } | 241 } |
242 buildCounterHttpRequestContext--; | 242 buildCounterHttpRequestContext--; |
243 } | 243 } |
244 | 244 |
245 buildUnnamed3290() { | 245 buildUnnamed3382() { |
246 var o = new core.List<api.ErrorEvent>(); | 246 var o = new core.List<api.ErrorEvent>(); |
247 o.add(buildErrorEvent()); | 247 o.add(buildErrorEvent()); |
248 o.add(buildErrorEvent()); | 248 o.add(buildErrorEvent()); |
249 return o; | 249 return o; |
250 } | 250 } |
251 | 251 |
252 checkUnnamed3290(core.List<api.ErrorEvent> o) { | 252 checkUnnamed3382(core.List<api.ErrorEvent> o) { |
253 unittest.expect(o, unittest.hasLength(2)); | 253 unittest.expect(o, unittest.hasLength(2)); |
254 checkErrorEvent(o[0]); | 254 checkErrorEvent(o[0]); |
255 checkErrorEvent(o[1]); | 255 checkErrorEvent(o[1]); |
256 } | 256 } |
257 | 257 |
258 core.int buildCounterListEventsResponse = 0; | 258 core.int buildCounterListEventsResponse = 0; |
259 buildListEventsResponse() { | 259 buildListEventsResponse() { |
260 var o = new api.ListEventsResponse(); | 260 var o = new api.ListEventsResponse(); |
261 buildCounterListEventsResponse++; | 261 buildCounterListEventsResponse++; |
262 if (buildCounterListEventsResponse < 3) { | 262 if (buildCounterListEventsResponse < 3) { |
263 o.errorEvents = buildUnnamed3290(); | 263 o.errorEvents = buildUnnamed3382(); |
264 o.nextPageToken = "foo"; | 264 o.nextPageToken = "foo"; |
265 o.timeRangeBegin = "foo"; | 265 o.timeRangeBegin = "foo"; |
266 } | 266 } |
267 buildCounterListEventsResponse--; | 267 buildCounterListEventsResponse--; |
268 return o; | 268 return o; |
269 } | 269 } |
270 | 270 |
271 checkListEventsResponse(api.ListEventsResponse o) { | 271 checkListEventsResponse(api.ListEventsResponse o) { |
272 buildCounterListEventsResponse++; | 272 buildCounterListEventsResponse++; |
273 if (buildCounterListEventsResponse < 3) { | 273 if (buildCounterListEventsResponse < 3) { |
274 checkUnnamed3290(o.errorEvents); | 274 checkUnnamed3382(o.errorEvents); |
275 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 275 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
276 unittest.expect(o.timeRangeBegin, unittest.equals('foo')); | 276 unittest.expect(o.timeRangeBegin, unittest.equals('foo')); |
277 } | 277 } |
278 buildCounterListEventsResponse--; | 278 buildCounterListEventsResponse--; |
279 } | 279 } |
280 | 280 |
281 buildUnnamed3291() { | 281 buildUnnamed3383() { |
282 var o = new core.List<api.ErrorGroupStats>(); | 282 var o = new core.List<api.ErrorGroupStats>(); |
283 o.add(buildErrorGroupStats()); | 283 o.add(buildErrorGroupStats()); |
284 o.add(buildErrorGroupStats()); | 284 o.add(buildErrorGroupStats()); |
285 return o; | 285 return o; |
286 } | 286 } |
287 | 287 |
288 checkUnnamed3291(core.List<api.ErrorGroupStats> o) { | 288 checkUnnamed3383(core.List<api.ErrorGroupStats> o) { |
289 unittest.expect(o, unittest.hasLength(2)); | 289 unittest.expect(o, unittest.hasLength(2)); |
290 checkErrorGroupStats(o[0]); | 290 checkErrorGroupStats(o[0]); |
291 checkErrorGroupStats(o[1]); | 291 checkErrorGroupStats(o[1]); |
292 } | 292 } |
293 | 293 |
294 core.int buildCounterListGroupStatsResponse = 0; | 294 core.int buildCounterListGroupStatsResponse = 0; |
295 buildListGroupStatsResponse() { | 295 buildListGroupStatsResponse() { |
296 var o = new api.ListGroupStatsResponse(); | 296 var o = new api.ListGroupStatsResponse(); |
297 buildCounterListGroupStatsResponse++; | 297 buildCounterListGroupStatsResponse++; |
298 if (buildCounterListGroupStatsResponse < 3) { | 298 if (buildCounterListGroupStatsResponse < 3) { |
299 o.errorGroupStats = buildUnnamed3291(); | 299 o.errorGroupStats = buildUnnamed3383(); |
300 o.nextPageToken = "foo"; | 300 o.nextPageToken = "foo"; |
301 o.timeRangeBegin = "foo"; | 301 o.timeRangeBegin = "foo"; |
302 } | 302 } |
303 buildCounterListGroupStatsResponse--; | 303 buildCounterListGroupStatsResponse--; |
304 return o; | 304 return o; |
305 } | 305 } |
306 | 306 |
307 checkListGroupStatsResponse(api.ListGroupStatsResponse o) { | 307 checkListGroupStatsResponse(api.ListGroupStatsResponse o) { |
308 buildCounterListGroupStatsResponse++; | 308 buildCounterListGroupStatsResponse++; |
309 if (buildCounterListGroupStatsResponse < 3) { | 309 if (buildCounterListGroupStatsResponse < 3) { |
310 checkUnnamed3291(o.errorGroupStats); | 310 checkUnnamed3383(o.errorGroupStats); |
311 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 311 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
312 unittest.expect(o.timeRangeBegin, unittest.equals('foo')); | 312 unittest.expect(o.timeRangeBegin, unittest.equals('foo')); |
313 } | 313 } |
314 buildCounterListGroupStatsResponse--; | 314 buildCounterListGroupStatsResponse--; |
315 } | 315 } |
316 | 316 |
317 core.int buildCounterReportErrorEventResponse = 0; | 317 core.int buildCounterReportErrorEventResponse = 0; |
318 buildReportErrorEventResponse() { | 318 buildReportErrorEventResponse() { |
319 var o = new api.ReportErrorEventResponse(); | 319 var o = new api.ReportErrorEventResponse(); |
320 buildCounterReportErrorEventResponse++; | 320 buildCounterReportErrorEventResponse++; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 437 } |
438 | 438 |
439 checkTrackingIssue(api.TrackingIssue o) { | 439 checkTrackingIssue(api.TrackingIssue o) { |
440 buildCounterTrackingIssue++; | 440 buildCounterTrackingIssue++; |
441 if (buildCounterTrackingIssue < 3) { | 441 if (buildCounterTrackingIssue < 3) { |
442 unittest.expect(o.url, unittest.equals('foo')); | 442 unittest.expect(o.url, unittest.equals('foo')); |
443 } | 443 } |
444 buildCounterTrackingIssue--; | 444 buildCounterTrackingIssue--; |
445 } | 445 } |
446 | 446 |
447 buildUnnamed3292() { | 447 buildUnnamed3384() { |
448 var o = new core.List<core.String>(); | 448 var o = new core.List<core.String>(); |
449 o.add("foo"); | 449 o.add("foo"); |
450 o.add("foo"); | 450 o.add("foo"); |
451 return o; | 451 return o; |
452 } | 452 } |
453 | 453 |
454 checkUnnamed3292(core.List<core.String> o) { | 454 checkUnnamed3384(core.List<core.String> o) { |
455 unittest.expect(o, unittest.hasLength(2)); | 455 unittest.expect(o, unittest.hasLength(2)); |
456 unittest.expect(o[0], unittest.equals('foo')); | 456 unittest.expect(o[0], unittest.equals('foo')); |
457 unittest.expect(o[1], unittest.equals('foo')); | 457 unittest.expect(o[1], unittest.equals('foo')); |
458 } | 458 } |
459 | 459 |
460 | 460 |
461 main() { | 461 main() { |
462 unittest.group("obj-schema-DeleteEventsResponse", () { | 462 unittest.group("obj-schema-DeleteEventsResponse", () { |
463 unittest.test("to-json--from-json", () { | 463 unittest.test("to-json--from-json", () { |
464 var o = buildDeleteEventsResponse(); | 464 var o = buildDeleteEventsResponse(); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 633 |
634 }); | 634 }); |
635 | 635 |
636 | 636 |
637 unittest.group("resource-ProjectsEventsResourceApi", () { | 637 unittest.group("resource-ProjectsEventsResourceApi", () { |
638 unittest.test("method--list", () { | 638 unittest.test("method--list", () { |
639 | 639 |
640 var mock = new HttpServerMock(); | 640 var mock = new HttpServerMock(); |
641 api.ProjectsEventsResourceApi res = new api.ClouderrorreportingApi(mock).p
rojects.events; | 641 api.ProjectsEventsResourceApi res = new api.ClouderrorreportingApi(mock).p
rojects.events; |
642 var arg_projectName = "foo"; | 642 var arg_projectName = "foo"; |
| 643 var arg_serviceFilter_resourceType = "foo"; |
643 var arg_timeRange_period = "foo"; | 644 var arg_timeRange_period = "foo"; |
644 var arg_serviceFilter_resourceType = "foo"; | 645 var arg_groupId = "foo"; |
| 646 var arg_pageToken = "foo"; |
645 var arg_serviceFilter_service = "foo"; | 647 var arg_serviceFilter_service = "foo"; |
646 var arg_groupId = "foo"; | 648 var arg_pageSize = 42; |
647 var arg_serviceFilter_version = "foo"; | 649 var arg_serviceFilter_version = "foo"; |
648 var arg_pageSize = 42; | |
649 var arg_pageToken = "foo"; | |
650 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 650 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
651 var path = (req.url).path; | 651 var path = (req.url).path; |
652 var pathOffset = 0; | 652 var pathOffset = 0; |
653 var index; | 653 var index; |
654 var subPart; | 654 var subPart; |
655 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 655 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
656 pathOffset += 1; | 656 pathOffset += 1; |
657 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 657 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
658 pathOffset += 8; | 658 pathOffset += 8; |
659 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 659 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
660 | 660 |
661 var query = (req.url).query; | 661 var query = (req.url).query; |
662 var queryOffset = 0; | 662 var queryOffset = 0; |
663 var queryMap = {}; | 663 var queryMap = {}; |
664 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 664 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
665 parseBool(n) { | 665 parseBool(n) { |
666 if (n == "true") return true; | 666 if (n == "true") return true; |
667 if (n == "false") return false; | 667 if (n == "false") return false; |
668 if (n == null) return null; | 668 if (n == null) return null; |
669 throw new core.ArgumentError("Invalid boolean: $n"); | 669 throw new core.ArgumentError("Invalid boolean: $n"); |
670 } | 670 } |
671 if (query.length > 0) { | 671 if (query.length > 0) { |
672 for (var part in query.split("&")) { | 672 for (var part in query.split("&")) { |
673 var keyvalue = part.split("="); | 673 var keyvalue = part.split("="); |
674 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 674 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
675 } | 675 } |
676 } | 676 } |
| 677 unittest.expect(queryMap["serviceFilter.resourceType"].first, unittest.e
quals(arg_serviceFilter_resourceType)); |
677 unittest.expect(queryMap["timeRange.period"].first, unittest.equals(arg_
timeRange_period)); | 678 unittest.expect(queryMap["timeRange.period"].first, unittest.equals(arg_
timeRange_period)); |
678 unittest.expect(queryMap["serviceFilter.resourceType"].first, unittest.e
quals(arg_serviceFilter_resourceType)); | 679 unittest.expect(queryMap["groupId"].first, unittest.equals(arg_groupId))
; |
| 680 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
679 unittest.expect(queryMap["serviceFilter.service"].first, unittest.equals
(arg_serviceFilter_service)); | 681 unittest.expect(queryMap["serviceFilter.service"].first, unittest.equals
(arg_serviceFilter_service)); |
680 unittest.expect(queryMap["groupId"].first, unittest.equals(arg_groupId))
; | 682 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
681 unittest.expect(queryMap["serviceFilter.version"].first, unittest.equals
(arg_serviceFilter_version)); | 683 unittest.expect(queryMap["serviceFilter.version"].first, unittest.equals
(arg_serviceFilter_version)); |
682 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
683 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
684 | 684 |
685 | 685 |
686 var h = { | 686 var h = { |
687 "content-type" : "application/json; charset=utf-8", | 687 "content-type" : "application/json; charset=utf-8", |
688 }; | 688 }; |
689 var resp = convert.JSON.encode(buildListEventsResponse()); | 689 var resp = convert.JSON.encode(buildListEventsResponse()); |
690 return new async.Future.value(stringResponse(200, h, resp)); | 690 return new async.Future.value(stringResponse(200, h, resp)); |
691 }), true); | 691 }), true); |
692 res.list(arg_projectName, timeRange_period: arg_timeRange_period, serviceF
ilter_resourceType: arg_serviceFilter_resourceType, serviceFilter_service: arg_s
erviceFilter_service, groupId: arg_groupId, serviceFilter_version: arg_serviceFi
lter_version, pageSize: arg_pageSize, pageToken: arg_pageToken).then(unittest.ex
pectAsync(((api.ListEventsResponse response) { | 692 res.list(arg_projectName, serviceFilter_resourceType: arg_serviceFilter_re
sourceType, timeRange_period: arg_timeRange_period, groupId: arg_groupId, pageTo
ken: arg_pageToken, serviceFilter_service: arg_serviceFilter_service, pageSize:
arg_pageSize, serviceFilter_version: arg_serviceFilter_version).then(unittest.ex
pectAsync(((api.ListEventsResponse response) { |
693 checkListEventsResponse(response); | 693 checkListEventsResponse(response); |
694 }))); | 694 }))); |
695 }); | 695 }); |
696 | 696 |
697 unittest.test("method--report", () { | 697 unittest.test("method--report", () { |
698 | 698 |
699 var mock = new HttpServerMock(); | 699 var mock = new HttpServerMock(); |
700 api.ProjectsEventsResourceApi res = new api.ClouderrorreportingApi(mock).p
rojects.events; | 700 api.ProjectsEventsResourceApi res = new api.ClouderrorreportingApi(mock).p
rojects.events; |
701 var arg_request = buildReportedErrorEvent(); | 701 var arg_request = buildReportedErrorEvent(); |
702 var arg_projectName = "foo"; | 702 var arg_projectName = "foo"; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 745 |
746 }); | 746 }); |
747 | 747 |
748 | 748 |
749 unittest.group("resource-ProjectsGroupStatsResourceApi", () { | 749 unittest.group("resource-ProjectsGroupStatsResourceApi", () { |
750 unittest.test("method--list", () { | 750 unittest.test("method--list", () { |
751 | 751 |
752 var mock = new HttpServerMock(); | 752 var mock = new HttpServerMock(); |
753 api.ProjectsGroupStatsResourceApi res = new api.ClouderrorreportingApi(moc
k).projects.groupStats; | 753 api.ProjectsGroupStatsResourceApi res = new api.ClouderrorreportingApi(moc
k).projects.groupStats; |
754 var arg_projectName = "foo"; | 754 var arg_projectName = "foo"; |
| 755 var arg_pageToken = "foo"; |
| 756 var arg_timeRange_period = "foo"; |
755 var arg_alignment = "foo"; | 757 var arg_alignment = "foo"; |
756 var arg_timeRange_period = "foo"; | 758 var arg_groupId = buildUnnamed3384(); |
| 759 var arg_serviceFilter_service = "foo"; |
| 760 var arg_pageSize = 42; |
| 761 var arg_order = "foo"; |
| 762 var arg_serviceFilter_version = "foo"; |
| 763 var arg_alignmentTime = "foo"; |
757 var arg_serviceFilter_resourceType = "foo"; | 764 var arg_serviceFilter_resourceType = "foo"; |
758 var arg_order = "foo"; | |
759 var arg_groupId = buildUnnamed3292(); | |
760 var arg_serviceFilter_service = "foo"; | |
761 var arg_alignmentTime = "foo"; | |
762 var arg_serviceFilter_version = "foo"; | |
763 var arg_pageSize = 42; | |
764 var arg_timedCountDuration = "foo"; | 765 var arg_timedCountDuration = "foo"; |
765 var arg_pageToken = "foo"; | |
766 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 766 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
767 var path = (req.url).path; | 767 var path = (req.url).path; |
768 var pathOffset = 0; | 768 var pathOffset = 0; |
769 var index; | 769 var index; |
770 var subPart; | 770 var subPart; |
771 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 771 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
772 pathOffset += 1; | 772 pathOffset += 1; |
773 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 773 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
774 pathOffset += 8; | 774 pathOffset += 8; |
775 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 775 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
776 | 776 |
777 var query = (req.url).query; | 777 var query = (req.url).query; |
778 var queryOffset = 0; | 778 var queryOffset = 0; |
779 var queryMap = {}; | 779 var queryMap = {}; |
780 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 780 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
781 parseBool(n) { | 781 parseBool(n) { |
782 if (n == "true") return true; | 782 if (n == "true") return true; |
783 if (n == "false") return false; | 783 if (n == "false") return false; |
784 if (n == null) return null; | 784 if (n == null) return null; |
785 throw new core.ArgumentError("Invalid boolean: $n"); | 785 throw new core.ArgumentError("Invalid boolean: $n"); |
786 } | 786 } |
787 if (query.length > 0) { | 787 if (query.length > 0) { |
788 for (var part in query.split("&")) { | 788 for (var part in query.split("&")) { |
789 var keyvalue = part.split("="); | 789 var keyvalue = part.split("="); |
790 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 790 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
791 } | 791 } |
792 } | 792 } |
| 793 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 794 unittest.expect(queryMap["timeRange.period"].first, unittest.equals(arg_
timeRange_period)); |
793 unittest.expect(queryMap["alignment"].first, unittest.equals(arg_alignme
nt)); | 795 unittest.expect(queryMap["alignment"].first, unittest.equals(arg_alignme
nt)); |
794 unittest.expect(queryMap["timeRange.period"].first, unittest.equals(arg_
timeRange_period)); | |
795 unittest.expect(queryMap["serviceFilter.resourceType"].first, unittest.e
quals(arg_serviceFilter_resourceType)); | |
796 unittest.expect(queryMap["order"].first, unittest.equals(arg_order)); | |
797 unittest.expect(queryMap["groupId"], unittest.equals(arg_groupId)); | 796 unittest.expect(queryMap["groupId"], unittest.equals(arg_groupId)); |
798 unittest.expect(queryMap["serviceFilter.service"].first, unittest.equals
(arg_serviceFilter_service)); | 797 unittest.expect(queryMap["serviceFilter.service"].first, unittest.equals
(arg_serviceFilter_service)); |
| 798 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 799 unittest.expect(queryMap["order"].first, unittest.equals(arg_order)); |
| 800 unittest.expect(queryMap["serviceFilter.version"].first, unittest.equals
(arg_serviceFilter_version)); |
799 unittest.expect(queryMap["alignmentTime"].first, unittest.equals(arg_ali
gnmentTime)); | 801 unittest.expect(queryMap["alignmentTime"].first, unittest.equals(arg_ali
gnmentTime)); |
800 unittest.expect(queryMap["serviceFilter.version"].first, unittest.equals
(arg_serviceFilter_version)); | 802 unittest.expect(queryMap["serviceFilter.resourceType"].first, unittest.e
quals(arg_serviceFilter_resourceType)); |
801 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
802 unittest.expect(queryMap["timedCountDuration"].first, unittest.equals(ar
g_timedCountDuration)); | 803 unittest.expect(queryMap["timedCountDuration"].first, unittest.equals(ar
g_timedCountDuration)); |
803 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
804 | 804 |
805 | 805 |
806 var h = { | 806 var h = { |
807 "content-type" : "application/json; charset=utf-8", | 807 "content-type" : "application/json; charset=utf-8", |
808 }; | 808 }; |
809 var resp = convert.JSON.encode(buildListGroupStatsResponse()); | 809 var resp = convert.JSON.encode(buildListGroupStatsResponse()); |
810 return new async.Future.value(stringResponse(200, h, resp)); | 810 return new async.Future.value(stringResponse(200, h, resp)); |
811 }), true); | 811 }), true); |
812 res.list(arg_projectName, alignment: arg_alignment, timeRange_period: arg_
timeRange_period, serviceFilter_resourceType: arg_serviceFilter_resourceType, or
der: arg_order, groupId: arg_groupId, serviceFilter_service: arg_serviceFilter_s
ervice, alignmentTime: arg_alignmentTime, serviceFilter_version: arg_serviceFilt
er_version, pageSize: arg_pageSize, timedCountDuration: arg_timedCountDuration,
pageToken: arg_pageToken).then(unittest.expectAsync(((api.ListGroupStatsResponse
response) { | 812 res.list(arg_projectName, pageToken: arg_pageToken, timeRange_period: arg_
timeRange_period, alignment: arg_alignment, groupId: arg_groupId, serviceFilter_
service: arg_serviceFilter_service, pageSize: arg_pageSize, order: arg_order, se
rviceFilter_version: arg_serviceFilter_version, alignmentTime: arg_alignmentTime
, serviceFilter_resourceType: arg_serviceFilter_resourceType, timedCountDuration
: arg_timedCountDuration).then(unittest.expectAsync(((api.ListGroupStatsResponse
response) { |
813 checkListGroupStatsResponse(response); | 813 checkListGroupStatsResponse(response); |
814 }))); | 814 }))); |
815 }); | 815 }); |
816 | 816 |
817 }); | 817 }); |
818 | 818 |
819 | 819 |
820 unittest.group("resource-ProjectsGroupsResourceApi", () { | 820 unittest.group("resource-ProjectsGroupsResourceApi", () { |
821 unittest.test("method--get", () { | 821 unittest.test("method--get", () { |
822 | 822 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 res.update(arg_request, arg_name).then(unittest.expectAsync(((api.ErrorGro
up response) { | 910 res.update(arg_request, arg_name).then(unittest.expectAsync(((api.ErrorGro
up response) { |
911 checkErrorGroup(response); | 911 checkErrorGroup(response); |
912 }))); | 912 }))); |
913 }); | 913 }); |
914 | 914 |
915 }); | 915 }); |
916 | 916 |
917 | 917 |
918 } | 918 } |
919 | 919 |
OLD | NEW |