OLD | NEW |
1 library googleapis.logging.v2.test; | 1 library googleapis.logging.v2.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:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis/logging/v2.dart' as api; | 12 import 'package:googleapis/logging/v2.dart' as api; |
13 | 13 |
14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 15 core.Function _callback; |
16 core.bool _expectJson; | 16 core.bool _expectJson; |
17 | 17 |
18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 19 _callback = callback; |
20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 core.int buildCounterEmpty = 0; | 54 core.int buildCounterEmpty = 0; |
55 buildEmpty() { | 55 buildEmpty() { |
56 var o = new api.Empty(); | 56 var o = new api.Empty(); |
57 buildCounterEmpty++; | 57 buildCounterEmpty++; |
58 if (buildCounterEmpty < 3) { | 58 if (buildCounterEmpty < 3) { |
59 } | 59 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 checkLabelDescriptor(api.LabelDescriptor o) { | 129 checkLabelDescriptor(api.LabelDescriptor o) { |
130 buildCounterLabelDescriptor++; | 130 buildCounterLabelDescriptor++; |
131 if (buildCounterLabelDescriptor < 3) { | 131 if (buildCounterLabelDescriptor < 3) { |
132 unittest.expect(o.description, unittest.equals('foo')); | 132 unittest.expect(o.description, unittest.equals('foo')); |
133 unittest.expect(o.key, unittest.equals('foo')); | 133 unittest.expect(o.key, unittest.equals('foo')); |
134 unittest.expect(o.valueType, unittest.equals('foo')); | 134 unittest.expect(o.valueType, unittest.equals('foo')); |
135 } | 135 } |
136 buildCounterLabelDescriptor--; | 136 buildCounterLabelDescriptor--; |
137 } | 137 } |
138 | 138 |
139 buildUnnamed198() { | 139 buildUnnamed200() { |
140 var o = new core.List<core.String>(); | 140 var o = new core.List<core.String>(); |
141 o.add("foo"); | 141 o.add("foo"); |
142 o.add("foo"); | 142 o.add("foo"); |
143 return o; | 143 return o; |
144 } | 144 } |
145 | 145 |
146 checkUnnamed198(core.List<core.String> o) { | 146 checkUnnamed200(core.List<core.String> o) { |
147 unittest.expect(o, unittest.hasLength(2)); | 147 unittest.expect(o, unittest.hasLength(2)); |
148 unittest.expect(o[0], unittest.equals('foo')); | 148 unittest.expect(o[0], unittest.equals('foo')); |
149 unittest.expect(o[1], unittest.equals('foo')); | 149 unittest.expect(o[1], unittest.equals('foo')); |
150 } | 150 } |
151 | 151 |
152 buildUnnamed199() { | 152 buildUnnamed201() { |
153 var o = new core.List<core.String>(); | 153 var o = new core.List<core.String>(); |
154 o.add("foo"); | 154 o.add("foo"); |
155 o.add("foo"); | 155 o.add("foo"); |
156 return o; | 156 return o; |
157 } | 157 } |
158 | 158 |
159 checkUnnamed199(core.List<core.String> o) { | 159 checkUnnamed201(core.List<core.String> o) { |
160 unittest.expect(o, unittest.hasLength(2)); | 160 unittest.expect(o, unittest.hasLength(2)); |
161 unittest.expect(o[0], unittest.equals('foo')); | 161 unittest.expect(o[0], unittest.equals('foo')); |
162 unittest.expect(o[1], unittest.equals('foo')); | 162 unittest.expect(o[1], unittest.equals('foo')); |
163 } | 163 } |
164 | 164 |
165 core.int buildCounterListLogEntriesRequest = 0; | 165 core.int buildCounterListLogEntriesRequest = 0; |
166 buildListLogEntriesRequest() { | 166 buildListLogEntriesRequest() { |
167 var o = new api.ListLogEntriesRequest(); | 167 var o = new api.ListLogEntriesRequest(); |
168 buildCounterListLogEntriesRequest++; | 168 buildCounterListLogEntriesRequest++; |
169 if (buildCounterListLogEntriesRequest < 3) { | 169 if (buildCounterListLogEntriesRequest < 3) { |
170 o.filter = "foo"; | 170 o.filter = "foo"; |
171 o.orderBy = "foo"; | 171 o.orderBy = "foo"; |
172 o.pageSize = 42; | 172 o.pageSize = 42; |
173 o.pageToken = "foo"; | 173 o.pageToken = "foo"; |
174 o.projectIds = buildUnnamed198(); | 174 o.projectIds = buildUnnamed200(); |
175 o.resourceNames = buildUnnamed199(); | 175 o.resourceNames = buildUnnamed201(); |
176 } | 176 } |
177 buildCounterListLogEntriesRequest--; | 177 buildCounterListLogEntriesRequest--; |
178 return o; | 178 return o; |
179 } | 179 } |
180 | 180 |
181 checkListLogEntriesRequest(api.ListLogEntriesRequest o) { | 181 checkListLogEntriesRequest(api.ListLogEntriesRequest o) { |
182 buildCounterListLogEntriesRequest++; | 182 buildCounterListLogEntriesRequest++; |
183 if (buildCounterListLogEntriesRequest < 3) { | 183 if (buildCounterListLogEntriesRequest < 3) { |
184 unittest.expect(o.filter, unittest.equals('foo')); | 184 unittest.expect(o.filter, unittest.equals('foo')); |
185 unittest.expect(o.orderBy, unittest.equals('foo')); | 185 unittest.expect(o.orderBy, unittest.equals('foo')); |
186 unittest.expect(o.pageSize, unittest.equals(42)); | 186 unittest.expect(o.pageSize, unittest.equals(42)); |
187 unittest.expect(o.pageToken, unittest.equals('foo')); | 187 unittest.expect(o.pageToken, unittest.equals('foo')); |
188 checkUnnamed198(o.projectIds); | 188 checkUnnamed200(o.projectIds); |
189 checkUnnamed199(o.resourceNames); | 189 checkUnnamed201(o.resourceNames); |
190 } | 190 } |
191 buildCounterListLogEntriesRequest--; | 191 buildCounterListLogEntriesRequest--; |
192 } | 192 } |
193 | 193 |
194 buildUnnamed200() { | 194 buildUnnamed202() { |
195 var o = new core.List<api.LogEntry>(); | 195 var o = new core.List<api.LogEntry>(); |
196 o.add(buildLogEntry()); | 196 o.add(buildLogEntry()); |
197 o.add(buildLogEntry()); | 197 o.add(buildLogEntry()); |
198 return o; | 198 return o; |
199 } | 199 } |
200 | 200 |
201 checkUnnamed200(core.List<api.LogEntry> o) { | 201 checkUnnamed202(core.List<api.LogEntry> o) { |
202 unittest.expect(o, unittest.hasLength(2)); | 202 unittest.expect(o, unittest.hasLength(2)); |
203 checkLogEntry(o[0]); | 203 checkLogEntry(o[0]); |
204 checkLogEntry(o[1]); | 204 checkLogEntry(o[1]); |
205 } | 205 } |
206 | 206 |
207 core.int buildCounterListLogEntriesResponse = 0; | 207 core.int buildCounterListLogEntriesResponse = 0; |
208 buildListLogEntriesResponse() { | 208 buildListLogEntriesResponse() { |
209 var o = new api.ListLogEntriesResponse(); | 209 var o = new api.ListLogEntriesResponse(); |
210 buildCounterListLogEntriesResponse++; | 210 buildCounterListLogEntriesResponse++; |
211 if (buildCounterListLogEntriesResponse < 3) { | 211 if (buildCounterListLogEntriesResponse < 3) { |
212 o.entries = buildUnnamed200(); | 212 o.entries = buildUnnamed202(); |
213 o.nextPageToken = "foo"; | 213 o.nextPageToken = "foo"; |
214 } | 214 } |
215 buildCounterListLogEntriesResponse--; | 215 buildCounterListLogEntriesResponse--; |
216 return o; | 216 return o; |
217 } | 217 } |
218 | 218 |
219 checkListLogEntriesResponse(api.ListLogEntriesResponse o) { | 219 checkListLogEntriesResponse(api.ListLogEntriesResponse o) { |
220 buildCounterListLogEntriesResponse++; | 220 buildCounterListLogEntriesResponse++; |
221 if (buildCounterListLogEntriesResponse < 3) { | 221 if (buildCounterListLogEntriesResponse < 3) { |
222 checkUnnamed200(o.entries); | 222 checkUnnamed202(o.entries); |
223 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 223 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
224 } | 224 } |
225 buildCounterListLogEntriesResponse--; | 225 buildCounterListLogEntriesResponse--; |
226 } | 226 } |
227 | 227 |
228 buildUnnamed201() { | 228 buildUnnamed203() { |
229 var o = new core.List<api.LogMetric>(); | 229 var o = new core.List<api.LogMetric>(); |
230 o.add(buildLogMetric()); | 230 o.add(buildLogMetric()); |
231 o.add(buildLogMetric()); | 231 o.add(buildLogMetric()); |
232 return o; | 232 return o; |
233 } | 233 } |
234 | 234 |
235 checkUnnamed201(core.List<api.LogMetric> o) { | 235 checkUnnamed203(core.List<api.LogMetric> o) { |
236 unittest.expect(o, unittest.hasLength(2)); | 236 unittest.expect(o, unittest.hasLength(2)); |
237 checkLogMetric(o[0]); | 237 checkLogMetric(o[0]); |
238 checkLogMetric(o[1]); | 238 checkLogMetric(o[1]); |
239 } | 239 } |
240 | 240 |
241 core.int buildCounterListLogMetricsResponse = 0; | 241 core.int buildCounterListLogMetricsResponse = 0; |
242 buildListLogMetricsResponse() { | 242 buildListLogMetricsResponse() { |
243 var o = new api.ListLogMetricsResponse(); | 243 var o = new api.ListLogMetricsResponse(); |
244 buildCounterListLogMetricsResponse++; | 244 buildCounterListLogMetricsResponse++; |
245 if (buildCounterListLogMetricsResponse < 3) { | 245 if (buildCounterListLogMetricsResponse < 3) { |
246 o.metrics = buildUnnamed201(); | 246 o.metrics = buildUnnamed203(); |
247 o.nextPageToken = "foo"; | 247 o.nextPageToken = "foo"; |
248 } | 248 } |
249 buildCounterListLogMetricsResponse--; | 249 buildCounterListLogMetricsResponse--; |
250 return o; | 250 return o; |
251 } | 251 } |
252 | 252 |
253 checkListLogMetricsResponse(api.ListLogMetricsResponse o) { | 253 checkListLogMetricsResponse(api.ListLogMetricsResponse o) { |
254 buildCounterListLogMetricsResponse++; | 254 buildCounterListLogMetricsResponse++; |
255 if (buildCounterListLogMetricsResponse < 3) { | 255 if (buildCounterListLogMetricsResponse < 3) { |
256 checkUnnamed201(o.metrics); | 256 checkUnnamed203(o.metrics); |
257 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 257 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
258 } | 258 } |
259 buildCounterListLogMetricsResponse--; | 259 buildCounterListLogMetricsResponse--; |
260 } | 260 } |
261 | 261 |
262 buildUnnamed202() { | 262 buildUnnamed204() { |
263 var o = new core.List<core.String>(); | 263 var o = new core.List<core.String>(); |
264 o.add("foo"); | 264 o.add("foo"); |
265 o.add("foo"); | 265 o.add("foo"); |
266 return o; | 266 return o; |
267 } | 267 } |
268 | 268 |
269 checkUnnamed202(core.List<core.String> o) { | 269 checkUnnamed204(core.List<core.String> o) { |
270 unittest.expect(o, unittest.hasLength(2)); | 270 unittest.expect(o, unittest.hasLength(2)); |
271 unittest.expect(o[0], unittest.equals('foo')); | 271 unittest.expect(o[0], unittest.equals('foo')); |
272 unittest.expect(o[1], unittest.equals('foo')); | 272 unittest.expect(o[1], unittest.equals('foo')); |
273 } | 273 } |
274 | 274 |
275 core.int buildCounterListLogsResponse = 0; | 275 core.int buildCounterListLogsResponse = 0; |
276 buildListLogsResponse() { | 276 buildListLogsResponse() { |
277 var o = new api.ListLogsResponse(); | 277 var o = new api.ListLogsResponse(); |
278 buildCounterListLogsResponse++; | 278 buildCounterListLogsResponse++; |
279 if (buildCounterListLogsResponse < 3) { | 279 if (buildCounterListLogsResponse < 3) { |
280 o.logNames = buildUnnamed202(); | 280 o.logNames = buildUnnamed204(); |
281 o.nextPageToken = "foo"; | 281 o.nextPageToken = "foo"; |
282 } | 282 } |
283 buildCounterListLogsResponse--; | 283 buildCounterListLogsResponse--; |
284 return o; | 284 return o; |
285 } | 285 } |
286 | 286 |
287 checkListLogsResponse(api.ListLogsResponse o) { | 287 checkListLogsResponse(api.ListLogsResponse o) { |
288 buildCounterListLogsResponse++; | 288 buildCounterListLogsResponse++; |
289 if (buildCounterListLogsResponse < 3) { | 289 if (buildCounterListLogsResponse < 3) { |
290 checkUnnamed202(o.logNames); | 290 checkUnnamed204(o.logNames); |
291 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 291 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
292 } | 292 } |
293 buildCounterListLogsResponse--; | 293 buildCounterListLogsResponse--; |
294 } | 294 } |
295 | 295 |
296 buildUnnamed203() { | 296 buildUnnamed205() { |
297 var o = new core.List<api.MonitoredResourceDescriptor>(); | 297 var o = new core.List<api.MonitoredResourceDescriptor>(); |
298 o.add(buildMonitoredResourceDescriptor()); | 298 o.add(buildMonitoredResourceDescriptor()); |
299 o.add(buildMonitoredResourceDescriptor()); | 299 o.add(buildMonitoredResourceDescriptor()); |
300 return o; | 300 return o; |
301 } | 301 } |
302 | 302 |
303 checkUnnamed203(core.List<api.MonitoredResourceDescriptor> o) { | 303 checkUnnamed205(core.List<api.MonitoredResourceDescriptor> o) { |
304 unittest.expect(o, unittest.hasLength(2)); | 304 unittest.expect(o, unittest.hasLength(2)); |
305 checkMonitoredResourceDescriptor(o[0]); | 305 checkMonitoredResourceDescriptor(o[0]); |
306 checkMonitoredResourceDescriptor(o[1]); | 306 checkMonitoredResourceDescriptor(o[1]); |
307 } | 307 } |
308 | 308 |
309 core.int buildCounterListMonitoredResourceDescriptorsResponse = 0; | 309 core.int buildCounterListMonitoredResourceDescriptorsResponse = 0; |
310 buildListMonitoredResourceDescriptorsResponse() { | 310 buildListMonitoredResourceDescriptorsResponse() { |
311 var o = new api.ListMonitoredResourceDescriptorsResponse(); | 311 var o = new api.ListMonitoredResourceDescriptorsResponse(); |
312 buildCounterListMonitoredResourceDescriptorsResponse++; | 312 buildCounterListMonitoredResourceDescriptorsResponse++; |
313 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { | 313 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { |
314 o.nextPageToken = "foo"; | 314 o.nextPageToken = "foo"; |
315 o.resourceDescriptors = buildUnnamed203(); | 315 o.resourceDescriptors = buildUnnamed205(); |
316 } | 316 } |
317 buildCounterListMonitoredResourceDescriptorsResponse--; | 317 buildCounterListMonitoredResourceDescriptorsResponse--; |
318 return o; | 318 return o; |
319 } | 319 } |
320 | 320 |
321 checkListMonitoredResourceDescriptorsResponse(api.ListMonitoredResourceDescripto
rsResponse o) { | 321 checkListMonitoredResourceDescriptorsResponse(api.ListMonitoredResourceDescripto
rsResponse o) { |
322 buildCounterListMonitoredResourceDescriptorsResponse++; | 322 buildCounterListMonitoredResourceDescriptorsResponse++; |
323 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { | 323 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { |
324 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 324 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
325 checkUnnamed203(o.resourceDescriptors); | 325 checkUnnamed205(o.resourceDescriptors); |
326 } | 326 } |
327 buildCounterListMonitoredResourceDescriptorsResponse--; | 327 buildCounterListMonitoredResourceDescriptorsResponse--; |
328 } | 328 } |
329 | 329 |
330 buildUnnamed204() { | 330 buildUnnamed206() { |
331 var o = new core.List<api.LogSink>(); | 331 var o = new core.List<api.LogSink>(); |
332 o.add(buildLogSink()); | 332 o.add(buildLogSink()); |
333 o.add(buildLogSink()); | 333 o.add(buildLogSink()); |
334 return o; | 334 return o; |
335 } | 335 } |
336 | 336 |
337 checkUnnamed204(core.List<api.LogSink> o) { | 337 checkUnnamed206(core.List<api.LogSink> o) { |
338 unittest.expect(o, unittest.hasLength(2)); | 338 unittest.expect(o, unittest.hasLength(2)); |
339 checkLogSink(o[0]); | 339 checkLogSink(o[0]); |
340 checkLogSink(o[1]); | 340 checkLogSink(o[1]); |
341 } | 341 } |
342 | 342 |
343 core.int buildCounterListSinksResponse = 0; | 343 core.int buildCounterListSinksResponse = 0; |
344 buildListSinksResponse() { | 344 buildListSinksResponse() { |
345 var o = new api.ListSinksResponse(); | 345 var o = new api.ListSinksResponse(); |
346 buildCounterListSinksResponse++; | 346 buildCounterListSinksResponse++; |
347 if (buildCounterListSinksResponse < 3) { | 347 if (buildCounterListSinksResponse < 3) { |
348 o.nextPageToken = "foo"; | 348 o.nextPageToken = "foo"; |
349 o.sinks = buildUnnamed204(); | 349 o.sinks = buildUnnamed206(); |
350 } | 350 } |
351 buildCounterListSinksResponse--; | 351 buildCounterListSinksResponse--; |
352 return o; | 352 return o; |
353 } | 353 } |
354 | 354 |
355 checkListSinksResponse(api.ListSinksResponse o) { | 355 checkListSinksResponse(api.ListSinksResponse o) { |
356 buildCounterListSinksResponse++; | 356 buildCounterListSinksResponse++; |
357 if (buildCounterListSinksResponse < 3) { | 357 if (buildCounterListSinksResponse < 3) { |
358 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 358 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
359 checkUnnamed204(o.sinks); | 359 checkUnnamed206(o.sinks); |
360 } | 360 } |
361 buildCounterListSinksResponse--; | 361 buildCounterListSinksResponse--; |
362 } | 362 } |
363 | 363 |
364 buildUnnamed205() { | |
365 var o = new core.Map<core.String, core.Object>(); | |
366 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
367 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | |
368 return o; | |
369 } | |
370 | |
371 checkUnnamed205(core.Map<core.String, core.Object> o) { | |
372 unittest.expect(o, unittest.hasLength(2)); | |
373 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | |
374 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | |
375 } | |
376 | |
377 buildUnnamed206() { | |
378 var o = new core.Map<core.String, core.String>(); | |
379 o["x"] = "foo"; | |
380 o["y"] = "foo"; | |
381 return o; | |
382 } | |
383 | |
384 checkUnnamed206(core.Map<core.String, core.String> o) { | |
385 unittest.expect(o, unittest.hasLength(2)); | |
386 unittest.expect(o["x"], unittest.equals('foo')); | |
387 unittest.expect(o["y"], unittest.equals('foo')); | |
388 } | |
389 | |
390 buildUnnamed207() { | 364 buildUnnamed207() { |
391 var o = new core.Map<core.String, core.Object>(); | 365 var o = new core.Map<core.String, core.Object>(); |
392 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 366 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
393 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 367 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
394 return o; | 368 return o; |
395 } | 369 } |
396 | 370 |
397 checkUnnamed207(core.Map<core.String, core.Object> o) { | 371 checkUnnamed207(core.Map<core.String, core.Object> o) { |
398 unittest.expect(o, unittest.hasLength(2)); | 372 unittest.expect(o, unittest.hasLength(2)); |
| 373 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
| 374 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
| 375 } |
| 376 |
| 377 buildUnnamed208() { |
| 378 var o = new core.Map<core.String, core.String>(); |
| 379 o["x"] = "foo"; |
| 380 o["y"] = "foo"; |
| 381 return o; |
| 382 } |
| 383 |
| 384 checkUnnamed208(core.Map<core.String, core.String> o) { |
| 385 unittest.expect(o, unittest.hasLength(2)); |
| 386 unittest.expect(o["x"], unittest.equals('foo')); |
| 387 unittest.expect(o["y"], unittest.equals('foo')); |
| 388 } |
| 389 |
| 390 buildUnnamed209() { |
| 391 var o = new core.Map<core.String, core.Object>(); |
| 392 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 393 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 394 return o; |
| 395 } |
| 396 |
| 397 checkUnnamed209(core.Map<core.String, core.Object> o) { |
| 398 unittest.expect(o, unittest.hasLength(2)); |
399 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 399 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
400 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 400 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
401 } | 401 } |
402 | 402 |
403 core.int buildCounterLogEntry = 0; | 403 core.int buildCounterLogEntry = 0; |
404 buildLogEntry() { | 404 buildLogEntry() { |
405 var o = new api.LogEntry(); | 405 var o = new api.LogEntry(); |
406 buildCounterLogEntry++; | 406 buildCounterLogEntry++; |
407 if (buildCounterLogEntry < 3) { | 407 if (buildCounterLogEntry < 3) { |
408 o.httpRequest = buildHttpRequest(); | 408 o.httpRequest = buildHttpRequest(); |
409 o.insertId = "foo"; | 409 o.insertId = "foo"; |
410 o.jsonPayload = buildUnnamed205(); | 410 o.jsonPayload = buildUnnamed207(); |
411 o.labels = buildUnnamed206(); | 411 o.labels = buildUnnamed208(); |
412 o.logName = "foo"; | 412 o.logName = "foo"; |
413 o.operation = buildLogEntryOperation(); | 413 o.operation = buildLogEntryOperation(); |
414 o.protoPayload = buildUnnamed207(); | 414 o.protoPayload = buildUnnamed209(); |
415 o.receiveTimestamp = "foo"; | 415 o.receiveTimestamp = "foo"; |
416 o.resource = buildMonitoredResource(); | 416 o.resource = buildMonitoredResource(); |
417 o.severity = "foo"; | 417 o.severity = "foo"; |
418 o.sourceLocation = buildLogEntrySourceLocation(); | 418 o.sourceLocation = buildLogEntrySourceLocation(); |
419 o.textPayload = "foo"; | 419 o.textPayload = "foo"; |
420 o.timestamp = "foo"; | 420 o.timestamp = "foo"; |
421 o.trace = "foo"; | 421 o.trace = "foo"; |
422 } | 422 } |
423 buildCounterLogEntry--; | 423 buildCounterLogEntry--; |
424 return o; | 424 return o; |
425 } | 425 } |
426 | 426 |
427 checkLogEntry(api.LogEntry o) { | 427 checkLogEntry(api.LogEntry o) { |
428 buildCounterLogEntry++; | 428 buildCounterLogEntry++; |
429 if (buildCounterLogEntry < 3) { | 429 if (buildCounterLogEntry < 3) { |
430 checkHttpRequest(o.httpRequest); | 430 checkHttpRequest(o.httpRequest); |
431 unittest.expect(o.insertId, unittest.equals('foo')); | 431 unittest.expect(o.insertId, unittest.equals('foo')); |
432 checkUnnamed205(o.jsonPayload); | 432 checkUnnamed207(o.jsonPayload); |
433 checkUnnamed206(o.labels); | 433 checkUnnamed208(o.labels); |
434 unittest.expect(o.logName, unittest.equals('foo')); | 434 unittest.expect(o.logName, unittest.equals('foo')); |
435 checkLogEntryOperation(o.operation); | 435 checkLogEntryOperation(o.operation); |
436 checkUnnamed207(o.protoPayload); | 436 checkUnnamed209(o.protoPayload); |
437 unittest.expect(o.receiveTimestamp, unittest.equals('foo')); | 437 unittest.expect(o.receiveTimestamp, unittest.equals('foo')); |
438 checkMonitoredResource(o.resource); | 438 checkMonitoredResource(o.resource); |
439 unittest.expect(o.severity, unittest.equals('foo')); | 439 unittest.expect(o.severity, unittest.equals('foo')); |
440 checkLogEntrySourceLocation(o.sourceLocation); | 440 checkLogEntrySourceLocation(o.sourceLocation); |
441 unittest.expect(o.textPayload, unittest.equals('foo')); | 441 unittest.expect(o.textPayload, unittest.equals('foo')); |
442 unittest.expect(o.timestamp, unittest.equals('foo')); | 442 unittest.expect(o.timestamp, unittest.equals('foo')); |
443 unittest.expect(o.trace, unittest.equals('foo')); | 443 unittest.expect(o.trace, unittest.equals('foo')); |
444 } | 444 } |
445 buildCounterLogEntry--; | 445 buildCounterLogEntry--; |
446 } | 446 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 unittest.expect(o.filter, unittest.equals('foo')); | 569 unittest.expect(o.filter, unittest.equals('foo')); |
570 unittest.expect(o.includeChildren, unittest.isTrue); | 570 unittest.expect(o.includeChildren, unittest.isTrue); |
571 unittest.expect(o.name, unittest.equals('foo')); | 571 unittest.expect(o.name, unittest.equals('foo')); |
572 unittest.expect(o.outputVersionFormat, unittest.equals('foo')); | 572 unittest.expect(o.outputVersionFormat, unittest.equals('foo')); |
573 unittest.expect(o.startTime, unittest.equals('foo')); | 573 unittest.expect(o.startTime, unittest.equals('foo')); |
574 unittest.expect(o.writerIdentity, unittest.equals('foo')); | 574 unittest.expect(o.writerIdentity, unittest.equals('foo')); |
575 } | 575 } |
576 buildCounterLogSink--; | 576 buildCounterLogSink--; |
577 } | 577 } |
578 | 578 |
579 buildUnnamed208() { | 579 buildUnnamed210() { |
580 var o = new core.Map<core.String, core.String>(); | 580 var o = new core.Map<core.String, core.String>(); |
581 o["x"] = "foo"; | 581 o["x"] = "foo"; |
582 o["y"] = "foo"; | 582 o["y"] = "foo"; |
583 return o; | 583 return o; |
584 } | 584 } |
585 | 585 |
586 checkUnnamed208(core.Map<core.String, core.String> o) { | 586 checkUnnamed210(core.Map<core.String, core.String> o) { |
587 unittest.expect(o, unittest.hasLength(2)); | 587 unittest.expect(o, unittest.hasLength(2)); |
588 unittest.expect(o["x"], unittest.equals('foo')); | 588 unittest.expect(o["x"], unittest.equals('foo')); |
589 unittest.expect(o["y"], unittest.equals('foo')); | 589 unittest.expect(o["y"], unittest.equals('foo')); |
590 } | 590 } |
591 | 591 |
592 core.int buildCounterMonitoredResource = 0; | 592 core.int buildCounterMonitoredResource = 0; |
593 buildMonitoredResource() { | 593 buildMonitoredResource() { |
594 var o = new api.MonitoredResource(); | 594 var o = new api.MonitoredResource(); |
595 buildCounterMonitoredResource++; | 595 buildCounterMonitoredResource++; |
596 if (buildCounterMonitoredResource < 3) { | 596 if (buildCounterMonitoredResource < 3) { |
597 o.labels = buildUnnamed208(); | 597 o.labels = buildUnnamed210(); |
598 o.type = "foo"; | 598 o.type = "foo"; |
599 } | 599 } |
600 buildCounterMonitoredResource--; | 600 buildCounterMonitoredResource--; |
601 return o; | 601 return o; |
602 } | 602 } |
603 | 603 |
604 checkMonitoredResource(api.MonitoredResource o) { | 604 checkMonitoredResource(api.MonitoredResource o) { |
605 buildCounterMonitoredResource++; | 605 buildCounterMonitoredResource++; |
606 if (buildCounterMonitoredResource < 3) { | 606 if (buildCounterMonitoredResource < 3) { |
607 checkUnnamed208(o.labels); | 607 checkUnnamed210(o.labels); |
608 unittest.expect(o.type, unittest.equals('foo')); | 608 unittest.expect(o.type, unittest.equals('foo')); |
609 } | 609 } |
610 buildCounterMonitoredResource--; | 610 buildCounterMonitoredResource--; |
611 } | 611 } |
612 | 612 |
613 buildUnnamed209() { | 613 buildUnnamed211() { |
614 var o = new core.List<api.LabelDescriptor>(); | 614 var o = new core.List<api.LabelDescriptor>(); |
615 o.add(buildLabelDescriptor()); | 615 o.add(buildLabelDescriptor()); |
616 o.add(buildLabelDescriptor()); | 616 o.add(buildLabelDescriptor()); |
617 return o; | 617 return o; |
618 } | 618 } |
619 | 619 |
620 checkUnnamed209(core.List<api.LabelDescriptor> o) { | 620 checkUnnamed211(core.List<api.LabelDescriptor> o) { |
621 unittest.expect(o, unittest.hasLength(2)); | 621 unittest.expect(o, unittest.hasLength(2)); |
622 checkLabelDescriptor(o[0]); | 622 checkLabelDescriptor(o[0]); |
623 checkLabelDescriptor(o[1]); | 623 checkLabelDescriptor(o[1]); |
624 } | 624 } |
625 | 625 |
626 core.int buildCounterMonitoredResourceDescriptor = 0; | 626 core.int buildCounterMonitoredResourceDescriptor = 0; |
627 buildMonitoredResourceDescriptor() { | 627 buildMonitoredResourceDescriptor() { |
628 var o = new api.MonitoredResourceDescriptor(); | 628 var o = new api.MonitoredResourceDescriptor(); |
629 buildCounterMonitoredResourceDescriptor++; | 629 buildCounterMonitoredResourceDescriptor++; |
630 if (buildCounterMonitoredResourceDescriptor < 3) { | 630 if (buildCounterMonitoredResourceDescriptor < 3) { |
631 o.description = "foo"; | 631 o.description = "foo"; |
632 o.displayName = "foo"; | 632 o.displayName = "foo"; |
633 o.labels = buildUnnamed209(); | 633 o.labels = buildUnnamed211(); |
634 o.name = "foo"; | 634 o.name = "foo"; |
635 o.type = "foo"; | 635 o.type = "foo"; |
636 } | 636 } |
637 buildCounterMonitoredResourceDescriptor--; | 637 buildCounterMonitoredResourceDescriptor--; |
638 return o; | 638 return o; |
639 } | 639 } |
640 | 640 |
641 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { | 641 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { |
642 buildCounterMonitoredResourceDescriptor++; | 642 buildCounterMonitoredResourceDescriptor++; |
643 if (buildCounterMonitoredResourceDescriptor < 3) { | 643 if (buildCounterMonitoredResourceDescriptor < 3) { |
644 unittest.expect(o.description, unittest.equals('foo')); | 644 unittest.expect(o.description, unittest.equals('foo')); |
645 unittest.expect(o.displayName, unittest.equals('foo')); | 645 unittest.expect(o.displayName, unittest.equals('foo')); |
646 checkUnnamed209(o.labels); | 646 checkUnnamed211(o.labels); |
647 unittest.expect(o.name, unittest.equals('foo')); | 647 unittest.expect(o.name, unittest.equals('foo')); |
648 unittest.expect(o.type, unittest.equals('foo')); | 648 unittest.expect(o.type, unittest.equals('foo')); |
649 } | 649 } |
650 buildCounterMonitoredResourceDescriptor--; | 650 buildCounterMonitoredResourceDescriptor--; |
651 } | 651 } |
652 | 652 |
653 buildUnnamed210() { | 653 buildUnnamed212() { |
654 var o = new core.List<api.LogLine>(); | 654 var o = new core.List<api.LogLine>(); |
655 o.add(buildLogLine()); | 655 o.add(buildLogLine()); |
656 o.add(buildLogLine()); | 656 o.add(buildLogLine()); |
657 return o; | 657 return o; |
658 } | 658 } |
659 | 659 |
660 checkUnnamed210(core.List<api.LogLine> o) { | 660 checkUnnamed212(core.List<api.LogLine> o) { |
661 unittest.expect(o, unittest.hasLength(2)); | 661 unittest.expect(o, unittest.hasLength(2)); |
662 checkLogLine(o[0]); | 662 checkLogLine(o[0]); |
663 checkLogLine(o[1]); | 663 checkLogLine(o[1]); |
664 } | 664 } |
665 | 665 |
666 buildUnnamed211() { | 666 buildUnnamed213() { |
667 var o = new core.List<api.SourceReference>(); | 667 var o = new core.List<api.SourceReference>(); |
668 o.add(buildSourceReference()); | 668 o.add(buildSourceReference()); |
669 o.add(buildSourceReference()); | 669 o.add(buildSourceReference()); |
670 return o; | 670 return o; |
671 } | 671 } |
672 | 672 |
673 checkUnnamed211(core.List<api.SourceReference> o) { | 673 checkUnnamed213(core.List<api.SourceReference> o) { |
674 unittest.expect(o, unittest.hasLength(2)); | 674 unittest.expect(o, unittest.hasLength(2)); |
675 checkSourceReference(o[0]); | 675 checkSourceReference(o[0]); |
676 checkSourceReference(o[1]); | 676 checkSourceReference(o[1]); |
677 } | 677 } |
678 | 678 |
679 core.int buildCounterRequestLog = 0; | 679 core.int buildCounterRequestLog = 0; |
680 buildRequestLog() { | 680 buildRequestLog() { |
681 var o = new api.RequestLog(); | 681 var o = new api.RequestLog(); |
682 buildCounterRequestLog++; | 682 buildCounterRequestLog++; |
683 if (buildCounterRequestLog < 3) { | 683 if (buildCounterRequestLog < 3) { |
684 o.appEngineRelease = "foo"; | 684 o.appEngineRelease = "foo"; |
685 o.appId = "foo"; | 685 o.appId = "foo"; |
686 o.cost = 42.0; | 686 o.cost = 42.0; |
687 o.endTime = "foo"; | 687 o.endTime = "foo"; |
688 o.finished = true; | 688 o.finished = true; |
689 o.first = true; | 689 o.first = true; |
690 o.host = "foo"; | 690 o.host = "foo"; |
691 o.httpVersion = "foo"; | 691 o.httpVersion = "foo"; |
692 o.instanceId = "foo"; | 692 o.instanceId = "foo"; |
693 o.instanceIndex = 42; | 693 o.instanceIndex = 42; |
694 o.ip = "foo"; | 694 o.ip = "foo"; |
695 o.latency = "foo"; | 695 o.latency = "foo"; |
696 o.line = buildUnnamed210(); | 696 o.line = buildUnnamed212(); |
697 o.megaCycles = "foo"; | 697 o.megaCycles = "foo"; |
698 o.method = "foo"; | 698 o.method = "foo"; |
699 o.moduleId = "foo"; | 699 o.moduleId = "foo"; |
700 o.nickname = "foo"; | 700 o.nickname = "foo"; |
701 o.pendingTime = "foo"; | 701 o.pendingTime = "foo"; |
702 o.referrer = "foo"; | 702 o.referrer = "foo"; |
703 o.requestId = "foo"; | 703 o.requestId = "foo"; |
704 o.resource = "foo"; | 704 o.resource = "foo"; |
705 o.responseSize = "foo"; | 705 o.responseSize = "foo"; |
706 o.sourceReference = buildUnnamed211(); | 706 o.sourceReference = buildUnnamed213(); |
707 o.startTime = "foo"; | 707 o.startTime = "foo"; |
708 o.status = 42; | 708 o.status = 42; |
709 o.taskName = "foo"; | 709 o.taskName = "foo"; |
710 o.taskQueueName = "foo"; | 710 o.taskQueueName = "foo"; |
711 o.traceId = "foo"; | 711 o.traceId = "foo"; |
712 o.urlMapEntry = "foo"; | 712 o.urlMapEntry = "foo"; |
713 o.userAgent = "foo"; | 713 o.userAgent = "foo"; |
714 o.versionId = "foo"; | 714 o.versionId = "foo"; |
715 o.wasLoadingRequest = true; | 715 o.wasLoadingRequest = true; |
716 } | 716 } |
717 buildCounterRequestLog--; | 717 buildCounterRequestLog--; |
718 return o; | 718 return o; |
719 } | 719 } |
720 | 720 |
721 checkRequestLog(api.RequestLog o) { | 721 checkRequestLog(api.RequestLog o) { |
722 buildCounterRequestLog++; | 722 buildCounterRequestLog++; |
723 if (buildCounterRequestLog < 3) { | 723 if (buildCounterRequestLog < 3) { |
724 unittest.expect(o.appEngineRelease, unittest.equals('foo')); | 724 unittest.expect(o.appEngineRelease, unittest.equals('foo')); |
725 unittest.expect(o.appId, unittest.equals('foo')); | 725 unittest.expect(o.appId, unittest.equals('foo')); |
726 unittest.expect(o.cost, unittest.equals(42.0)); | 726 unittest.expect(o.cost, unittest.equals(42.0)); |
727 unittest.expect(o.endTime, unittest.equals('foo')); | 727 unittest.expect(o.endTime, unittest.equals('foo')); |
728 unittest.expect(o.finished, unittest.isTrue); | 728 unittest.expect(o.finished, unittest.isTrue); |
729 unittest.expect(o.first, unittest.isTrue); | 729 unittest.expect(o.first, unittest.isTrue); |
730 unittest.expect(o.host, unittest.equals('foo')); | 730 unittest.expect(o.host, unittest.equals('foo')); |
731 unittest.expect(o.httpVersion, unittest.equals('foo')); | 731 unittest.expect(o.httpVersion, unittest.equals('foo')); |
732 unittest.expect(o.instanceId, unittest.equals('foo')); | 732 unittest.expect(o.instanceId, unittest.equals('foo')); |
733 unittest.expect(o.instanceIndex, unittest.equals(42)); | 733 unittest.expect(o.instanceIndex, unittest.equals(42)); |
734 unittest.expect(o.ip, unittest.equals('foo')); | 734 unittest.expect(o.ip, unittest.equals('foo')); |
735 unittest.expect(o.latency, unittest.equals('foo')); | 735 unittest.expect(o.latency, unittest.equals('foo')); |
736 checkUnnamed210(o.line); | 736 checkUnnamed212(o.line); |
737 unittest.expect(o.megaCycles, unittest.equals('foo')); | 737 unittest.expect(o.megaCycles, unittest.equals('foo')); |
738 unittest.expect(o.method, unittest.equals('foo')); | 738 unittest.expect(o.method, unittest.equals('foo')); |
739 unittest.expect(o.moduleId, unittest.equals('foo')); | 739 unittest.expect(o.moduleId, unittest.equals('foo')); |
740 unittest.expect(o.nickname, unittest.equals('foo')); | 740 unittest.expect(o.nickname, unittest.equals('foo')); |
741 unittest.expect(o.pendingTime, unittest.equals('foo')); | 741 unittest.expect(o.pendingTime, unittest.equals('foo')); |
742 unittest.expect(o.referrer, unittest.equals('foo')); | 742 unittest.expect(o.referrer, unittest.equals('foo')); |
743 unittest.expect(o.requestId, unittest.equals('foo')); | 743 unittest.expect(o.requestId, unittest.equals('foo')); |
744 unittest.expect(o.resource, unittest.equals('foo')); | 744 unittest.expect(o.resource, unittest.equals('foo')); |
745 unittest.expect(o.responseSize, unittest.equals('foo')); | 745 unittest.expect(o.responseSize, unittest.equals('foo')); |
746 checkUnnamed211(o.sourceReference); | 746 checkUnnamed213(o.sourceReference); |
747 unittest.expect(o.startTime, unittest.equals('foo')); | 747 unittest.expect(o.startTime, unittest.equals('foo')); |
748 unittest.expect(o.status, unittest.equals(42)); | 748 unittest.expect(o.status, unittest.equals(42)); |
749 unittest.expect(o.taskName, unittest.equals('foo')); | 749 unittest.expect(o.taskName, unittest.equals('foo')); |
750 unittest.expect(o.taskQueueName, unittest.equals('foo')); | 750 unittest.expect(o.taskQueueName, unittest.equals('foo')); |
751 unittest.expect(o.traceId, unittest.equals('foo')); | 751 unittest.expect(o.traceId, unittest.equals('foo')); |
752 unittest.expect(o.urlMapEntry, unittest.equals('foo')); | 752 unittest.expect(o.urlMapEntry, unittest.equals('foo')); |
753 unittest.expect(o.userAgent, unittest.equals('foo')); | 753 unittest.expect(o.userAgent, unittest.equals('foo')); |
754 unittest.expect(o.versionId, unittest.equals('foo')); | 754 unittest.expect(o.versionId, unittest.equals('foo')); |
755 unittest.expect(o.wasLoadingRequest, unittest.isTrue); | 755 unittest.expect(o.wasLoadingRequest, unittest.isTrue); |
756 } | 756 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 794 |
795 checkSourceReference(api.SourceReference o) { | 795 checkSourceReference(api.SourceReference o) { |
796 buildCounterSourceReference++; | 796 buildCounterSourceReference++; |
797 if (buildCounterSourceReference < 3) { | 797 if (buildCounterSourceReference < 3) { |
798 unittest.expect(o.repository, unittest.equals('foo')); | 798 unittest.expect(o.repository, unittest.equals('foo')); |
799 unittest.expect(o.revisionId, unittest.equals('foo')); | 799 unittest.expect(o.revisionId, unittest.equals('foo')); |
800 } | 800 } |
801 buildCounterSourceReference--; | 801 buildCounterSourceReference--; |
802 } | 802 } |
803 | 803 |
804 buildUnnamed212() { | 804 buildUnnamed214() { |
805 var o = new core.List<api.LogEntry>(); | 805 var o = new core.List<api.LogEntry>(); |
806 o.add(buildLogEntry()); | 806 o.add(buildLogEntry()); |
807 o.add(buildLogEntry()); | 807 o.add(buildLogEntry()); |
808 return o; | 808 return o; |
809 } | 809 } |
810 | 810 |
811 checkUnnamed212(core.List<api.LogEntry> o) { | 811 checkUnnamed214(core.List<api.LogEntry> o) { |
812 unittest.expect(o, unittest.hasLength(2)); | 812 unittest.expect(o, unittest.hasLength(2)); |
813 checkLogEntry(o[0]); | 813 checkLogEntry(o[0]); |
814 checkLogEntry(o[1]); | 814 checkLogEntry(o[1]); |
815 } | 815 } |
816 | 816 |
817 buildUnnamed213() { | 817 buildUnnamed215() { |
818 var o = new core.Map<core.String, core.String>(); | 818 var o = new core.Map<core.String, core.String>(); |
819 o["x"] = "foo"; | 819 o["x"] = "foo"; |
820 o["y"] = "foo"; | 820 o["y"] = "foo"; |
821 return o; | 821 return o; |
822 } | 822 } |
823 | 823 |
824 checkUnnamed213(core.Map<core.String, core.String> o) { | 824 checkUnnamed215(core.Map<core.String, core.String> o) { |
825 unittest.expect(o, unittest.hasLength(2)); | 825 unittest.expect(o, unittest.hasLength(2)); |
826 unittest.expect(o["x"], unittest.equals('foo')); | 826 unittest.expect(o["x"], unittest.equals('foo')); |
827 unittest.expect(o["y"], unittest.equals('foo')); | 827 unittest.expect(o["y"], unittest.equals('foo')); |
828 } | 828 } |
829 | 829 |
830 core.int buildCounterWriteLogEntriesRequest = 0; | 830 core.int buildCounterWriteLogEntriesRequest = 0; |
831 buildWriteLogEntriesRequest() { | 831 buildWriteLogEntriesRequest() { |
832 var o = new api.WriteLogEntriesRequest(); | 832 var o = new api.WriteLogEntriesRequest(); |
833 buildCounterWriteLogEntriesRequest++; | 833 buildCounterWriteLogEntriesRequest++; |
834 if (buildCounterWriteLogEntriesRequest < 3) { | 834 if (buildCounterWriteLogEntriesRequest < 3) { |
835 o.entries = buildUnnamed212(); | 835 o.entries = buildUnnamed214(); |
836 o.labels = buildUnnamed213(); | 836 o.labels = buildUnnamed215(); |
837 o.logName = "foo"; | 837 o.logName = "foo"; |
838 o.partialSuccess = true; | 838 o.partialSuccess = true; |
839 o.resource = buildMonitoredResource(); | 839 o.resource = buildMonitoredResource(); |
840 } | 840 } |
841 buildCounterWriteLogEntriesRequest--; | 841 buildCounterWriteLogEntriesRequest--; |
842 return o; | 842 return o; |
843 } | 843 } |
844 | 844 |
845 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { | 845 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { |
846 buildCounterWriteLogEntriesRequest++; | 846 buildCounterWriteLogEntriesRequest++; |
847 if (buildCounterWriteLogEntriesRequest < 3) { | 847 if (buildCounterWriteLogEntriesRequest < 3) { |
848 checkUnnamed212(o.entries); | 848 checkUnnamed214(o.entries); |
849 checkUnnamed213(o.labels); | 849 checkUnnamed215(o.labels); |
850 unittest.expect(o.logName, unittest.equals('foo')); | 850 unittest.expect(o.logName, unittest.equals('foo')); |
851 unittest.expect(o.partialSuccess, unittest.isTrue); | 851 unittest.expect(o.partialSuccess, unittest.isTrue); |
852 checkMonitoredResource(o.resource); | 852 checkMonitoredResource(o.resource); |
853 } | 853 } |
854 buildCounterWriteLogEntriesRequest--; | 854 buildCounterWriteLogEntriesRequest--; |
855 } | 855 } |
856 | 856 |
857 core.int buildCounterWriteLogEntriesResponse = 0; | 857 core.int buildCounterWriteLogEntriesResponse = 0; |
858 buildWriteLogEntriesResponse() { | 858 buildWriteLogEntriesResponse() { |
859 var o = new api.WriteLogEntriesResponse(); | 859 var o = new api.WriteLogEntriesResponse(); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 }); | 1070 }); |
1071 }); | 1071 }); |
1072 | 1072 |
1073 | 1073 |
1074 unittest.group("resource-BillingAccountsLogsResourceApi", () { | 1074 unittest.group("resource-BillingAccountsLogsResourceApi", () { |
1075 unittest.test("method--delete", () { | 1075 unittest.test("method--delete", () { |
1076 | 1076 |
1077 var mock = new HttpServerMock(); | 1077 var mock = new HttpServerMock(); |
1078 api.BillingAccountsLogsResourceApi res = new api.LoggingApi(mock).billingA
ccounts.logs; | 1078 api.BillingAccountsLogsResourceApi res = new api.LoggingApi(mock).billingA
ccounts.logs; |
1079 var arg_logName = "foo"; | 1079 var arg_logName = "foo"; |
1080 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1080 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1081 var path = (req.url).path; | 1081 var path = (req.url).path; |
1082 var pathOffset = 0; | 1082 var pathOffset = 0; |
1083 var index; | 1083 var index; |
1084 var subPart; | 1084 var subPart; |
1085 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1085 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1086 pathOffset += 1; | 1086 pathOffset += 1; |
1087 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1087 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1088 pathOffset += 3; | 1088 pathOffset += 3; |
1089 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1089 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1090 | 1090 |
(...skipping 14 matching lines...) Expand all Loading... |
1105 } | 1105 } |
1106 } | 1106 } |
1107 | 1107 |
1108 | 1108 |
1109 var h = { | 1109 var h = { |
1110 "content-type" : "application/json; charset=utf-8", | 1110 "content-type" : "application/json; charset=utf-8", |
1111 }; | 1111 }; |
1112 var resp = convert.JSON.encode(buildEmpty()); | 1112 var resp = convert.JSON.encode(buildEmpty()); |
1113 return new async.Future.value(stringResponse(200, h, resp)); | 1113 return new async.Future.value(stringResponse(200, h, resp)); |
1114 }), true); | 1114 }), true); |
1115 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { | 1115 res.delete(arg_logName).then(unittest.expectAsync1(((api.Empty response) { |
1116 checkEmpty(response); | 1116 checkEmpty(response); |
1117 }))); | 1117 }))); |
1118 }); | 1118 }); |
1119 | 1119 |
1120 unittest.test("method--list", () { | 1120 unittest.test("method--list", () { |
1121 | 1121 |
1122 var mock = new HttpServerMock(); | 1122 var mock = new HttpServerMock(); |
1123 api.BillingAccountsLogsResourceApi res = new api.LoggingApi(mock).billingA
ccounts.logs; | 1123 api.BillingAccountsLogsResourceApi res = new api.LoggingApi(mock).billingA
ccounts.logs; |
1124 var arg_parent = "foo"; | 1124 var arg_parent = "foo"; |
1125 var arg_pageToken = "foo"; | 1125 var arg_pageToken = "foo"; |
1126 var arg_pageSize = 42; | 1126 var arg_pageSize = 42; |
1127 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1127 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1128 var path = (req.url).path; | 1128 var path = (req.url).path; |
1129 var pathOffset = 0; | 1129 var pathOffset = 0; |
1130 var index; | 1130 var index; |
1131 var subPart; | 1131 var subPart; |
1132 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1132 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1133 pathOffset += 1; | 1133 pathOffset += 1; |
1134 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1134 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1135 pathOffset += 3; | 1135 pathOffset += 3; |
1136 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1136 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1137 | 1137 |
(...skipping 16 matching lines...) Expand all Loading... |
1154 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1154 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1155 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1155 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1156 | 1156 |
1157 | 1157 |
1158 var h = { | 1158 var h = { |
1159 "content-type" : "application/json; charset=utf-8", | 1159 "content-type" : "application/json; charset=utf-8", |
1160 }; | 1160 }; |
1161 var resp = convert.JSON.encode(buildListLogsResponse()); | 1161 var resp = convert.JSON.encode(buildListLogsResponse()); |
1162 return new async.Future.value(stringResponse(200, h, resp)); | 1162 return new async.Future.value(stringResponse(200, h, resp)); |
1163 }), true); | 1163 }), true); |
1164 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListLogsResponse response) { | 1164 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListLogsResponse response) { |
1165 checkListLogsResponse(response); | 1165 checkListLogsResponse(response); |
1166 }))); | 1166 }))); |
1167 }); | 1167 }); |
1168 | 1168 |
1169 }); | 1169 }); |
1170 | 1170 |
1171 | 1171 |
1172 unittest.group("resource-BillingAccountsSinksResourceApi", () { | 1172 unittest.group("resource-BillingAccountsSinksResourceApi", () { |
1173 unittest.test("method--create", () { | 1173 unittest.test("method--create", () { |
1174 | 1174 |
1175 var mock = new HttpServerMock(); | 1175 var mock = new HttpServerMock(); |
1176 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1176 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
1177 var arg_request = buildLogSink(); | 1177 var arg_request = buildLogSink(); |
1178 var arg_parent = "foo"; | 1178 var arg_parent = "foo"; |
1179 var arg_uniqueWriterIdentity = true; | 1179 var arg_uniqueWriterIdentity = true; |
1180 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1180 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1181 var obj = new api.LogSink.fromJson(json); | 1181 var obj = new api.LogSink.fromJson(json); |
1182 checkLogSink(obj); | 1182 checkLogSink(obj); |
1183 | 1183 |
1184 var path = (req.url).path; | 1184 var path = (req.url).path; |
1185 var pathOffset = 0; | 1185 var pathOffset = 0; |
1186 var index; | 1186 var index; |
1187 var subPart; | 1187 var subPart; |
1188 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1188 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1189 pathOffset += 1; | 1189 pathOffset += 1; |
1190 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1190 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
1209 } | 1209 } |
1210 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 1210 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
1211 | 1211 |
1212 | 1212 |
1213 var h = { | 1213 var h = { |
1214 "content-type" : "application/json; charset=utf-8", | 1214 "content-type" : "application/json; charset=utf-8", |
1215 }; | 1215 }; |
1216 var resp = convert.JSON.encode(buildLogSink()); | 1216 var resp = convert.JSON.encode(buildLogSink()); |
1217 return new async.Future.value(stringResponse(200, h, resp)); | 1217 return new async.Future.value(stringResponse(200, h, resp)); |
1218 }), true); | 1218 }), true); |
1219 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync(((api.LogSink response) { | 1219 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync1(((api.LogSink response) { |
1220 checkLogSink(response); | 1220 checkLogSink(response); |
1221 }))); | 1221 }))); |
1222 }); | 1222 }); |
1223 | 1223 |
1224 unittest.test("method--delete", () { | 1224 unittest.test("method--delete", () { |
1225 | 1225 |
1226 var mock = new HttpServerMock(); | 1226 var mock = new HttpServerMock(); |
1227 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1227 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
1228 var arg_sinkName = "foo"; | 1228 var arg_sinkName = "foo"; |
1229 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1229 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1230 var path = (req.url).path; | 1230 var path = (req.url).path; |
1231 var pathOffset = 0; | 1231 var pathOffset = 0; |
1232 var index; | 1232 var index; |
1233 var subPart; | 1233 var subPart; |
1234 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1234 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1235 pathOffset += 1; | 1235 pathOffset += 1; |
1236 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1236 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1237 pathOffset += 3; | 1237 pathOffset += 3; |
1238 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1238 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1239 | 1239 |
(...skipping 14 matching lines...) Expand all Loading... |
1254 } | 1254 } |
1255 } | 1255 } |
1256 | 1256 |
1257 | 1257 |
1258 var h = { | 1258 var h = { |
1259 "content-type" : "application/json; charset=utf-8", | 1259 "content-type" : "application/json; charset=utf-8", |
1260 }; | 1260 }; |
1261 var resp = convert.JSON.encode(buildEmpty()); | 1261 var resp = convert.JSON.encode(buildEmpty()); |
1262 return new async.Future.value(stringResponse(200, h, resp)); | 1262 return new async.Future.value(stringResponse(200, h, resp)); |
1263 }), true); | 1263 }), true); |
1264 res.delete(arg_sinkName).then(unittest.expectAsync(((api.Empty response) { | 1264 res.delete(arg_sinkName).then(unittest.expectAsync1(((api.Empty response)
{ |
1265 checkEmpty(response); | 1265 checkEmpty(response); |
1266 }))); | 1266 }))); |
1267 }); | 1267 }); |
1268 | 1268 |
1269 unittest.test("method--get", () { | 1269 unittest.test("method--get", () { |
1270 | 1270 |
1271 var mock = new HttpServerMock(); | 1271 var mock = new HttpServerMock(); |
1272 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1272 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
1273 var arg_sinkName = "foo"; | 1273 var arg_sinkName = "foo"; |
1274 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1274 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1275 var path = (req.url).path; | 1275 var path = (req.url).path; |
1276 var pathOffset = 0; | 1276 var pathOffset = 0; |
1277 var index; | 1277 var index; |
1278 var subPart; | 1278 var subPart; |
1279 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1279 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1280 pathOffset += 1; | 1280 pathOffset += 1; |
1281 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1281 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1282 pathOffset += 3; | 1282 pathOffset += 3; |
1283 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1283 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1284 | 1284 |
(...skipping 14 matching lines...) Expand all Loading... |
1299 } | 1299 } |
1300 } | 1300 } |
1301 | 1301 |
1302 | 1302 |
1303 var h = { | 1303 var h = { |
1304 "content-type" : "application/json; charset=utf-8", | 1304 "content-type" : "application/json; charset=utf-8", |
1305 }; | 1305 }; |
1306 var resp = convert.JSON.encode(buildLogSink()); | 1306 var resp = convert.JSON.encode(buildLogSink()); |
1307 return new async.Future.value(stringResponse(200, h, resp)); | 1307 return new async.Future.value(stringResponse(200, h, resp)); |
1308 }), true); | 1308 }), true); |
1309 res.get(arg_sinkName).then(unittest.expectAsync(((api.LogSink response) { | 1309 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { |
1310 checkLogSink(response); | 1310 checkLogSink(response); |
1311 }))); | 1311 }))); |
1312 }); | 1312 }); |
1313 | 1313 |
1314 unittest.test("method--list", () { | 1314 unittest.test("method--list", () { |
1315 | 1315 |
1316 var mock = new HttpServerMock(); | 1316 var mock = new HttpServerMock(); |
1317 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1317 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
1318 var arg_parent = "foo"; | 1318 var arg_parent = "foo"; |
1319 var arg_pageToken = "foo"; | 1319 var arg_pageToken = "foo"; |
1320 var arg_pageSize = 42; | 1320 var arg_pageSize = 42; |
1321 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1321 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1322 var path = (req.url).path; | 1322 var path = (req.url).path; |
1323 var pathOffset = 0; | 1323 var pathOffset = 0; |
1324 var index; | 1324 var index; |
1325 var subPart; | 1325 var subPart; |
1326 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1326 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1327 pathOffset += 1; | 1327 pathOffset += 1; |
1328 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1328 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1329 pathOffset += 3; | 1329 pathOffset += 3; |
1330 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1330 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1331 | 1331 |
(...skipping 16 matching lines...) Expand all Loading... |
1348 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1348 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1349 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1349 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1350 | 1350 |
1351 | 1351 |
1352 var h = { | 1352 var h = { |
1353 "content-type" : "application/json; charset=utf-8", | 1353 "content-type" : "application/json; charset=utf-8", |
1354 }; | 1354 }; |
1355 var resp = convert.JSON.encode(buildListSinksResponse()); | 1355 var resp = convert.JSON.encode(buildListSinksResponse()); |
1356 return new async.Future.value(stringResponse(200, h, resp)); | 1356 return new async.Future.value(stringResponse(200, h, resp)); |
1357 }), true); | 1357 }), true); |
1358 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListSinksResponse response) { | 1358 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
1359 checkListSinksResponse(response); | 1359 checkListSinksResponse(response); |
1360 }))); | 1360 }))); |
1361 }); | 1361 }); |
1362 | 1362 |
1363 unittest.test("method--update", () { | 1363 unittest.test("method--update", () { |
1364 | 1364 |
1365 var mock = new HttpServerMock(); | 1365 var mock = new HttpServerMock(); |
1366 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1366 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
1367 var arg_request = buildLogSink(); | 1367 var arg_request = buildLogSink(); |
1368 var arg_sinkName = "foo"; | 1368 var arg_sinkName = "foo"; |
1369 var arg_uniqueWriterIdentity = true; | 1369 var arg_uniqueWriterIdentity = true; |
1370 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1370 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1371 var obj = new api.LogSink.fromJson(json); | 1371 var obj = new api.LogSink.fromJson(json); |
1372 checkLogSink(obj); | 1372 checkLogSink(obj); |
1373 | 1373 |
1374 var path = (req.url).path; | 1374 var path = (req.url).path; |
1375 var pathOffset = 0; | 1375 var pathOffset = 0; |
1376 var index; | 1376 var index; |
1377 var subPart; | 1377 var subPart; |
1378 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1378 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1379 pathOffset += 1; | 1379 pathOffset += 1; |
1380 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1380 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
1399 } | 1399 } |
1400 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 1400 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
1401 | 1401 |
1402 | 1402 |
1403 var h = { | 1403 var h = { |
1404 "content-type" : "application/json; charset=utf-8", | 1404 "content-type" : "application/json; charset=utf-8", |
1405 }; | 1405 }; |
1406 var resp = convert.JSON.encode(buildLogSink()); | 1406 var resp = convert.JSON.encode(buildLogSink()); |
1407 return new async.Future.value(stringResponse(200, h, resp)); | 1407 return new async.Future.value(stringResponse(200, h, resp)); |
1408 }), true); | 1408 }), true); |
1409 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { | 1409 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
1410 checkLogSink(response); | 1410 checkLogSink(response); |
1411 }))); | 1411 }))); |
1412 }); | 1412 }); |
1413 | 1413 |
1414 }); | 1414 }); |
1415 | 1415 |
1416 | 1416 |
1417 unittest.group("resource-EntriesResourceApi", () { | 1417 unittest.group("resource-EntriesResourceApi", () { |
1418 unittest.test("method--list", () { | 1418 unittest.test("method--list", () { |
1419 | 1419 |
1420 var mock = new HttpServerMock(); | 1420 var mock = new HttpServerMock(); |
1421 api.EntriesResourceApi res = new api.LoggingApi(mock).entries; | 1421 api.EntriesResourceApi res = new api.LoggingApi(mock).entries; |
1422 var arg_request = buildListLogEntriesRequest(); | 1422 var arg_request = buildListLogEntriesRequest(); |
1423 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1423 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1424 var obj = new api.ListLogEntriesRequest.fromJson(json); | 1424 var obj = new api.ListLogEntriesRequest.fromJson(json); |
1425 checkListLogEntriesRequest(obj); | 1425 checkListLogEntriesRequest(obj); |
1426 | 1426 |
1427 var path = (req.url).path; | 1427 var path = (req.url).path; |
1428 var pathOffset = 0; | 1428 var pathOffset = 0; |
1429 var index; | 1429 var index; |
1430 var subPart; | 1430 var subPart; |
1431 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1431 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1432 pathOffset += 1; | 1432 pathOffset += 1; |
1433 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v2/entries:list")); | 1433 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v2/entries:list")); |
(...skipping 16 matching lines...) Expand all Loading... |
1450 } | 1450 } |
1451 } | 1451 } |
1452 | 1452 |
1453 | 1453 |
1454 var h = { | 1454 var h = { |
1455 "content-type" : "application/json; charset=utf-8", | 1455 "content-type" : "application/json; charset=utf-8", |
1456 }; | 1456 }; |
1457 var resp = convert.JSON.encode(buildListLogEntriesResponse()); | 1457 var resp = convert.JSON.encode(buildListLogEntriesResponse()); |
1458 return new async.Future.value(stringResponse(200, h, resp)); | 1458 return new async.Future.value(stringResponse(200, h, resp)); |
1459 }), true); | 1459 }), true); |
1460 res.list(arg_request).then(unittest.expectAsync(((api.ListLogEntriesRespon
se response) { | 1460 res.list(arg_request).then(unittest.expectAsync1(((api.ListLogEntriesRespo
nse response) { |
1461 checkListLogEntriesResponse(response); | 1461 checkListLogEntriesResponse(response); |
1462 }))); | 1462 }))); |
1463 }); | 1463 }); |
1464 | 1464 |
1465 unittest.test("method--write", () { | 1465 unittest.test("method--write", () { |
1466 | 1466 |
1467 var mock = new HttpServerMock(); | 1467 var mock = new HttpServerMock(); |
1468 api.EntriesResourceApi res = new api.LoggingApi(mock).entries; | 1468 api.EntriesResourceApi res = new api.LoggingApi(mock).entries; |
1469 var arg_request = buildWriteLogEntriesRequest(); | 1469 var arg_request = buildWriteLogEntriesRequest(); |
1470 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1470 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1471 var obj = new api.WriteLogEntriesRequest.fromJson(json); | 1471 var obj = new api.WriteLogEntriesRequest.fromJson(json); |
1472 checkWriteLogEntriesRequest(obj); | 1472 checkWriteLogEntriesRequest(obj); |
1473 | 1473 |
1474 var path = (req.url).path; | 1474 var path = (req.url).path; |
1475 var pathOffset = 0; | 1475 var pathOffset = 0; |
1476 var index; | 1476 var index; |
1477 var subPart; | 1477 var subPart; |
1478 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1478 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1479 pathOffset += 1; | 1479 pathOffset += 1; |
1480 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v2/entries:write")); | 1480 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v2/entries:write")); |
(...skipping 16 matching lines...) Expand all Loading... |
1497 } | 1497 } |
1498 } | 1498 } |
1499 | 1499 |
1500 | 1500 |
1501 var h = { | 1501 var h = { |
1502 "content-type" : "application/json; charset=utf-8", | 1502 "content-type" : "application/json; charset=utf-8", |
1503 }; | 1503 }; |
1504 var resp = convert.JSON.encode(buildWriteLogEntriesResponse()); | 1504 var resp = convert.JSON.encode(buildWriteLogEntriesResponse()); |
1505 return new async.Future.value(stringResponse(200, h, resp)); | 1505 return new async.Future.value(stringResponse(200, h, resp)); |
1506 }), true); | 1506 }), true); |
1507 res.write(arg_request).then(unittest.expectAsync(((api.WriteLogEntriesResp
onse response) { | 1507 res.write(arg_request).then(unittest.expectAsync1(((api.WriteLogEntriesRes
ponse response) { |
1508 checkWriteLogEntriesResponse(response); | 1508 checkWriteLogEntriesResponse(response); |
1509 }))); | 1509 }))); |
1510 }); | 1510 }); |
1511 | 1511 |
1512 }); | 1512 }); |
1513 | 1513 |
1514 | 1514 |
1515 unittest.group("resource-FoldersLogsResourceApi", () { | 1515 unittest.group("resource-FoldersLogsResourceApi", () { |
1516 unittest.test("method--delete", () { | 1516 unittest.test("method--delete", () { |
1517 | 1517 |
1518 var mock = new HttpServerMock(); | 1518 var mock = new HttpServerMock(); |
1519 api.FoldersLogsResourceApi res = new api.LoggingApi(mock).folders.logs; | 1519 api.FoldersLogsResourceApi res = new api.LoggingApi(mock).folders.logs; |
1520 var arg_logName = "foo"; | 1520 var arg_logName = "foo"; |
1521 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1521 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1522 var path = (req.url).path; | 1522 var path = (req.url).path; |
1523 var pathOffset = 0; | 1523 var pathOffset = 0; |
1524 var index; | 1524 var index; |
1525 var subPart; | 1525 var subPart; |
1526 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1526 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1527 pathOffset += 1; | 1527 pathOffset += 1; |
1528 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1528 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1529 pathOffset += 3; | 1529 pathOffset += 3; |
1530 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1530 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1531 | 1531 |
(...skipping 14 matching lines...) Expand all Loading... |
1546 } | 1546 } |
1547 } | 1547 } |
1548 | 1548 |
1549 | 1549 |
1550 var h = { | 1550 var h = { |
1551 "content-type" : "application/json; charset=utf-8", | 1551 "content-type" : "application/json; charset=utf-8", |
1552 }; | 1552 }; |
1553 var resp = convert.JSON.encode(buildEmpty()); | 1553 var resp = convert.JSON.encode(buildEmpty()); |
1554 return new async.Future.value(stringResponse(200, h, resp)); | 1554 return new async.Future.value(stringResponse(200, h, resp)); |
1555 }), true); | 1555 }), true); |
1556 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { | 1556 res.delete(arg_logName).then(unittest.expectAsync1(((api.Empty response) { |
1557 checkEmpty(response); | 1557 checkEmpty(response); |
1558 }))); | 1558 }))); |
1559 }); | 1559 }); |
1560 | 1560 |
1561 unittest.test("method--list", () { | 1561 unittest.test("method--list", () { |
1562 | 1562 |
1563 var mock = new HttpServerMock(); | 1563 var mock = new HttpServerMock(); |
1564 api.FoldersLogsResourceApi res = new api.LoggingApi(mock).folders.logs; | 1564 api.FoldersLogsResourceApi res = new api.LoggingApi(mock).folders.logs; |
1565 var arg_parent = "foo"; | 1565 var arg_parent = "foo"; |
1566 var arg_pageToken = "foo"; | 1566 var arg_pageToken = "foo"; |
1567 var arg_pageSize = 42; | 1567 var arg_pageSize = 42; |
1568 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1568 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1569 var path = (req.url).path; | 1569 var path = (req.url).path; |
1570 var pathOffset = 0; | 1570 var pathOffset = 0; |
1571 var index; | 1571 var index; |
1572 var subPart; | 1572 var subPart; |
1573 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1573 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1574 pathOffset += 1; | 1574 pathOffset += 1; |
1575 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1575 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1576 pathOffset += 3; | 1576 pathOffset += 3; |
1577 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1577 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1578 | 1578 |
(...skipping 16 matching lines...) Expand all Loading... |
1595 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1595 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1596 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1596 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1597 | 1597 |
1598 | 1598 |
1599 var h = { | 1599 var h = { |
1600 "content-type" : "application/json; charset=utf-8", | 1600 "content-type" : "application/json; charset=utf-8", |
1601 }; | 1601 }; |
1602 var resp = convert.JSON.encode(buildListLogsResponse()); | 1602 var resp = convert.JSON.encode(buildListLogsResponse()); |
1603 return new async.Future.value(stringResponse(200, h, resp)); | 1603 return new async.Future.value(stringResponse(200, h, resp)); |
1604 }), true); | 1604 }), true); |
1605 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListLogsResponse response) { | 1605 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListLogsResponse response) { |
1606 checkListLogsResponse(response); | 1606 checkListLogsResponse(response); |
1607 }))); | 1607 }))); |
1608 }); | 1608 }); |
1609 | 1609 |
1610 }); | 1610 }); |
1611 | 1611 |
1612 | 1612 |
1613 unittest.group("resource-FoldersSinksResourceApi", () { | 1613 unittest.group("resource-FoldersSinksResourceApi", () { |
1614 unittest.test("method--create", () { | 1614 unittest.test("method--create", () { |
1615 | 1615 |
1616 var mock = new HttpServerMock(); | 1616 var mock = new HttpServerMock(); |
1617 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; | 1617 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
1618 var arg_request = buildLogSink(); | 1618 var arg_request = buildLogSink(); |
1619 var arg_parent = "foo"; | 1619 var arg_parent = "foo"; |
1620 var arg_uniqueWriterIdentity = true; | 1620 var arg_uniqueWriterIdentity = true; |
1621 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1621 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1622 var obj = new api.LogSink.fromJson(json); | 1622 var obj = new api.LogSink.fromJson(json); |
1623 checkLogSink(obj); | 1623 checkLogSink(obj); |
1624 | 1624 |
1625 var path = (req.url).path; | 1625 var path = (req.url).path; |
1626 var pathOffset = 0; | 1626 var pathOffset = 0; |
1627 var index; | 1627 var index; |
1628 var subPart; | 1628 var subPart; |
1629 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1629 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1630 pathOffset += 1; | 1630 pathOffset += 1; |
1631 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1631 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
1650 } | 1650 } |
1651 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 1651 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
1652 | 1652 |
1653 | 1653 |
1654 var h = { | 1654 var h = { |
1655 "content-type" : "application/json; charset=utf-8", | 1655 "content-type" : "application/json; charset=utf-8", |
1656 }; | 1656 }; |
1657 var resp = convert.JSON.encode(buildLogSink()); | 1657 var resp = convert.JSON.encode(buildLogSink()); |
1658 return new async.Future.value(stringResponse(200, h, resp)); | 1658 return new async.Future.value(stringResponse(200, h, resp)); |
1659 }), true); | 1659 }), true); |
1660 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync(((api.LogSink response) { | 1660 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync1(((api.LogSink response) { |
1661 checkLogSink(response); | 1661 checkLogSink(response); |
1662 }))); | 1662 }))); |
1663 }); | 1663 }); |
1664 | 1664 |
1665 unittest.test("method--delete", () { | 1665 unittest.test("method--delete", () { |
1666 | 1666 |
1667 var mock = new HttpServerMock(); | 1667 var mock = new HttpServerMock(); |
1668 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; | 1668 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
1669 var arg_sinkName = "foo"; | 1669 var arg_sinkName = "foo"; |
1670 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1670 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1671 var path = (req.url).path; | 1671 var path = (req.url).path; |
1672 var pathOffset = 0; | 1672 var pathOffset = 0; |
1673 var index; | 1673 var index; |
1674 var subPart; | 1674 var subPart; |
1675 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1675 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1676 pathOffset += 1; | 1676 pathOffset += 1; |
1677 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1677 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1678 pathOffset += 3; | 1678 pathOffset += 3; |
1679 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1679 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1680 | 1680 |
(...skipping 14 matching lines...) Expand all Loading... |
1695 } | 1695 } |
1696 } | 1696 } |
1697 | 1697 |
1698 | 1698 |
1699 var h = { | 1699 var h = { |
1700 "content-type" : "application/json; charset=utf-8", | 1700 "content-type" : "application/json; charset=utf-8", |
1701 }; | 1701 }; |
1702 var resp = convert.JSON.encode(buildEmpty()); | 1702 var resp = convert.JSON.encode(buildEmpty()); |
1703 return new async.Future.value(stringResponse(200, h, resp)); | 1703 return new async.Future.value(stringResponse(200, h, resp)); |
1704 }), true); | 1704 }), true); |
1705 res.delete(arg_sinkName).then(unittest.expectAsync(((api.Empty response) { | 1705 res.delete(arg_sinkName).then(unittest.expectAsync1(((api.Empty response)
{ |
1706 checkEmpty(response); | 1706 checkEmpty(response); |
1707 }))); | 1707 }))); |
1708 }); | 1708 }); |
1709 | 1709 |
1710 unittest.test("method--get", () { | 1710 unittest.test("method--get", () { |
1711 | 1711 |
1712 var mock = new HttpServerMock(); | 1712 var mock = new HttpServerMock(); |
1713 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; | 1713 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
1714 var arg_sinkName = "foo"; | 1714 var arg_sinkName = "foo"; |
1715 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1715 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1716 var path = (req.url).path; | 1716 var path = (req.url).path; |
1717 var pathOffset = 0; | 1717 var pathOffset = 0; |
1718 var index; | 1718 var index; |
1719 var subPart; | 1719 var subPart; |
1720 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1720 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1721 pathOffset += 1; | 1721 pathOffset += 1; |
1722 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1722 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1723 pathOffset += 3; | 1723 pathOffset += 3; |
1724 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1724 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1725 | 1725 |
(...skipping 14 matching lines...) Expand all Loading... |
1740 } | 1740 } |
1741 } | 1741 } |
1742 | 1742 |
1743 | 1743 |
1744 var h = { | 1744 var h = { |
1745 "content-type" : "application/json; charset=utf-8", | 1745 "content-type" : "application/json; charset=utf-8", |
1746 }; | 1746 }; |
1747 var resp = convert.JSON.encode(buildLogSink()); | 1747 var resp = convert.JSON.encode(buildLogSink()); |
1748 return new async.Future.value(stringResponse(200, h, resp)); | 1748 return new async.Future.value(stringResponse(200, h, resp)); |
1749 }), true); | 1749 }), true); |
1750 res.get(arg_sinkName).then(unittest.expectAsync(((api.LogSink response) { | 1750 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { |
1751 checkLogSink(response); | 1751 checkLogSink(response); |
1752 }))); | 1752 }))); |
1753 }); | 1753 }); |
1754 | 1754 |
1755 unittest.test("method--list", () { | 1755 unittest.test("method--list", () { |
1756 | 1756 |
1757 var mock = new HttpServerMock(); | 1757 var mock = new HttpServerMock(); |
1758 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; | 1758 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
1759 var arg_parent = "foo"; | 1759 var arg_parent = "foo"; |
1760 var arg_pageToken = "foo"; | 1760 var arg_pageToken = "foo"; |
1761 var arg_pageSize = 42; | 1761 var arg_pageSize = 42; |
1762 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1762 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1763 var path = (req.url).path; | 1763 var path = (req.url).path; |
1764 var pathOffset = 0; | 1764 var pathOffset = 0; |
1765 var index; | 1765 var index; |
1766 var subPart; | 1766 var subPart; |
1767 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1767 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1768 pathOffset += 1; | 1768 pathOffset += 1; |
1769 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1769 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1770 pathOffset += 3; | 1770 pathOffset += 3; |
1771 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1771 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1772 | 1772 |
(...skipping 16 matching lines...) Expand all Loading... |
1789 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1789 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1790 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1790 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1791 | 1791 |
1792 | 1792 |
1793 var h = { | 1793 var h = { |
1794 "content-type" : "application/json; charset=utf-8", | 1794 "content-type" : "application/json; charset=utf-8", |
1795 }; | 1795 }; |
1796 var resp = convert.JSON.encode(buildListSinksResponse()); | 1796 var resp = convert.JSON.encode(buildListSinksResponse()); |
1797 return new async.Future.value(stringResponse(200, h, resp)); | 1797 return new async.Future.value(stringResponse(200, h, resp)); |
1798 }), true); | 1798 }), true); |
1799 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListSinksResponse response) { | 1799 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
1800 checkListSinksResponse(response); | 1800 checkListSinksResponse(response); |
1801 }))); | 1801 }))); |
1802 }); | 1802 }); |
1803 | 1803 |
1804 unittest.test("method--update", () { | 1804 unittest.test("method--update", () { |
1805 | 1805 |
1806 var mock = new HttpServerMock(); | 1806 var mock = new HttpServerMock(); |
1807 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; | 1807 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
1808 var arg_request = buildLogSink(); | 1808 var arg_request = buildLogSink(); |
1809 var arg_sinkName = "foo"; | 1809 var arg_sinkName = "foo"; |
1810 var arg_uniqueWriterIdentity = true; | 1810 var arg_uniqueWriterIdentity = true; |
1811 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1811 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1812 var obj = new api.LogSink.fromJson(json); | 1812 var obj = new api.LogSink.fromJson(json); |
1813 checkLogSink(obj); | 1813 checkLogSink(obj); |
1814 | 1814 |
1815 var path = (req.url).path; | 1815 var path = (req.url).path; |
1816 var pathOffset = 0; | 1816 var pathOffset = 0; |
1817 var index; | 1817 var index; |
1818 var subPart; | 1818 var subPart; |
1819 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1819 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1820 pathOffset += 1; | 1820 pathOffset += 1; |
1821 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1821 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
1840 } | 1840 } |
1841 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 1841 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
1842 | 1842 |
1843 | 1843 |
1844 var h = { | 1844 var h = { |
1845 "content-type" : "application/json; charset=utf-8", | 1845 "content-type" : "application/json; charset=utf-8", |
1846 }; | 1846 }; |
1847 var resp = convert.JSON.encode(buildLogSink()); | 1847 var resp = convert.JSON.encode(buildLogSink()); |
1848 return new async.Future.value(stringResponse(200, h, resp)); | 1848 return new async.Future.value(stringResponse(200, h, resp)); |
1849 }), true); | 1849 }), true); |
1850 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { | 1850 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
1851 checkLogSink(response); | 1851 checkLogSink(response); |
1852 }))); | 1852 }))); |
1853 }); | 1853 }); |
1854 | 1854 |
1855 }); | 1855 }); |
1856 | 1856 |
1857 | 1857 |
1858 unittest.group("resource-MonitoredResourceDescriptorsResourceApi", () { | 1858 unittest.group("resource-MonitoredResourceDescriptorsResourceApi", () { |
1859 unittest.test("method--list", () { | 1859 unittest.test("method--list", () { |
1860 | 1860 |
1861 var mock = new HttpServerMock(); | 1861 var mock = new HttpServerMock(); |
1862 api.MonitoredResourceDescriptorsResourceApi res = new api.LoggingApi(mock)
.monitoredResourceDescriptors; | 1862 api.MonitoredResourceDescriptorsResourceApi res = new api.LoggingApi(mock)
.monitoredResourceDescriptors; |
1863 var arg_pageToken = "foo"; | 1863 var arg_pageToken = "foo"; |
1864 var arg_pageSize = 42; | 1864 var arg_pageSize = 42; |
1865 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1865 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1866 var path = (req.url).path; | 1866 var path = (req.url).path; |
1867 var pathOffset = 0; | 1867 var pathOffset = 0; |
1868 var index; | 1868 var index; |
1869 var subPart; | 1869 var subPart; |
1870 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1870 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1871 pathOffset += 1; | 1871 pathOffset += 1; |
1872 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("v2/monitoredResourceDescriptors")); | 1872 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("v2/monitoredResourceDescriptors")); |
1873 pathOffset += 31; | 1873 pathOffset += 31; |
1874 | 1874 |
1875 var query = (req.url).query; | 1875 var query = (req.url).query; |
(...skipping 15 matching lines...) Expand all Loading... |
1891 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1891 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1892 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1892 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1893 | 1893 |
1894 | 1894 |
1895 var h = { | 1895 var h = { |
1896 "content-type" : "application/json; charset=utf-8", | 1896 "content-type" : "application/json; charset=utf-8", |
1897 }; | 1897 }; |
1898 var resp = convert.JSON.encode(buildListMonitoredResourceDescriptorsResp
onse()); | 1898 var resp = convert.JSON.encode(buildListMonitoredResourceDescriptorsResp
onse()); |
1899 return new async.Future.value(stringResponse(200, h, resp)); | 1899 return new async.Future.value(stringResponse(200, h, resp)); |
1900 }), true); | 1900 }), true); |
1901 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize).then(unittest.e
xpectAsync(((api.ListMonitoredResourceDescriptorsResponse response) { | 1901 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize).then(unittest.e
xpectAsync1(((api.ListMonitoredResourceDescriptorsResponse response) { |
1902 checkListMonitoredResourceDescriptorsResponse(response); | 1902 checkListMonitoredResourceDescriptorsResponse(response); |
1903 }))); | 1903 }))); |
1904 }); | 1904 }); |
1905 | 1905 |
1906 }); | 1906 }); |
1907 | 1907 |
1908 | 1908 |
1909 unittest.group("resource-OrganizationsLogsResourceApi", () { | 1909 unittest.group("resource-OrganizationsLogsResourceApi", () { |
1910 unittest.test("method--delete", () { | 1910 unittest.test("method--delete", () { |
1911 | 1911 |
1912 var mock = new HttpServerMock(); | 1912 var mock = new HttpServerMock(); |
1913 api.OrganizationsLogsResourceApi res = new api.LoggingApi(mock).organizati
ons.logs; | 1913 api.OrganizationsLogsResourceApi res = new api.LoggingApi(mock).organizati
ons.logs; |
1914 var arg_logName = "foo"; | 1914 var arg_logName = "foo"; |
1915 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1915 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1916 var path = (req.url).path; | 1916 var path = (req.url).path; |
1917 var pathOffset = 0; | 1917 var pathOffset = 0; |
1918 var index; | 1918 var index; |
1919 var subPart; | 1919 var subPart; |
1920 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1920 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1921 pathOffset += 1; | 1921 pathOffset += 1; |
1922 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1922 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1923 pathOffset += 3; | 1923 pathOffset += 3; |
1924 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1924 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1925 | 1925 |
(...skipping 14 matching lines...) Expand all Loading... |
1940 } | 1940 } |
1941 } | 1941 } |
1942 | 1942 |
1943 | 1943 |
1944 var h = { | 1944 var h = { |
1945 "content-type" : "application/json; charset=utf-8", | 1945 "content-type" : "application/json; charset=utf-8", |
1946 }; | 1946 }; |
1947 var resp = convert.JSON.encode(buildEmpty()); | 1947 var resp = convert.JSON.encode(buildEmpty()); |
1948 return new async.Future.value(stringResponse(200, h, resp)); | 1948 return new async.Future.value(stringResponse(200, h, resp)); |
1949 }), true); | 1949 }), true); |
1950 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { | 1950 res.delete(arg_logName).then(unittest.expectAsync1(((api.Empty response) { |
1951 checkEmpty(response); | 1951 checkEmpty(response); |
1952 }))); | 1952 }))); |
1953 }); | 1953 }); |
1954 | 1954 |
1955 unittest.test("method--list", () { | 1955 unittest.test("method--list", () { |
1956 | 1956 |
1957 var mock = new HttpServerMock(); | 1957 var mock = new HttpServerMock(); |
1958 api.OrganizationsLogsResourceApi res = new api.LoggingApi(mock).organizati
ons.logs; | 1958 api.OrganizationsLogsResourceApi res = new api.LoggingApi(mock).organizati
ons.logs; |
1959 var arg_parent = "foo"; | 1959 var arg_parent = "foo"; |
| 1960 var arg_pageSize = 42; |
1960 var arg_pageToken = "foo"; | 1961 var arg_pageToken = "foo"; |
1961 var arg_pageSize = 42; | 1962 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1962 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1963 var path = (req.url).path; | 1963 var path = (req.url).path; |
1964 var pathOffset = 0; | 1964 var pathOffset = 0; |
1965 var index; | 1965 var index; |
1966 var subPart; | 1966 var subPart; |
1967 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1967 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1968 pathOffset += 1; | 1968 pathOffset += 1; |
1969 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1969 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
1970 pathOffset += 3; | 1970 pathOffset += 3; |
1971 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1971 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1972 | 1972 |
1973 var query = (req.url).query; | 1973 var query = (req.url).query; |
1974 var queryOffset = 0; | 1974 var queryOffset = 0; |
1975 var queryMap = {}; | 1975 var queryMap = {}; |
1976 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1976 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1977 parseBool(n) { | 1977 parseBool(n) { |
1978 if (n == "true") return true; | 1978 if (n == "true") return true; |
1979 if (n == "false") return false; | 1979 if (n == "false") return false; |
1980 if (n == null) return null; | 1980 if (n == null) return null; |
1981 throw new core.ArgumentError("Invalid boolean: $n"); | 1981 throw new core.ArgumentError("Invalid boolean: $n"); |
1982 } | 1982 } |
1983 if (query.length > 0) { | 1983 if (query.length > 0) { |
1984 for (var part in query.split("&")) { | 1984 for (var part in query.split("&")) { |
1985 var keyvalue = part.split("="); | 1985 var keyvalue = part.split("="); |
1986 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1986 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1987 } | 1987 } |
1988 } | 1988 } |
| 1989 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1989 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1990 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1990 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
1991 | 1991 |
1992 | 1992 |
1993 var h = { | 1993 var h = { |
1994 "content-type" : "application/json; charset=utf-8", | 1994 "content-type" : "application/json; charset=utf-8", |
1995 }; | 1995 }; |
1996 var resp = convert.JSON.encode(buildListLogsResponse()); | 1996 var resp = convert.JSON.encode(buildListLogsResponse()); |
1997 return new async.Future.value(stringResponse(200, h, resp)); | 1997 return new async.Future.value(stringResponse(200, h, resp)); |
1998 }), true); | 1998 }), true); |
1999 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListLogsResponse response) { | 1999 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListLogsResponse response) { |
2000 checkListLogsResponse(response); | 2000 checkListLogsResponse(response); |
2001 }))); | 2001 }))); |
2002 }); | 2002 }); |
2003 | 2003 |
2004 }); | 2004 }); |
2005 | 2005 |
2006 | 2006 |
2007 unittest.group("resource-OrganizationsSinksResourceApi", () { | 2007 unittest.group("resource-OrganizationsSinksResourceApi", () { |
2008 unittest.test("method--create", () { | 2008 unittest.test("method--create", () { |
2009 | 2009 |
2010 var mock = new HttpServerMock(); | 2010 var mock = new HttpServerMock(); |
2011 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 2011 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
2012 var arg_request = buildLogSink(); | 2012 var arg_request = buildLogSink(); |
2013 var arg_parent = "foo"; | 2013 var arg_parent = "foo"; |
2014 var arg_uniqueWriterIdentity = true; | 2014 var arg_uniqueWriterIdentity = true; |
2015 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2015 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2016 var obj = new api.LogSink.fromJson(json); | 2016 var obj = new api.LogSink.fromJson(json); |
2017 checkLogSink(obj); | 2017 checkLogSink(obj); |
2018 | 2018 |
2019 var path = (req.url).path; | 2019 var path = (req.url).path; |
2020 var pathOffset = 0; | 2020 var pathOffset = 0; |
2021 var index; | 2021 var index; |
2022 var subPart; | 2022 var subPart; |
2023 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2023 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2024 pathOffset += 1; | 2024 pathOffset += 1; |
2025 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2025 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
2044 } | 2044 } |
2045 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 2045 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
2046 | 2046 |
2047 | 2047 |
2048 var h = { | 2048 var h = { |
2049 "content-type" : "application/json; charset=utf-8", | 2049 "content-type" : "application/json; charset=utf-8", |
2050 }; | 2050 }; |
2051 var resp = convert.JSON.encode(buildLogSink()); | 2051 var resp = convert.JSON.encode(buildLogSink()); |
2052 return new async.Future.value(stringResponse(200, h, resp)); | 2052 return new async.Future.value(stringResponse(200, h, resp)); |
2053 }), true); | 2053 }), true); |
2054 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync(((api.LogSink response) { | 2054 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync1(((api.LogSink response) { |
2055 checkLogSink(response); | 2055 checkLogSink(response); |
2056 }))); | 2056 }))); |
2057 }); | 2057 }); |
2058 | 2058 |
2059 unittest.test("method--delete", () { | 2059 unittest.test("method--delete", () { |
2060 | 2060 |
2061 var mock = new HttpServerMock(); | 2061 var mock = new HttpServerMock(); |
2062 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 2062 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
2063 var arg_sinkName = "foo"; | 2063 var arg_sinkName = "foo"; |
2064 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2064 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2065 var path = (req.url).path; | 2065 var path = (req.url).path; |
2066 var pathOffset = 0; | 2066 var pathOffset = 0; |
2067 var index; | 2067 var index; |
2068 var subPart; | 2068 var subPart; |
2069 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2069 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2070 pathOffset += 1; | 2070 pathOffset += 1; |
2071 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2071 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2072 pathOffset += 3; | 2072 pathOffset += 3; |
2073 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2073 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2074 | 2074 |
(...skipping 14 matching lines...) Expand all Loading... |
2089 } | 2089 } |
2090 } | 2090 } |
2091 | 2091 |
2092 | 2092 |
2093 var h = { | 2093 var h = { |
2094 "content-type" : "application/json; charset=utf-8", | 2094 "content-type" : "application/json; charset=utf-8", |
2095 }; | 2095 }; |
2096 var resp = convert.JSON.encode(buildEmpty()); | 2096 var resp = convert.JSON.encode(buildEmpty()); |
2097 return new async.Future.value(stringResponse(200, h, resp)); | 2097 return new async.Future.value(stringResponse(200, h, resp)); |
2098 }), true); | 2098 }), true); |
2099 res.delete(arg_sinkName).then(unittest.expectAsync(((api.Empty response) { | 2099 res.delete(arg_sinkName).then(unittest.expectAsync1(((api.Empty response)
{ |
2100 checkEmpty(response); | 2100 checkEmpty(response); |
2101 }))); | 2101 }))); |
2102 }); | 2102 }); |
2103 | 2103 |
2104 unittest.test("method--get", () { | 2104 unittest.test("method--get", () { |
2105 | 2105 |
2106 var mock = new HttpServerMock(); | 2106 var mock = new HttpServerMock(); |
2107 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 2107 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
2108 var arg_sinkName = "foo"; | 2108 var arg_sinkName = "foo"; |
2109 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2109 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2110 var path = (req.url).path; | 2110 var path = (req.url).path; |
2111 var pathOffset = 0; | 2111 var pathOffset = 0; |
2112 var index; | 2112 var index; |
2113 var subPart; | 2113 var subPart; |
2114 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2114 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2115 pathOffset += 1; | 2115 pathOffset += 1; |
2116 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2116 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2117 pathOffset += 3; | 2117 pathOffset += 3; |
2118 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2118 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2119 | 2119 |
(...skipping 14 matching lines...) Expand all Loading... |
2134 } | 2134 } |
2135 } | 2135 } |
2136 | 2136 |
2137 | 2137 |
2138 var h = { | 2138 var h = { |
2139 "content-type" : "application/json; charset=utf-8", | 2139 "content-type" : "application/json; charset=utf-8", |
2140 }; | 2140 }; |
2141 var resp = convert.JSON.encode(buildLogSink()); | 2141 var resp = convert.JSON.encode(buildLogSink()); |
2142 return new async.Future.value(stringResponse(200, h, resp)); | 2142 return new async.Future.value(stringResponse(200, h, resp)); |
2143 }), true); | 2143 }), true); |
2144 res.get(arg_sinkName).then(unittest.expectAsync(((api.LogSink response) { | 2144 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { |
2145 checkLogSink(response); | 2145 checkLogSink(response); |
2146 }))); | 2146 }))); |
2147 }); | 2147 }); |
2148 | 2148 |
2149 unittest.test("method--list", () { | 2149 unittest.test("method--list", () { |
2150 | 2150 |
2151 var mock = new HttpServerMock(); | 2151 var mock = new HttpServerMock(); |
2152 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 2152 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
2153 var arg_parent = "foo"; | 2153 var arg_parent = "foo"; |
| 2154 var arg_pageSize = 42; |
2154 var arg_pageToken = "foo"; | 2155 var arg_pageToken = "foo"; |
2155 var arg_pageSize = 42; | 2156 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2156 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
2157 var path = (req.url).path; | 2157 var path = (req.url).path; |
2158 var pathOffset = 0; | 2158 var pathOffset = 0; |
2159 var index; | 2159 var index; |
2160 var subPart; | 2160 var subPart; |
2161 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2161 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2162 pathOffset += 1; | 2162 pathOffset += 1; |
2163 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2163 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2164 pathOffset += 3; | 2164 pathOffset += 3; |
2165 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2165 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2166 | 2166 |
2167 var query = (req.url).query; | 2167 var query = (req.url).query; |
2168 var queryOffset = 0; | 2168 var queryOffset = 0; |
2169 var queryMap = {}; | 2169 var queryMap = {}; |
2170 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2170 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2171 parseBool(n) { | 2171 parseBool(n) { |
2172 if (n == "true") return true; | 2172 if (n == "true") return true; |
2173 if (n == "false") return false; | 2173 if (n == "false") return false; |
2174 if (n == null) return null; | 2174 if (n == null) return null; |
2175 throw new core.ArgumentError("Invalid boolean: $n"); | 2175 throw new core.ArgumentError("Invalid boolean: $n"); |
2176 } | 2176 } |
2177 if (query.length > 0) { | 2177 if (query.length > 0) { |
2178 for (var part in query.split("&")) { | 2178 for (var part in query.split("&")) { |
2179 var keyvalue = part.split("="); | 2179 var keyvalue = part.split("="); |
2180 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2180 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2181 } | 2181 } |
2182 } | 2182 } |
| 2183 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
2183 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2184 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
2184 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
2185 | 2185 |
2186 | 2186 |
2187 var h = { | 2187 var h = { |
2188 "content-type" : "application/json; charset=utf-8", | 2188 "content-type" : "application/json; charset=utf-8", |
2189 }; | 2189 }; |
2190 var resp = convert.JSON.encode(buildListSinksResponse()); | 2190 var resp = convert.JSON.encode(buildListSinksResponse()); |
2191 return new async.Future.value(stringResponse(200, h, resp)); | 2191 return new async.Future.value(stringResponse(200, h, resp)); |
2192 }), true); | 2192 }), true); |
2193 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListSinksResponse response) { | 2193 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
2194 checkListSinksResponse(response); | 2194 checkListSinksResponse(response); |
2195 }))); | 2195 }))); |
2196 }); | 2196 }); |
2197 | 2197 |
2198 unittest.test("method--update", () { | 2198 unittest.test("method--update", () { |
2199 | 2199 |
2200 var mock = new HttpServerMock(); | 2200 var mock = new HttpServerMock(); |
2201 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 2201 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
2202 var arg_request = buildLogSink(); | 2202 var arg_request = buildLogSink(); |
2203 var arg_sinkName = "foo"; | 2203 var arg_sinkName = "foo"; |
2204 var arg_uniqueWriterIdentity = true; | 2204 var arg_uniqueWriterIdentity = true; |
2205 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2205 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2206 var obj = new api.LogSink.fromJson(json); | 2206 var obj = new api.LogSink.fromJson(json); |
2207 checkLogSink(obj); | 2207 checkLogSink(obj); |
2208 | 2208 |
2209 var path = (req.url).path; | 2209 var path = (req.url).path; |
2210 var pathOffset = 0; | 2210 var pathOffset = 0; |
2211 var index; | 2211 var index; |
2212 var subPart; | 2212 var subPart; |
2213 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2213 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2214 pathOffset += 1; | 2214 pathOffset += 1; |
2215 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2215 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
2234 } | 2234 } |
2235 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 2235 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
2236 | 2236 |
2237 | 2237 |
2238 var h = { | 2238 var h = { |
2239 "content-type" : "application/json; charset=utf-8", | 2239 "content-type" : "application/json; charset=utf-8", |
2240 }; | 2240 }; |
2241 var resp = convert.JSON.encode(buildLogSink()); | 2241 var resp = convert.JSON.encode(buildLogSink()); |
2242 return new async.Future.value(stringResponse(200, h, resp)); | 2242 return new async.Future.value(stringResponse(200, h, resp)); |
2243 }), true); | 2243 }), true); |
2244 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { | 2244 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
2245 checkLogSink(response); | 2245 checkLogSink(response); |
2246 }))); | 2246 }))); |
2247 }); | 2247 }); |
2248 | 2248 |
2249 }); | 2249 }); |
2250 | 2250 |
2251 | 2251 |
2252 unittest.group("resource-ProjectsLogsResourceApi", () { | 2252 unittest.group("resource-ProjectsLogsResourceApi", () { |
2253 unittest.test("method--delete", () { | 2253 unittest.test("method--delete", () { |
2254 | 2254 |
2255 var mock = new HttpServerMock(); | 2255 var mock = new HttpServerMock(); |
2256 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; | 2256 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; |
2257 var arg_logName = "foo"; | 2257 var arg_logName = "foo"; |
2258 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2258 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2259 var path = (req.url).path; | 2259 var path = (req.url).path; |
2260 var pathOffset = 0; | 2260 var pathOffset = 0; |
2261 var index; | 2261 var index; |
2262 var subPart; | 2262 var subPart; |
2263 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2263 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2264 pathOffset += 1; | 2264 pathOffset += 1; |
2265 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2265 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2266 pathOffset += 3; | 2266 pathOffset += 3; |
2267 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2267 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2268 | 2268 |
(...skipping 14 matching lines...) Expand all Loading... |
2283 } | 2283 } |
2284 } | 2284 } |
2285 | 2285 |
2286 | 2286 |
2287 var h = { | 2287 var h = { |
2288 "content-type" : "application/json; charset=utf-8", | 2288 "content-type" : "application/json; charset=utf-8", |
2289 }; | 2289 }; |
2290 var resp = convert.JSON.encode(buildEmpty()); | 2290 var resp = convert.JSON.encode(buildEmpty()); |
2291 return new async.Future.value(stringResponse(200, h, resp)); | 2291 return new async.Future.value(stringResponse(200, h, resp)); |
2292 }), true); | 2292 }), true); |
2293 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { | 2293 res.delete(arg_logName).then(unittest.expectAsync1(((api.Empty response) { |
2294 checkEmpty(response); | 2294 checkEmpty(response); |
2295 }))); | 2295 }))); |
2296 }); | 2296 }); |
2297 | 2297 |
2298 unittest.test("method--list", () { | 2298 unittest.test("method--list", () { |
2299 | 2299 |
2300 var mock = new HttpServerMock(); | 2300 var mock = new HttpServerMock(); |
2301 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; | 2301 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; |
2302 var arg_parent = "foo"; | 2302 var arg_parent = "foo"; |
2303 var arg_pageToken = "foo"; | 2303 var arg_pageToken = "foo"; |
2304 var arg_pageSize = 42; | 2304 var arg_pageSize = 42; |
2305 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2305 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2306 var path = (req.url).path; | 2306 var path = (req.url).path; |
2307 var pathOffset = 0; | 2307 var pathOffset = 0; |
2308 var index; | 2308 var index; |
2309 var subPart; | 2309 var subPart; |
2310 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2310 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2311 pathOffset += 1; | 2311 pathOffset += 1; |
2312 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2312 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2313 pathOffset += 3; | 2313 pathOffset += 3; |
2314 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2314 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2315 | 2315 |
(...skipping 16 matching lines...) Expand all Loading... |
2332 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2332 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
2333 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2333 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
2334 | 2334 |
2335 | 2335 |
2336 var h = { | 2336 var h = { |
2337 "content-type" : "application/json; charset=utf-8", | 2337 "content-type" : "application/json; charset=utf-8", |
2338 }; | 2338 }; |
2339 var resp = convert.JSON.encode(buildListLogsResponse()); | 2339 var resp = convert.JSON.encode(buildListLogsResponse()); |
2340 return new async.Future.value(stringResponse(200, h, resp)); | 2340 return new async.Future.value(stringResponse(200, h, resp)); |
2341 }), true); | 2341 }), true); |
2342 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListLogsResponse response) { | 2342 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListLogsResponse response) { |
2343 checkListLogsResponse(response); | 2343 checkListLogsResponse(response); |
2344 }))); | 2344 }))); |
2345 }); | 2345 }); |
2346 | 2346 |
2347 }); | 2347 }); |
2348 | 2348 |
2349 | 2349 |
2350 unittest.group("resource-ProjectsMetricsResourceApi", () { | 2350 unittest.group("resource-ProjectsMetricsResourceApi", () { |
2351 unittest.test("method--create", () { | 2351 unittest.test("method--create", () { |
2352 | 2352 |
2353 var mock = new HttpServerMock(); | 2353 var mock = new HttpServerMock(); |
2354 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2354 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
2355 var arg_request = buildLogMetric(); | 2355 var arg_request = buildLogMetric(); |
2356 var arg_parent = "foo"; | 2356 var arg_parent = "foo"; |
2357 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2357 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2358 var obj = new api.LogMetric.fromJson(json); | 2358 var obj = new api.LogMetric.fromJson(json); |
2359 checkLogMetric(obj); | 2359 checkLogMetric(obj); |
2360 | 2360 |
2361 var path = (req.url).path; | 2361 var path = (req.url).path; |
2362 var pathOffset = 0; | 2362 var pathOffset = 0; |
2363 var index; | 2363 var index; |
2364 var subPart; | 2364 var subPart; |
2365 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2365 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2366 pathOffset += 1; | 2366 pathOffset += 1; |
2367 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2367 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
2385 } | 2385 } |
2386 } | 2386 } |
2387 | 2387 |
2388 | 2388 |
2389 var h = { | 2389 var h = { |
2390 "content-type" : "application/json; charset=utf-8", | 2390 "content-type" : "application/json; charset=utf-8", |
2391 }; | 2391 }; |
2392 var resp = convert.JSON.encode(buildLogMetric()); | 2392 var resp = convert.JSON.encode(buildLogMetric()); |
2393 return new async.Future.value(stringResponse(200, h, resp)); | 2393 return new async.Future.value(stringResponse(200, h, resp)); |
2394 }), true); | 2394 }), true); |
2395 res.create(arg_request, arg_parent).then(unittest.expectAsync(((api.LogMet
ric response) { | 2395 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.LogMe
tric response) { |
2396 checkLogMetric(response); | 2396 checkLogMetric(response); |
2397 }))); | 2397 }))); |
2398 }); | 2398 }); |
2399 | 2399 |
2400 unittest.test("method--delete", () { | 2400 unittest.test("method--delete", () { |
2401 | 2401 |
2402 var mock = new HttpServerMock(); | 2402 var mock = new HttpServerMock(); |
2403 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2403 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
2404 var arg_metricName = "foo"; | 2404 var arg_metricName = "foo"; |
2405 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2405 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2406 var path = (req.url).path; | 2406 var path = (req.url).path; |
2407 var pathOffset = 0; | 2407 var pathOffset = 0; |
2408 var index; | 2408 var index; |
2409 var subPart; | 2409 var subPart; |
2410 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2410 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2411 pathOffset += 1; | 2411 pathOffset += 1; |
2412 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2412 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2413 pathOffset += 3; | 2413 pathOffset += 3; |
2414 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2414 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2415 | 2415 |
(...skipping 14 matching lines...) Expand all Loading... |
2430 } | 2430 } |
2431 } | 2431 } |
2432 | 2432 |
2433 | 2433 |
2434 var h = { | 2434 var h = { |
2435 "content-type" : "application/json; charset=utf-8", | 2435 "content-type" : "application/json; charset=utf-8", |
2436 }; | 2436 }; |
2437 var resp = convert.JSON.encode(buildEmpty()); | 2437 var resp = convert.JSON.encode(buildEmpty()); |
2438 return new async.Future.value(stringResponse(200, h, resp)); | 2438 return new async.Future.value(stringResponse(200, h, resp)); |
2439 }), true); | 2439 }), true); |
2440 res.delete(arg_metricName).then(unittest.expectAsync(((api.Empty response)
{ | 2440 res.delete(arg_metricName).then(unittest.expectAsync1(((api.Empty response
) { |
2441 checkEmpty(response); | 2441 checkEmpty(response); |
2442 }))); | 2442 }))); |
2443 }); | 2443 }); |
2444 | 2444 |
2445 unittest.test("method--get", () { | 2445 unittest.test("method--get", () { |
2446 | 2446 |
2447 var mock = new HttpServerMock(); | 2447 var mock = new HttpServerMock(); |
2448 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2448 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
2449 var arg_metricName = "foo"; | 2449 var arg_metricName = "foo"; |
2450 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2450 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2451 var path = (req.url).path; | 2451 var path = (req.url).path; |
2452 var pathOffset = 0; | 2452 var pathOffset = 0; |
2453 var index; | 2453 var index; |
2454 var subPart; | 2454 var subPart; |
2455 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2455 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2456 pathOffset += 1; | 2456 pathOffset += 1; |
2457 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2457 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2458 pathOffset += 3; | 2458 pathOffset += 3; |
2459 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2459 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2460 | 2460 |
(...skipping 14 matching lines...) Expand all Loading... |
2475 } | 2475 } |
2476 } | 2476 } |
2477 | 2477 |
2478 | 2478 |
2479 var h = { | 2479 var h = { |
2480 "content-type" : "application/json; charset=utf-8", | 2480 "content-type" : "application/json; charset=utf-8", |
2481 }; | 2481 }; |
2482 var resp = convert.JSON.encode(buildLogMetric()); | 2482 var resp = convert.JSON.encode(buildLogMetric()); |
2483 return new async.Future.value(stringResponse(200, h, resp)); | 2483 return new async.Future.value(stringResponse(200, h, resp)); |
2484 }), true); | 2484 }), true); |
2485 res.get(arg_metricName).then(unittest.expectAsync(((api.LogMetric response
) { | 2485 res.get(arg_metricName).then(unittest.expectAsync1(((api.LogMetric respons
e) { |
2486 checkLogMetric(response); | 2486 checkLogMetric(response); |
2487 }))); | 2487 }))); |
2488 }); | 2488 }); |
2489 | 2489 |
2490 unittest.test("method--list", () { | 2490 unittest.test("method--list", () { |
2491 | 2491 |
2492 var mock = new HttpServerMock(); | 2492 var mock = new HttpServerMock(); |
2493 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2493 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
2494 var arg_parent = "foo"; | 2494 var arg_parent = "foo"; |
2495 var arg_pageToken = "foo"; | 2495 var arg_pageToken = "foo"; |
2496 var arg_pageSize = 42; | 2496 var arg_pageSize = 42; |
2497 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2497 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2498 var path = (req.url).path; | 2498 var path = (req.url).path; |
2499 var pathOffset = 0; | 2499 var pathOffset = 0; |
2500 var index; | 2500 var index; |
2501 var subPart; | 2501 var subPart; |
2502 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2502 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2503 pathOffset += 1; | 2503 pathOffset += 1; |
2504 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2504 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2505 pathOffset += 3; | 2505 pathOffset += 3; |
2506 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2506 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2507 | 2507 |
(...skipping 16 matching lines...) Expand all Loading... |
2524 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2524 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
2525 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2525 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
2526 | 2526 |
2527 | 2527 |
2528 var h = { | 2528 var h = { |
2529 "content-type" : "application/json; charset=utf-8", | 2529 "content-type" : "application/json; charset=utf-8", |
2530 }; | 2530 }; |
2531 var resp = convert.JSON.encode(buildListLogMetricsResponse()); | 2531 var resp = convert.JSON.encode(buildListLogMetricsResponse()); |
2532 return new async.Future.value(stringResponse(200, h, resp)); | 2532 return new async.Future.value(stringResponse(200, h, resp)); |
2533 }), true); | 2533 }), true); |
2534 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListLogMetricsResponse response) { | 2534 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListLogMetricsResponse response) { |
2535 checkListLogMetricsResponse(response); | 2535 checkListLogMetricsResponse(response); |
2536 }))); | 2536 }))); |
2537 }); | 2537 }); |
2538 | 2538 |
2539 unittest.test("method--update", () { | 2539 unittest.test("method--update", () { |
2540 | 2540 |
2541 var mock = new HttpServerMock(); | 2541 var mock = new HttpServerMock(); |
2542 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2542 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
2543 var arg_request = buildLogMetric(); | 2543 var arg_request = buildLogMetric(); |
2544 var arg_metricName = "foo"; | 2544 var arg_metricName = "foo"; |
2545 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2545 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2546 var obj = new api.LogMetric.fromJson(json); | 2546 var obj = new api.LogMetric.fromJson(json); |
2547 checkLogMetric(obj); | 2547 checkLogMetric(obj); |
2548 | 2548 |
2549 var path = (req.url).path; | 2549 var path = (req.url).path; |
2550 var pathOffset = 0; | 2550 var pathOffset = 0; |
2551 var index; | 2551 var index; |
2552 var subPart; | 2552 var subPart; |
2553 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2553 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2554 pathOffset += 1; | 2554 pathOffset += 1; |
2555 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2555 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
2573 } | 2573 } |
2574 } | 2574 } |
2575 | 2575 |
2576 | 2576 |
2577 var h = { | 2577 var h = { |
2578 "content-type" : "application/json; charset=utf-8", | 2578 "content-type" : "application/json; charset=utf-8", |
2579 }; | 2579 }; |
2580 var resp = convert.JSON.encode(buildLogMetric()); | 2580 var resp = convert.JSON.encode(buildLogMetric()); |
2581 return new async.Future.value(stringResponse(200, h, resp)); | 2581 return new async.Future.value(stringResponse(200, h, resp)); |
2582 }), true); | 2582 }), true); |
2583 res.update(arg_request, arg_metricName).then(unittest.expectAsync(((api.Lo
gMetric response) { | 2583 res.update(arg_request, arg_metricName).then(unittest.expectAsync1(((api.L
ogMetric response) { |
2584 checkLogMetric(response); | 2584 checkLogMetric(response); |
2585 }))); | 2585 }))); |
2586 }); | 2586 }); |
2587 | 2587 |
2588 }); | 2588 }); |
2589 | 2589 |
2590 | 2590 |
2591 unittest.group("resource-ProjectsSinksResourceApi", () { | 2591 unittest.group("resource-ProjectsSinksResourceApi", () { |
2592 unittest.test("method--create", () { | 2592 unittest.test("method--create", () { |
2593 | 2593 |
2594 var mock = new HttpServerMock(); | 2594 var mock = new HttpServerMock(); |
2595 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; | 2595 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
2596 var arg_request = buildLogSink(); | 2596 var arg_request = buildLogSink(); |
2597 var arg_parent = "foo"; | 2597 var arg_parent = "foo"; |
2598 var arg_uniqueWriterIdentity = true; | 2598 var arg_uniqueWriterIdentity = true; |
2599 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2599 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2600 var obj = new api.LogSink.fromJson(json); | 2600 var obj = new api.LogSink.fromJson(json); |
2601 checkLogSink(obj); | 2601 checkLogSink(obj); |
2602 | 2602 |
2603 var path = (req.url).path; | 2603 var path = (req.url).path; |
2604 var pathOffset = 0; | 2604 var pathOffset = 0; |
2605 var index; | 2605 var index; |
2606 var subPart; | 2606 var subPart; |
2607 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2607 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2608 pathOffset += 1; | 2608 pathOffset += 1; |
2609 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2609 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
2628 } | 2628 } |
2629 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 2629 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
2630 | 2630 |
2631 | 2631 |
2632 var h = { | 2632 var h = { |
2633 "content-type" : "application/json; charset=utf-8", | 2633 "content-type" : "application/json; charset=utf-8", |
2634 }; | 2634 }; |
2635 var resp = convert.JSON.encode(buildLogSink()); | 2635 var resp = convert.JSON.encode(buildLogSink()); |
2636 return new async.Future.value(stringResponse(200, h, resp)); | 2636 return new async.Future.value(stringResponse(200, h, resp)); |
2637 }), true); | 2637 }), true); |
2638 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync(((api.LogSink response) { | 2638 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync1(((api.LogSink response) { |
2639 checkLogSink(response); | 2639 checkLogSink(response); |
2640 }))); | 2640 }))); |
2641 }); | 2641 }); |
2642 | 2642 |
2643 unittest.test("method--delete", () { | 2643 unittest.test("method--delete", () { |
2644 | 2644 |
2645 var mock = new HttpServerMock(); | 2645 var mock = new HttpServerMock(); |
2646 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; | 2646 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
2647 var arg_sinkName = "foo"; | 2647 var arg_sinkName = "foo"; |
2648 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2648 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2649 var path = (req.url).path; | 2649 var path = (req.url).path; |
2650 var pathOffset = 0; | 2650 var pathOffset = 0; |
2651 var index; | 2651 var index; |
2652 var subPart; | 2652 var subPart; |
2653 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2653 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2654 pathOffset += 1; | 2654 pathOffset += 1; |
2655 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2655 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2656 pathOffset += 3; | 2656 pathOffset += 3; |
2657 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2657 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2658 | 2658 |
(...skipping 14 matching lines...) Expand all Loading... |
2673 } | 2673 } |
2674 } | 2674 } |
2675 | 2675 |
2676 | 2676 |
2677 var h = { | 2677 var h = { |
2678 "content-type" : "application/json; charset=utf-8", | 2678 "content-type" : "application/json; charset=utf-8", |
2679 }; | 2679 }; |
2680 var resp = convert.JSON.encode(buildEmpty()); | 2680 var resp = convert.JSON.encode(buildEmpty()); |
2681 return new async.Future.value(stringResponse(200, h, resp)); | 2681 return new async.Future.value(stringResponse(200, h, resp)); |
2682 }), true); | 2682 }), true); |
2683 res.delete(arg_sinkName).then(unittest.expectAsync(((api.Empty response) { | 2683 res.delete(arg_sinkName).then(unittest.expectAsync1(((api.Empty response)
{ |
2684 checkEmpty(response); | 2684 checkEmpty(response); |
2685 }))); | 2685 }))); |
2686 }); | 2686 }); |
2687 | 2687 |
2688 unittest.test("method--get", () { | 2688 unittest.test("method--get", () { |
2689 | 2689 |
2690 var mock = new HttpServerMock(); | 2690 var mock = new HttpServerMock(); |
2691 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; | 2691 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
2692 var arg_sinkName = "foo"; | 2692 var arg_sinkName = "foo"; |
2693 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2693 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2694 var path = (req.url).path; | 2694 var path = (req.url).path; |
2695 var pathOffset = 0; | 2695 var pathOffset = 0; |
2696 var index; | 2696 var index; |
2697 var subPart; | 2697 var subPart; |
2698 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2698 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2699 pathOffset += 1; | 2699 pathOffset += 1; |
2700 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2700 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2701 pathOffset += 3; | 2701 pathOffset += 3; |
2702 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2702 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2703 | 2703 |
(...skipping 14 matching lines...) Expand all Loading... |
2718 } | 2718 } |
2719 } | 2719 } |
2720 | 2720 |
2721 | 2721 |
2722 var h = { | 2722 var h = { |
2723 "content-type" : "application/json; charset=utf-8", | 2723 "content-type" : "application/json; charset=utf-8", |
2724 }; | 2724 }; |
2725 var resp = convert.JSON.encode(buildLogSink()); | 2725 var resp = convert.JSON.encode(buildLogSink()); |
2726 return new async.Future.value(stringResponse(200, h, resp)); | 2726 return new async.Future.value(stringResponse(200, h, resp)); |
2727 }), true); | 2727 }), true); |
2728 res.get(arg_sinkName).then(unittest.expectAsync(((api.LogSink response) { | 2728 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { |
2729 checkLogSink(response); | 2729 checkLogSink(response); |
2730 }))); | 2730 }))); |
2731 }); | 2731 }); |
2732 | 2732 |
2733 unittest.test("method--list", () { | 2733 unittest.test("method--list", () { |
2734 | 2734 |
2735 var mock = new HttpServerMock(); | 2735 var mock = new HttpServerMock(); |
2736 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; | 2736 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
2737 var arg_parent = "foo"; | 2737 var arg_parent = "foo"; |
2738 var arg_pageToken = "foo"; | 2738 var arg_pageToken = "foo"; |
2739 var arg_pageSize = 42; | 2739 var arg_pageSize = 42; |
2740 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2740 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2741 var path = (req.url).path; | 2741 var path = (req.url).path; |
2742 var pathOffset = 0; | 2742 var pathOffset = 0; |
2743 var index; | 2743 var index; |
2744 var subPart; | 2744 var subPart; |
2745 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2745 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2746 pathOffset += 1; | 2746 pathOffset += 1; |
2747 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2747 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
2748 pathOffset += 3; | 2748 pathOffset += 3; |
2749 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2749 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2750 | 2750 |
(...skipping 16 matching lines...) Expand all Loading... |
2767 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2767 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
2768 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2768 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
2769 | 2769 |
2770 | 2770 |
2771 var h = { | 2771 var h = { |
2772 "content-type" : "application/json; charset=utf-8", | 2772 "content-type" : "application/json; charset=utf-8", |
2773 }; | 2773 }; |
2774 var resp = convert.JSON.encode(buildListSinksResponse()); | 2774 var resp = convert.JSON.encode(buildListSinksResponse()); |
2775 return new async.Future.value(stringResponse(200, h, resp)); | 2775 return new async.Future.value(stringResponse(200, h, resp)); |
2776 }), true); | 2776 }), true); |
2777 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListSinksResponse response) { | 2777 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
2778 checkListSinksResponse(response); | 2778 checkListSinksResponse(response); |
2779 }))); | 2779 }))); |
2780 }); | 2780 }); |
2781 | 2781 |
2782 unittest.test("method--update", () { | 2782 unittest.test("method--update", () { |
2783 | 2783 |
2784 var mock = new HttpServerMock(); | 2784 var mock = new HttpServerMock(); |
2785 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; | 2785 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
2786 var arg_request = buildLogSink(); | 2786 var arg_request = buildLogSink(); |
2787 var arg_sinkName = "foo"; | 2787 var arg_sinkName = "foo"; |
2788 var arg_uniqueWriterIdentity = true; | 2788 var arg_uniqueWriterIdentity = true; |
2789 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2789 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2790 var obj = new api.LogSink.fromJson(json); | 2790 var obj = new api.LogSink.fromJson(json); |
2791 checkLogSink(obj); | 2791 checkLogSink(obj); |
2792 | 2792 |
2793 var path = (req.url).path; | 2793 var path = (req.url).path; |
2794 var pathOffset = 0; | 2794 var pathOffset = 0; |
2795 var index; | 2795 var index; |
2796 var subPart; | 2796 var subPart; |
2797 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2797 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2798 pathOffset += 1; | 2798 pathOffset += 1; |
2799 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2799 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
(...skipping 18 matching lines...) Expand all Loading... |
2818 } | 2818 } |
2819 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); | 2819 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
2820 | 2820 |
2821 | 2821 |
2822 var h = { | 2822 var h = { |
2823 "content-type" : "application/json; charset=utf-8", | 2823 "content-type" : "application/json; charset=utf-8", |
2824 }; | 2824 }; |
2825 var resp = convert.JSON.encode(buildLogSink()); | 2825 var resp = convert.JSON.encode(buildLogSink()); |
2826 return new async.Future.value(stringResponse(200, h, resp)); | 2826 return new async.Future.value(stringResponse(200, h, resp)); |
2827 }), true); | 2827 }), true); |
2828 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { | 2828 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
2829 checkLogSink(response); | 2829 checkLogSink(response); |
2830 }))); | 2830 }))); |
2831 }); | 2831 }); |
2832 | 2832 |
2833 }); | 2833 }); |
2834 | 2834 |
2835 | 2835 |
2836 } | 2836 } |
2837 | 2837 |
OLD | NEW |