| 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:unittest/unittest.dart' as unittest; |
| (...skipping 118 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 buildUnnamed174() { | 139 buildUnnamed177() { |
| 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 checkUnnamed174(core.List<core.String> o) { | 146 checkUnnamed177(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 buildUnnamed175() { | 152 buildUnnamed178() { |
| 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 checkUnnamed175(core.List<core.String> o) { | 159 checkUnnamed178(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 = buildUnnamed174(); | 174 o.projectIds = buildUnnamed177(); |
| 175 o.resourceNames = buildUnnamed175(); | 175 o.resourceNames = buildUnnamed178(); |
| 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 checkUnnamed174(o.projectIds); | 188 checkUnnamed177(o.projectIds); |
| 189 checkUnnamed175(o.resourceNames); | 189 checkUnnamed178(o.resourceNames); |
| 190 } | 190 } |
| 191 buildCounterListLogEntriesRequest--; | 191 buildCounterListLogEntriesRequest--; |
| 192 } | 192 } |
| 193 | 193 |
| 194 buildUnnamed176() { | 194 buildUnnamed179() { |
| 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 checkUnnamed176(core.List<api.LogEntry> o) { | 201 checkUnnamed179(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 = buildUnnamed176(); | 212 o.entries = buildUnnamed179(); |
| 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 checkUnnamed176(o.entries); | 222 checkUnnamed179(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 buildUnnamed177() { | 228 buildUnnamed180() { |
| 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 checkUnnamed177(core.List<api.LogMetric> o) { | 235 checkUnnamed180(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 = buildUnnamed177(); | 246 o.metrics = buildUnnamed180(); |
| 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 checkUnnamed177(o.metrics); | 256 checkUnnamed180(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 buildUnnamed178() { | 262 buildUnnamed181() { |
| 263 var o = new core.List<core.String>(); |
| 264 o.add("foo"); |
| 265 o.add("foo"); |
| 266 return o; |
| 267 } |
| 268 |
| 269 checkUnnamed181(core.List<core.String> o) { |
| 270 unittest.expect(o, unittest.hasLength(2)); |
| 271 unittest.expect(o[0], unittest.equals('foo')); |
| 272 unittest.expect(o[1], unittest.equals('foo')); |
| 273 } |
| 274 |
| 275 core.int buildCounterListLogsResponse = 0; |
| 276 buildListLogsResponse() { |
| 277 var o = new api.ListLogsResponse(); |
| 278 buildCounterListLogsResponse++; |
| 279 if (buildCounterListLogsResponse < 3) { |
| 280 o.logNames = buildUnnamed181(); |
| 281 o.nextPageToken = "foo"; |
| 282 } |
| 283 buildCounterListLogsResponse--; |
| 284 return o; |
| 285 } |
| 286 |
| 287 checkListLogsResponse(api.ListLogsResponse o) { |
| 288 buildCounterListLogsResponse++; |
| 289 if (buildCounterListLogsResponse < 3) { |
| 290 checkUnnamed181(o.logNames); |
| 291 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 292 } |
| 293 buildCounterListLogsResponse--; |
| 294 } |
| 295 |
| 296 buildUnnamed182() { |
| 263 var o = new core.List<api.MonitoredResourceDescriptor>(); | 297 var o = new core.List<api.MonitoredResourceDescriptor>(); |
| 264 o.add(buildMonitoredResourceDescriptor()); | 298 o.add(buildMonitoredResourceDescriptor()); |
| 265 o.add(buildMonitoredResourceDescriptor()); | 299 o.add(buildMonitoredResourceDescriptor()); |
| 266 return o; | 300 return o; |
| 267 } | 301 } |
| 268 | 302 |
| 269 checkUnnamed178(core.List<api.MonitoredResourceDescriptor> o) { | 303 checkUnnamed182(core.List<api.MonitoredResourceDescriptor> o) { |
| 270 unittest.expect(o, unittest.hasLength(2)); | 304 unittest.expect(o, unittest.hasLength(2)); |
| 271 checkMonitoredResourceDescriptor(o[0]); | 305 checkMonitoredResourceDescriptor(o[0]); |
| 272 checkMonitoredResourceDescriptor(o[1]); | 306 checkMonitoredResourceDescriptor(o[1]); |
| 273 } | 307 } |
| 274 | 308 |
| 275 core.int buildCounterListMonitoredResourceDescriptorsResponse = 0; | 309 core.int buildCounterListMonitoredResourceDescriptorsResponse = 0; |
| 276 buildListMonitoredResourceDescriptorsResponse() { | 310 buildListMonitoredResourceDescriptorsResponse() { |
| 277 var o = new api.ListMonitoredResourceDescriptorsResponse(); | 311 var o = new api.ListMonitoredResourceDescriptorsResponse(); |
| 278 buildCounterListMonitoredResourceDescriptorsResponse++; | 312 buildCounterListMonitoredResourceDescriptorsResponse++; |
| 279 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { | 313 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { |
| 280 o.nextPageToken = "foo"; | 314 o.nextPageToken = "foo"; |
| 281 o.resourceDescriptors = buildUnnamed178(); | 315 o.resourceDescriptors = buildUnnamed182(); |
| 282 } | 316 } |
| 283 buildCounterListMonitoredResourceDescriptorsResponse--; | 317 buildCounterListMonitoredResourceDescriptorsResponse--; |
| 284 return o; | 318 return o; |
| 285 } | 319 } |
| 286 | 320 |
| 287 checkListMonitoredResourceDescriptorsResponse(api.ListMonitoredResourceDescripto
rsResponse o) { | 321 checkListMonitoredResourceDescriptorsResponse(api.ListMonitoredResourceDescripto
rsResponse o) { |
| 288 buildCounterListMonitoredResourceDescriptorsResponse++; | 322 buildCounterListMonitoredResourceDescriptorsResponse++; |
| 289 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { | 323 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { |
| 290 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 324 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 291 checkUnnamed178(o.resourceDescriptors); | 325 checkUnnamed182(o.resourceDescriptors); |
| 292 } | 326 } |
| 293 buildCounterListMonitoredResourceDescriptorsResponse--; | 327 buildCounterListMonitoredResourceDescriptorsResponse--; |
| 294 } | 328 } |
| 295 | 329 |
| 296 buildUnnamed179() { | 330 buildUnnamed183() { |
| 297 var o = new core.List<api.LogSink>(); | 331 var o = new core.List<api.LogSink>(); |
| 298 o.add(buildLogSink()); | 332 o.add(buildLogSink()); |
| 299 o.add(buildLogSink()); | 333 o.add(buildLogSink()); |
| 300 return o; | 334 return o; |
| 301 } | 335 } |
| 302 | 336 |
| 303 checkUnnamed179(core.List<api.LogSink> o) { | 337 checkUnnamed183(core.List<api.LogSink> o) { |
| 304 unittest.expect(o, unittest.hasLength(2)); | 338 unittest.expect(o, unittest.hasLength(2)); |
| 305 checkLogSink(o[0]); | 339 checkLogSink(o[0]); |
| 306 checkLogSink(o[1]); | 340 checkLogSink(o[1]); |
| 307 } | 341 } |
| 308 | 342 |
| 309 core.int buildCounterListSinksResponse = 0; | 343 core.int buildCounterListSinksResponse = 0; |
| 310 buildListSinksResponse() { | 344 buildListSinksResponse() { |
| 311 var o = new api.ListSinksResponse(); | 345 var o = new api.ListSinksResponse(); |
| 312 buildCounterListSinksResponse++; | 346 buildCounterListSinksResponse++; |
| 313 if (buildCounterListSinksResponse < 3) { | 347 if (buildCounterListSinksResponse < 3) { |
| 314 o.nextPageToken = "foo"; | 348 o.nextPageToken = "foo"; |
| 315 o.sinks = buildUnnamed179(); | 349 o.sinks = buildUnnamed183(); |
| 316 } | 350 } |
| 317 buildCounterListSinksResponse--; | 351 buildCounterListSinksResponse--; |
| 318 return o; | 352 return o; |
| 319 } | 353 } |
| 320 | 354 |
| 321 checkListSinksResponse(api.ListSinksResponse o) { | 355 checkListSinksResponse(api.ListSinksResponse o) { |
| 322 buildCounterListSinksResponse++; | 356 buildCounterListSinksResponse++; |
| 323 if (buildCounterListSinksResponse < 3) { | 357 if (buildCounterListSinksResponse < 3) { |
| 324 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 358 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 325 checkUnnamed179(o.sinks); | 359 checkUnnamed183(o.sinks); |
| 326 } | 360 } |
| 327 buildCounterListSinksResponse--; | 361 buildCounterListSinksResponse--; |
| 328 } | 362 } |
| 329 | 363 |
| 330 buildUnnamed180() { | 364 buildUnnamed184() { |
| 331 var o = new core.Map<core.String, core.Object>(); | 365 var o = new core.Map<core.String, core.Object>(); |
| 332 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 366 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 333 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 367 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 334 return o; | 368 return o; |
| 335 } | 369 } |
| 336 | 370 |
| 337 checkUnnamed180(core.Map<core.String, core.Object> o) { | 371 checkUnnamed184(core.Map<core.String, core.Object> o) { |
| 338 unittest.expect(o, unittest.hasLength(2)); | 372 unittest.expect(o, unittest.hasLength(2)); |
| 339 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')); | 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')); |
| 340 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')); | 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')); |
| 341 } | 375 } |
| 342 | 376 |
| 343 buildUnnamed181() { | 377 buildUnnamed185() { |
| 344 var o = new core.Map<core.String, core.String>(); | 378 var o = new core.Map<core.String, core.String>(); |
| 345 o["x"] = "foo"; | 379 o["x"] = "foo"; |
| 346 o["y"] = "foo"; | 380 o["y"] = "foo"; |
| 347 return o; | 381 return o; |
| 348 } | 382 } |
| 349 | 383 |
| 350 checkUnnamed181(core.Map<core.String, core.String> o) { | 384 checkUnnamed185(core.Map<core.String, core.String> o) { |
| 351 unittest.expect(o, unittest.hasLength(2)); | 385 unittest.expect(o, unittest.hasLength(2)); |
| 352 unittest.expect(o["x"], unittest.equals('foo')); | 386 unittest.expect(o["x"], unittest.equals('foo')); |
| 353 unittest.expect(o["y"], unittest.equals('foo')); | 387 unittest.expect(o["y"], unittest.equals('foo')); |
| 354 } | 388 } |
| 355 | 389 |
| 356 buildUnnamed182() { | 390 buildUnnamed186() { |
| 357 var o = new core.Map<core.String, core.Object>(); | 391 var o = new core.Map<core.String, core.Object>(); |
| 358 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 392 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 359 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 393 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 360 return o; | 394 return o; |
| 361 } | 395 } |
| 362 | 396 |
| 363 checkUnnamed182(core.Map<core.String, core.Object> o) { | 397 checkUnnamed186(core.Map<core.String, core.Object> o) { |
| 364 unittest.expect(o, unittest.hasLength(2)); | 398 unittest.expect(o, unittest.hasLength(2)); |
| 365 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')); |
| 366 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')); |
| 367 } | 401 } |
| 368 | 402 |
| 369 core.int buildCounterLogEntry = 0; | 403 core.int buildCounterLogEntry = 0; |
| 370 buildLogEntry() { | 404 buildLogEntry() { |
| 371 var o = new api.LogEntry(); | 405 var o = new api.LogEntry(); |
| 372 buildCounterLogEntry++; | 406 buildCounterLogEntry++; |
| 373 if (buildCounterLogEntry < 3) { | 407 if (buildCounterLogEntry < 3) { |
| 374 o.httpRequest = buildHttpRequest(); | 408 o.httpRequest = buildHttpRequest(); |
| 375 o.insertId = "foo"; | 409 o.insertId = "foo"; |
| 376 o.jsonPayload = buildUnnamed180(); | 410 o.jsonPayload = buildUnnamed184(); |
| 377 o.labels = buildUnnamed181(); | 411 o.labels = buildUnnamed185(); |
| 378 o.logName = "foo"; | 412 o.logName = "foo"; |
| 379 o.operation = buildLogEntryOperation(); | 413 o.operation = buildLogEntryOperation(); |
| 380 o.protoPayload = buildUnnamed182(); | 414 o.protoPayload = buildUnnamed186(); |
| 381 o.resource = buildMonitoredResource(); | 415 o.resource = buildMonitoredResource(); |
| 382 o.severity = "foo"; | 416 o.severity = "foo"; |
| 417 o.sourceLocation = buildLogEntrySourceLocation(); |
| 383 o.textPayload = "foo"; | 418 o.textPayload = "foo"; |
| 384 o.timestamp = "foo"; | 419 o.timestamp = "foo"; |
| 420 o.trace = "foo"; |
| 385 } | 421 } |
| 386 buildCounterLogEntry--; | 422 buildCounterLogEntry--; |
| 387 return o; | 423 return o; |
| 388 } | 424 } |
| 389 | 425 |
| 390 checkLogEntry(api.LogEntry o) { | 426 checkLogEntry(api.LogEntry o) { |
| 391 buildCounterLogEntry++; | 427 buildCounterLogEntry++; |
| 392 if (buildCounterLogEntry < 3) { | 428 if (buildCounterLogEntry < 3) { |
| 393 checkHttpRequest(o.httpRequest); | 429 checkHttpRequest(o.httpRequest); |
| 394 unittest.expect(o.insertId, unittest.equals('foo')); | 430 unittest.expect(o.insertId, unittest.equals('foo')); |
| 395 checkUnnamed180(o.jsonPayload); | 431 checkUnnamed184(o.jsonPayload); |
| 396 checkUnnamed181(o.labels); | 432 checkUnnamed185(o.labels); |
| 397 unittest.expect(o.logName, unittest.equals('foo')); | 433 unittest.expect(o.logName, unittest.equals('foo')); |
| 398 checkLogEntryOperation(o.operation); | 434 checkLogEntryOperation(o.operation); |
| 399 checkUnnamed182(o.protoPayload); | 435 checkUnnamed186(o.protoPayload); |
| 400 checkMonitoredResource(o.resource); | 436 checkMonitoredResource(o.resource); |
| 401 unittest.expect(o.severity, unittest.equals('foo')); | 437 unittest.expect(o.severity, unittest.equals('foo')); |
| 438 checkLogEntrySourceLocation(o.sourceLocation); |
| 402 unittest.expect(o.textPayload, unittest.equals('foo')); | 439 unittest.expect(o.textPayload, unittest.equals('foo')); |
| 403 unittest.expect(o.timestamp, unittest.equals('foo')); | 440 unittest.expect(o.timestamp, unittest.equals('foo')); |
| 441 unittest.expect(o.trace, unittest.equals('foo')); |
| 404 } | 442 } |
| 405 buildCounterLogEntry--; | 443 buildCounterLogEntry--; |
| 406 } | 444 } |
| 407 | 445 |
| 408 core.int buildCounterLogEntryOperation = 0; | 446 core.int buildCounterLogEntryOperation = 0; |
| 409 buildLogEntryOperation() { | 447 buildLogEntryOperation() { |
| 410 var o = new api.LogEntryOperation(); | 448 var o = new api.LogEntryOperation(); |
| 411 buildCounterLogEntryOperation++; | 449 buildCounterLogEntryOperation++; |
| 412 if (buildCounterLogEntryOperation < 3) { | 450 if (buildCounterLogEntryOperation < 3) { |
| 413 o.first = true; | 451 o.first = true; |
| 414 o.id = "foo"; | 452 o.id = "foo"; |
| 415 o.last = true; | 453 o.last = true; |
| 416 o.producer = "foo"; | 454 o.producer = "foo"; |
| 417 } | 455 } |
| 418 buildCounterLogEntryOperation--; | 456 buildCounterLogEntryOperation--; |
| 419 return o; | 457 return o; |
| 420 } | 458 } |
| 421 | 459 |
| 422 checkLogEntryOperation(api.LogEntryOperation o) { | 460 checkLogEntryOperation(api.LogEntryOperation o) { |
| 423 buildCounterLogEntryOperation++; | 461 buildCounterLogEntryOperation++; |
| 424 if (buildCounterLogEntryOperation < 3) { | 462 if (buildCounterLogEntryOperation < 3) { |
| 425 unittest.expect(o.first, unittest.isTrue); | 463 unittest.expect(o.first, unittest.isTrue); |
| 426 unittest.expect(o.id, unittest.equals('foo')); | 464 unittest.expect(o.id, unittest.equals('foo')); |
| 427 unittest.expect(o.last, unittest.isTrue); | 465 unittest.expect(o.last, unittest.isTrue); |
| 428 unittest.expect(o.producer, unittest.equals('foo')); | 466 unittest.expect(o.producer, unittest.equals('foo')); |
| 429 } | 467 } |
| 430 buildCounterLogEntryOperation--; | 468 buildCounterLogEntryOperation--; |
| 431 } | 469 } |
| 432 | 470 |
| 471 core.int buildCounterLogEntrySourceLocation = 0; |
| 472 buildLogEntrySourceLocation() { |
| 473 var o = new api.LogEntrySourceLocation(); |
| 474 buildCounterLogEntrySourceLocation++; |
| 475 if (buildCounterLogEntrySourceLocation < 3) { |
| 476 o.file = "foo"; |
| 477 o.function = "foo"; |
| 478 o.line = "foo"; |
| 479 } |
| 480 buildCounterLogEntrySourceLocation--; |
| 481 return o; |
| 482 } |
| 483 |
| 484 checkLogEntrySourceLocation(api.LogEntrySourceLocation o) { |
| 485 buildCounterLogEntrySourceLocation++; |
| 486 if (buildCounterLogEntrySourceLocation < 3) { |
| 487 unittest.expect(o.file, unittest.equals('foo')); |
| 488 unittest.expect(o.function, unittest.equals('foo')); |
| 489 unittest.expect(o.line, unittest.equals('foo')); |
| 490 } |
| 491 buildCounterLogEntrySourceLocation--; |
| 492 } |
| 493 |
| 433 core.int buildCounterLogLine = 0; | 494 core.int buildCounterLogLine = 0; |
| 434 buildLogLine() { | 495 buildLogLine() { |
| 435 var o = new api.LogLine(); | 496 var o = new api.LogLine(); |
| 436 buildCounterLogLine++; | 497 buildCounterLogLine++; |
| 437 if (buildCounterLogLine < 3) { | 498 if (buildCounterLogLine < 3) { |
| 438 o.logMessage = "foo"; | 499 o.logMessage = "foo"; |
| 439 o.severity = "foo"; | 500 o.severity = "foo"; |
| 440 o.sourceLocation = buildSourceLocation(); | 501 o.sourceLocation = buildSourceLocation(); |
| 441 o.time = "foo"; | 502 o.time = "foo"; |
| 442 } | 503 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 unittest.expect(o.endTime, unittest.equals('foo')); | 565 unittest.expect(o.endTime, unittest.equals('foo')); |
| 505 unittest.expect(o.filter, unittest.equals('foo')); | 566 unittest.expect(o.filter, unittest.equals('foo')); |
| 506 unittest.expect(o.name, unittest.equals('foo')); | 567 unittest.expect(o.name, unittest.equals('foo')); |
| 507 unittest.expect(o.outputVersionFormat, unittest.equals('foo')); | 568 unittest.expect(o.outputVersionFormat, unittest.equals('foo')); |
| 508 unittest.expect(o.startTime, unittest.equals('foo')); | 569 unittest.expect(o.startTime, unittest.equals('foo')); |
| 509 unittest.expect(o.writerIdentity, unittest.equals('foo')); | 570 unittest.expect(o.writerIdentity, unittest.equals('foo')); |
| 510 } | 571 } |
| 511 buildCounterLogSink--; | 572 buildCounterLogSink--; |
| 512 } | 573 } |
| 513 | 574 |
| 514 buildUnnamed183() { | 575 buildUnnamed187() { |
| 515 var o = new core.Map<core.String, core.String>(); | 576 var o = new core.Map<core.String, core.String>(); |
| 516 o["x"] = "foo"; | 577 o["x"] = "foo"; |
| 517 o["y"] = "foo"; | 578 o["y"] = "foo"; |
| 518 return o; | 579 return o; |
| 519 } | 580 } |
| 520 | 581 |
| 521 checkUnnamed183(core.Map<core.String, core.String> o) { | 582 checkUnnamed187(core.Map<core.String, core.String> o) { |
| 522 unittest.expect(o, unittest.hasLength(2)); | 583 unittest.expect(o, unittest.hasLength(2)); |
| 523 unittest.expect(o["x"], unittest.equals('foo')); | 584 unittest.expect(o["x"], unittest.equals('foo')); |
| 524 unittest.expect(o["y"], unittest.equals('foo')); | 585 unittest.expect(o["y"], unittest.equals('foo')); |
| 525 } | 586 } |
| 526 | 587 |
| 527 core.int buildCounterMonitoredResource = 0; | 588 core.int buildCounterMonitoredResource = 0; |
| 528 buildMonitoredResource() { | 589 buildMonitoredResource() { |
| 529 var o = new api.MonitoredResource(); | 590 var o = new api.MonitoredResource(); |
| 530 buildCounterMonitoredResource++; | 591 buildCounterMonitoredResource++; |
| 531 if (buildCounterMonitoredResource < 3) { | 592 if (buildCounterMonitoredResource < 3) { |
| 532 o.labels = buildUnnamed183(); | 593 o.labels = buildUnnamed187(); |
| 533 o.type = "foo"; | 594 o.type = "foo"; |
| 534 } | 595 } |
| 535 buildCounterMonitoredResource--; | 596 buildCounterMonitoredResource--; |
| 536 return o; | 597 return o; |
| 537 } | 598 } |
| 538 | 599 |
| 539 checkMonitoredResource(api.MonitoredResource o) { | 600 checkMonitoredResource(api.MonitoredResource o) { |
| 540 buildCounterMonitoredResource++; | 601 buildCounterMonitoredResource++; |
| 541 if (buildCounterMonitoredResource < 3) { | 602 if (buildCounterMonitoredResource < 3) { |
| 542 checkUnnamed183(o.labels); | 603 checkUnnamed187(o.labels); |
| 543 unittest.expect(o.type, unittest.equals('foo')); | 604 unittest.expect(o.type, unittest.equals('foo')); |
| 544 } | 605 } |
| 545 buildCounterMonitoredResource--; | 606 buildCounterMonitoredResource--; |
| 546 } | 607 } |
| 547 | 608 |
| 548 buildUnnamed184() { | 609 buildUnnamed188() { |
| 549 var o = new core.List<api.LabelDescriptor>(); | 610 var o = new core.List<api.LabelDescriptor>(); |
| 550 o.add(buildLabelDescriptor()); | 611 o.add(buildLabelDescriptor()); |
| 551 o.add(buildLabelDescriptor()); | 612 o.add(buildLabelDescriptor()); |
| 552 return o; | 613 return o; |
| 553 } | 614 } |
| 554 | 615 |
| 555 checkUnnamed184(core.List<api.LabelDescriptor> o) { | 616 checkUnnamed188(core.List<api.LabelDescriptor> o) { |
| 556 unittest.expect(o, unittest.hasLength(2)); | 617 unittest.expect(o, unittest.hasLength(2)); |
| 557 checkLabelDescriptor(o[0]); | 618 checkLabelDescriptor(o[0]); |
| 558 checkLabelDescriptor(o[1]); | 619 checkLabelDescriptor(o[1]); |
| 559 } | 620 } |
| 560 | 621 |
| 561 core.int buildCounterMonitoredResourceDescriptor = 0; | 622 core.int buildCounterMonitoredResourceDescriptor = 0; |
| 562 buildMonitoredResourceDescriptor() { | 623 buildMonitoredResourceDescriptor() { |
| 563 var o = new api.MonitoredResourceDescriptor(); | 624 var o = new api.MonitoredResourceDescriptor(); |
| 564 buildCounterMonitoredResourceDescriptor++; | 625 buildCounterMonitoredResourceDescriptor++; |
| 565 if (buildCounterMonitoredResourceDescriptor < 3) { | 626 if (buildCounterMonitoredResourceDescriptor < 3) { |
| 566 o.description = "foo"; | 627 o.description = "foo"; |
| 567 o.displayName = "foo"; | 628 o.displayName = "foo"; |
| 568 o.labels = buildUnnamed184(); | 629 o.labels = buildUnnamed188(); |
| 569 o.name = "foo"; | 630 o.name = "foo"; |
| 570 o.type = "foo"; | 631 o.type = "foo"; |
| 571 } | 632 } |
| 572 buildCounterMonitoredResourceDescriptor--; | 633 buildCounterMonitoredResourceDescriptor--; |
| 573 return o; | 634 return o; |
| 574 } | 635 } |
| 575 | 636 |
| 576 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { | 637 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { |
| 577 buildCounterMonitoredResourceDescriptor++; | 638 buildCounterMonitoredResourceDescriptor++; |
| 578 if (buildCounterMonitoredResourceDescriptor < 3) { | 639 if (buildCounterMonitoredResourceDescriptor < 3) { |
| 579 unittest.expect(o.description, unittest.equals('foo')); | 640 unittest.expect(o.description, unittest.equals('foo')); |
| 580 unittest.expect(o.displayName, unittest.equals('foo')); | 641 unittest.expect(o.displayName, unittest.equals('foo')); |
| 581 checkUnnamed184(o.labels); | 642 checkUnnamed188(o.labels); |
| 582 unittest.expect(o.name, unittest.equals('foo')); | 643 unittest.expect(o.name, unittest.equals('foo')); |
| 583 unittest.expect(o.type, unittest.equals('foo')); | 644 unittest.expect(o.type, unittest.equals('foo')); |
| 584 } | 645 } |
| 585 buildCounterMonitoredResourceDescriptor--; | 646 buildCounterMonitoredResourceDescriptor--; |
| 586 } | 647 } |
| 587 | 648 |
| 588 buildUnnamed185() { | 649 buildUnnamed189() { |
| 589 var o = new core.List<api.LogLine>(); | 650 var o = new core.List<api.LogLine>(); |
| 590 o.add(buildLogLine()); | 651 o.add(buildLogLine()); |
| 591 o.add(buildLogLine()); | 652 o.add(buildLogLine()); |
| 592 return o; | 653 return o; |
| 593 } | 654 } |
| 594 | 655 |
| 595 checkUnnamed185(core.List<api.LogLine> o) { | 656 checkUnnamed189(core.List<api.LogLine> o) { |
| 596 unittest.expect(o, unittest.hasLength(2)); | 657 unittest.expect(o, unittest.hasLength(2)); |
| 597 checkLogLine(o[0]); | 658 checkLogLine(o[0]); |
| 598 checkLogLine(o[1]); | 659 checkLogLine(o[1]); |
| 599 } | 660 } |
| 600 | 661 |
| 601 buildUnnamed186() { | 662 buildUnnamed190() { |
| 602 var o = new core.List<api.SourceReference>(); | 663 var o = new core.List<api.SourceReference>(); |
| 603 o.add(buildSourceReference()); | 664 o.add(buildSourceReference()); |
| 604 o.add(buildSourceReference()); | 665 o.add(buildSourceReference()); |
| 605 return o; | 666 return o; |
| 606 } | 667 } |
| 607 | 668 |
| 608 checkUnnamed186(core.List<api.SourceReference> o) { | 669 checkUnnamed190(core.List<api.SourceReference> o) { |
| 609 unittest.expect(o, unittest.hasLength(2)); | 670 unittest.expect(o, unittest.hasLength(2)); |
| 610 checkSourceReference(o[0]); | 671 checkSourceReference(o[0]); |
| 611 checkSourceReference(o[1]); | 672 checkSourceReference(o[1]); |
| 612 } | 673 } |
| 613 | 674 |
| 614 core.int buildCounterRequestLog = 0; | 675 core.int buildCounterRequestLog = 0; |
| 615 buildRequestLog() { | 676 buildRequestLog() { |
| 616 var o = new api.RequestLog(); | 677 var o = new api.RequestLog(); |
| 617 buildCounterRequestLog++; | 678 buildCounterRequestLog++; |
| 618 if (buildCounterRequestLog < 3) { | 679 if (buildCounterRequestLog < 3) { |
| 619 o.appEngineRelease = "foo"; | 680 o.appEngineRelease = "foo"; |
| 620 o.appId = "foo"; | 681 o.appId = "foo"; |
| 621 o.cost = 42.0; | 682 o.cost = 42.0; |
| 622 o.endTime = "foo"; | 683 o.endTime = "foo"; |
| 623 o.finished = true; | 684 o.finished = true; |
| 624 o.first = true; | 685 o.first = true; |
| 625 o.host = "foo"; | 686 o.host = "foo"; |
| 626 o.httpVersion = "foo"; | 687 o.httpVersion = "foo"; |
| 627 o.instanceId = "foo"; | 688 o.instanceId = "foo"; |
| 628 o.instanceIndex = 42; | 689 o.instanceIndex = 42; |
| 629 o.ip = "foo"; | 690 o.ip = "foo"; |
| 630 o.latency = "foo"; | 691 o.latency = "foo"; |
| 631 o.line = buildUnnamed185(); | 692 o.line = buildUnnamed189(); |
| 632 o.megaCycles = "foo"; | 693 o.megaCycles = "foo"; |
| 633 o.method = "foo"; | 694 o.method = "foo"; |
| 634 o.moduleId = "foo"; | 695 o.moduleId = "foo"; |
| 635 o.nickname = "foo"; | 696 o.nickname = "foo"; |
| 636 o.pendingTime = "foo"; | 697 o.pendingTime = "foo"; |
| 637 o.referrer = "foo"; | 698 o.referrer = "foo"; |
| 638 o.requestId = "foo"; | 699 o.requestId = "foo"; |
| 639 o.resource = "foo"; | 700 o.resource = "foo"; |
| 640 o.responseSize = "foo"; | 701 o.responseSize = "foo"; |
| 641 o.sourceReference = buildUnnamed186(); | 702 o.sourceReference = buildUnnamed190(); |
| 642 o.startTime = "foo"; | 703 o.startTime = "foo"; |
| 643 o.status = 42; | 704 o.status = 42; |
| 644 o.taskName = "foo"; | 705 o.taskName = "foo"; |
| 645 o.taskQueueName = "foo"; | 706 o.taskQueueName = "foo"; |
| 646 o.traceId = "foo"; | 707 o.traceId = "foo"; |
| 647 o.urlMapEntry = "foo"; | 708 o.urlMapEntry = "foo"; |
| 648 o.userAgent = "foo"; | 709 o.userAgent = "foo"; |
| 649 o.versionId = "foo"; | 710 o.versionId = "foo"; |
| 650 o.wasLoadingRequest = true; | 711 o.wasLoadingRequest = true; |
| 651 } | 712 } |
| 652 buildCounterRequestLog--; | 713 buildCounterRequestLog--; |
| 653 return o; | 714 return o; |
| 654 } | 715 } |
| 655 | 716 |
| 656 checkRequestLog(api.RequestLog o) { | 717 checkRequestLog(api.RequestLog o) { |
| 657 buildCounterRequestLog++; | 718 buildCounterRequestLog++; |
| 658 if (buildCounterRequestLog < 3) { | 719 if (buildCounterRequestLog < 3) { |
| 659 unittest.expect(o.appEngineRelease, unittest.equals('foo')); | 720 unittest.expect(o.appEngineRelease, unittest.equals('foo')); |
| 660 unittest.expect(o.appId, unittest.equals('foo')); | 721 unittest.expect(o.appId, unittest.equals('foo')); |
| 661 unittest.expect(o.cost, unittest.equals(42.0)); | 722 unittest.expect(o.cost, unittest.equals(42.0)); |
| 662 unittest.expect(o.endTime, unittest.equals('foo')); | 723 unittest.expect(o.endTime, unittest.equals('foo')); |
| 663 unittest.expect(o.finished, unittest.isTrue); | 724 unittest.expect(o.finished, unittest.isTrue); |
| 664 unittest.expect(o.first, unittest.isTrue); | 725 unittest.expect(o.first, unittest.isTrue); |
| 665 unittest.expect(o.host, unittest.equals('foo')); | 726 unittest.expect(o.host, unittest.equals('foo')); |
| 666 unittest.expect(o.httpVersion, unittest.equals('foo')); | 727 unittest.expect(o.httpVersion, unittest.equals('foo')); |
| 667 unittest.expect(o.instanceId, unittest.equals('foo')); | 728 unittest.expect(o.instanceId, unittest.equals('foo')); |
| 668 unittest.expect(o.instanceIndex, unittest.equals(42)); | 729 unittest.expect(o.instanceIndex, unittest.equals(42)); |
| 669 unittest.expect(o.ip, unittest.equals('foo')); | 730 unittest.expect(o.ip, unittest.equals('foo')); |
| 670 unittest.expect(o.latency, unittest.equals('foo')); | 731 unittest.expect(o.latency, unittest.equals('foo')); |
| 671 checkUnnamed185(o.line); | 732 checkUnnamed189(o.line); |
| 672 unittest.expect(o.megaCycles, unittest.equals('foo')); | 733 unittest.expect(o.megaCycles, unittest.equals('foo')); |
| 673 unittest.expect(o.method, unittest.equals('foo')); | 734 unittest.expect(o.method, unittest.equals('foo')); |
| 674 unittest.expect(o.moduleId, unittest.equals('foo')); | 735 unittest.expect(o.moduleId, unittest.equals('foo')); |
| 675 unittest.expect(o.nickname, unittest.equals('foo')); | 736 unittest.expect(o.nickname, unittest.equals('foo')); |
| 676 unittest.expect(o.pendingTime, unittest.equals('foo')); | 737 unittest.expect(o.pendingTime, unittest.equals('foo')); |
| 677 unittest.expect(o.referrer, unittest.equals('foo')); | 738 unittest.expect(o.referrer, unittest.equals('foo')); |
| 678 unittest.expect(o.requestId, unittest.equals('foo')); | 739 unittest.expect(o.requestId, unittest.equals('foo')); |
| 679 unittest.expect(o.resource, unittest.equals('foo')); | 740 unittest.expect(o.resource, unittest.equals('foo')); |
| 680 unittest.expect(o.responseSize, unittest.equals('foo')); | 741 unittest.expect(o.responseSize, unittest.equals('foo')); |
| 681 checkUnnamed186(o.sourceReference); | 742 checkUnnamed190(o.sourceReference); |
| 682 unittest.expect(o.startTime, unittest.equals('foo')); | 743 unittest.expect(o.startTime, unittest.equals('foo')); |
| 683 unittest.expect(o.status, unittest.equals(42)); | 744 unittest.expect(o.status, unittest.equals(42)); |
| 684 unittest.expect(o.taskName, unittest.equals('foo')); | 745 unittest.expect(o.taskName, unittest.equals('foo')); |
| 685 unittest.expect(o.taskQueueName, unittest.equals('foo')); | 746 unittest.expect(o.taskQueueName, unittest.equals('foo')); |
| 686 unittest.expect(o.traceId, unittest.equals('foo')); | 747 unittest.expect(o.traceId, unittest.equals('foo')); |
| 687 unittest.expect(o.urlMapEntry, unittest.equals('foo')); | 748 unittest.expect(o.urlMapEntry, unittest.equals('foo')); |
| 688 unittest.expect(o.userAgent, unittest.equals('foo')); | 749 unittest.expect(o.userAgent, unittest.equals('foo')); |
| 689 unittest.expect(o.versionId, unittest.equals('foo')); | 750 unittest.expect(o.versionId, unittest.equals('foo')); |
| 690 unittest.expect(o.wasLoadingRequest, unittest.isTrue); | 751 unittest.expect(o.wasLoadingRequest, unittest.isTrue); |
| 691 } | 752 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 790 |
| 730 checkSourceReference(api.SourceReference o) { | 791 checkSourceReference(api.SourceReference o) { |
| 731 buildCounterSourceReference++; | 792 buildCounterSourceReference++; |
| 732 if (buildCounterSourceReference < 3) { | 793 if (buildCounterSourceReference < 3) { |
| 733 unittest.expect(o.repository, unittest.equals('foo')); | 794 unittest.expect(o.repository, unittest.equals('foo')); |
| 734 unittest.expect(o.revisionId, unittest.equals('foo')); | 795 unittest.expect(o.revisionId, unittest.equals('foo')); |
| 735 } | 796 } |
| 736 buildCounterSourceReference--; | 797 buildCounterSourceReference--; |
| 737 } | 798 } |
| 738 | 799 |
| 739 buildUnnamed187() { | 800 buildUnnamed191() { |
| 740 var o = new core.List<api.LogEntry>(); | 801 var o = new core.List<api.LogEntry>(); |
| 741 o.add(buildLogEntry()); | 802 o.add(buildLogEntry()); |
| 742 o.add(buildLogEntry()); | 803 o.add(buildLogEntry()); |
| 743 return o; | 804 return o; |
| 744 } | 805 } |
| 745 | 806 |
| 746 checkUnnamed187(core.List<api.LogEntry> o) { | 807 checkUnnamed191(core.List<api.LogEntry> o) { |
| 747 unittest.expect(o, unittest.hasLength(2)); | 808 unittest.expect(o, unittest.hasLength(2)); |
| 748 checkLogEntry(o[0]); | 809 checkLogEntry(o[0]); |
| 749 checkLogEntry(o[1]); | 810 checkLogEntry(o[1]); |
| 750 } | 811 } |
| 751 | 812 |
| 752 buildUnnamed188() { | 813 buildUnnamed192() { |
| 753 var o = new core.Map<core.String, core.String>(); | 814 var o = new core.Map<core.String, core.String>(); |
| 754 o["x"] = "foo"; | 815 o["x"] = "foo"; |
| 755 o["y"] = "foo"; | 816 o["y"] = "foo"; |
| 756 return o; | 817 return o; |
| 757 } | 818 } |
| 758 | 819 |
| 759 checkUnnamed188(core.Map<core.String, core.String> o) { | 820 checkUnnamed192(core.Map<core.String, core.String> o) { |
| 760 unittest.expect(o, unittest.hasLength(2)); | 821 unittest.expect(o, unittest.hasLength(2)); |
| 761 unittest.expect(o["x"], unittest.equals('foo')); | 822 unittest.expect(o["x"], unittest.equals('foo')); |
| 762 unittest.expect(o["y"], unittest.equals('foo')); | 823 unittest.expect(o["y"], unittest.equals('foo')); |
| 763 } | 824 } |
| 764 | 825 |
| 765 core.int buildCounterWriteLogEntriesRequest = 0; | 826 core.int buildCounterWriteLogEntriesRequest = 0; |
| 766 buildWriteLogEntriesRequest() { | 827 buildWriteLogEntriesRequest() { |
| 767 var o = new api.WriteLogEntriesRequest(); | 828 var o = new api.WriteLogEntriesRequest(); |
| 768 buildCounterWriteLogEntriesRequest++; | 829 buildCounterWriteLogEntriesRequest++; |
| 769 if (buildCounterWriteLogEntriesRequest < 3) { | 830 if (buildCounterWriteLogEntriesRequest < 3) { |
| 770 o.entries = buildUnnamed187(); | 831 o.entries = buildUnnamed191(); |
| 771 o.labels = buildUnnamed188(); | 832 o.labels = buildUnnamed192(); |
| 772 o.logName = "foo"; | 833 o.logName = "foo"; |
| 773 o.partialSuccess = true; | 834 o.partialSuccess = true; |
| 774 o.resource = buildMonitoredResource(); | 835 o.resource = buildMonitoredResource(); |
| 775 } | 836 } |
| 776 buildCounterWriteLogEntriesRequest--; | 837 buildCounterWriteLogEntriesRequest--; |
| 777 return o; | 838 return o; |
| 778 } | 839 } |
| 779 | 840 |
| 780 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { | 841 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { |
| 781 buildCounterWriteLogEntriesRequest++; | 842 buildCounterWriteLogEntriesRequest++; |
| 782 if (buildCounterWriteLogEntriesRequest < 3) { | 843 if (buildCounterWriteLogEntriesRequest < 3) { |
| 783 checkUnnamed187(o.entries); | 844 checkUnnamed191(o.entries); |
| 784 checkUnnamed188(o.labels); | 845 checkUnnamed192(o.labels); |
| 785 unittest.expect(o.logName, unittest.equals('foo')); | 846 unittest.expect(o.logName, unittest.equals('foo')); |
| 786 unittest.expect(o.partialSuccess, unittest.isTrue); | 847 unittest.expect(o.partialSuccess, unittest.isTrue); |
| 787 checkMonitoredResource(o.resource); | 848 checkMonitoredResource(o.resource); |
| 788 } | 849 } |
| 789 buildCounterWriteLogEntriesRequest--; | 850 buildCounterWriteLogEntriesRequest--; |
| 790 } | 851 } |
| 791 | 852 |
| 792 core.int buildCounterWriteLogEntriesResponse = 0; | 853 core.int buildCounterWriteLogEntriesResponse = 0; |
| 793 buildWriteLogEntriesResponse() { | 854 buildWriteLogEntriesResponse() { |
| 794 var o = new api.WriteLogEntriesResponse(); | 855 var o = new api.WriteLogEntriesResponse(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 | 916 |
| 856 unittest.group("obj-schema-ListLogMetricsResponse", () { | 917 unittest.group("obj-schema-ListLogMetricsResponse", () { |
| 857 unittest.test("to-json--from-json", () { | 918 unittest.test("to-json--from-json", () { |
| 858 var o = buildListLogMetricsResponse(); | 919 var o = buildListLogMetricsResponse(); |
| 859 var od = new api.ListLogMetricsResponse.fromJson(o.toJson()); | 920 var od = new api.ListLogMetricsResponse.fromJson(o.toJson()); |
| 860 checkListLogMetricsResponse(od); | 921 checkListLogMetricsResponse(od); |
| 861 }); | 922 }); |
| 862 }); | 923 }); |
| 863 | 924 |
| 864 | 925 |
| 926 unittest.group("obj-schema-ListLogsResponse", () { |
| 927 unittest.test("to-json--from-json", () { |
| 928 var o = buildListLogsResponse(); |
| 929 var od = new api.ListLogsResponse.fromJson(o.toJson()); |
| 930 checkListLogsResponse(od); |
| 931 }); |
| 932 }); |
| 933 |
| 934 |
| 865 unittest.group("obj-schema-ListMonitoredResourceDescriptorsResponse", () { | 935 unittest.group("obj-schema-ListMonitoredResourceDescriptorsResponse", () { |
| 866 unittest.test("to-json--from-json", () { | 936 unittest.test("to-json--from-json", () { |
| 867 var o = buildListMonitoredResourceDescriptorsResponse(); | 937 var o = buildListMonitoredResourceDescriptorsResponse(); |
| 868 var od = new api.ListMonitoredResourceDescriptorsResponse.fromJson(o.toJso
n()); | 938 var od = new api.ListMonitoredResourceDescriptorsResponse.fromJson(o.toJso
n()); |
| 869 checkListMonitoredResourceDescriptorsResponse(od); | 939 checkListMonitoredResourceDescriptorsResponse(od); |
| 870 }); | 940 }); |
| 871 }); | 941 }); |
| 872 | 942 |
| 873 | 943 |
| 874 unittest.group("obj-schema-ListSinksResponse", () { | 944 unittest.group("obj-schema-ListSinksResponse", () { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 891 | 961 |
| 892 unittest.group("obj-schema-LogEntryOperation", () { | 962 unittest.group("obj-schema-LogEntryOperation", () { |
| 893 unittest.test("to-json--from-json", () { | 963 unittest.test("to-json--from-json", () { |
| 894 var o = buildLogEntryOperation(); | 964 var o = buildLogEntryOperation(); |
| 895 var od = new api.LogEntryOperation.fromJson(o.toJson()); | 965 var od = new api.LogEntryOperation.fromJson(o.toJson()); |
| 896 checkLogEntryOperation(od); | 966 checkLogEntryOperation(od); |
| 897 }); | 967 }); |
| 898 }); | 968 }); |
| 899 | 969 |
| 900 | 970 |
| 971 unittest.group("obj-schema-LogEntrySourceLocation", () { |
| 972 unittest.test("to-json--from-json", () { |
| 973 var o = buildLogEntrySourceLocation(); |
| 974 var od = new api.LogEntrySourceLocation.fromJson(o.toJson()); |
| 975 checkLogEntrySourceLocation(od); |
| 976 }); |
| 977 }); |
| 978 |
| 979 |
| 901 unittest.group("obj-schema-LogLine", () { | 980 unittest.group("obj-schema-LogLine", () { |
| 902 unittest.test("to-json--from-json", () { | 981 unittest.test("to-json--from-json", () { |
| 903 var o = buildLogLine(); | 982 var o = buildLogLine(); |
| 904 var od = new api.LogLine.fromJson(o.toJson()); | 983 var od = new api.LogLine.fromJson(o.toJson()); |
| 905 checkLogLine(od); | 984 checkLogLine(od); |
| 906 }); | 985 }); |
| 907 }); | 986 }); |
| 908 | 987 |
| 909 | 988 |
| 910 unittest.group("obj-schema-LogMetric", () { | 989 unittest.group("obj-schema-LogMetric", () { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 "content-type" : "application/json; charset=utf-8", | 1106 "content-type" : "application/json; charset=utf-8", |
| 1028 }; | 1107 }; |
| 1029 var resp = convert.JSON.encode(buildEmpty()); | 1108 var resp = convert.JSON.encode(buildEmpty()); |
| 1030 return new async.Future.value(stringResponse(200, h, resp)); | 1109 return new async.Future.value(stringResponse(200, h, resp)); |
| 1031 }), true); | 1110 }), true); |
| 1032 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { | 1111 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { |
| 1033 checkEmpty(response); | 1112 checkEmpty(response); |
| 1034 }))); | 1113 }))); |
| 1035 }); | 1114 }); |
| 1036 | 1115 |
| 1116 unittest.test("method--list", () { |
| 1117 |
| 1118 var mock = new HttpServerMock(); |
| 1119 api.BillingAccountsLogsResourceApi res = new api.LoggingApi(mock).billingA
ccounts.logs; |
| 1120 var arg_parent = "foo"; |
| 1121 var arg_pageSize = 42; |
| 1122 var arg_pageToken = "foo"; |
| 1123 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1124 var path = (req.url).path; |
| 1125 var pathOffset = 0; |
| 1126 var index; |
| 1127 var subPart; |
| 1128 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1129 pathOffset += 1; |
| 1130 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1131 pathOffset += 3; |
| 1132 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1133 |
| 1134 var query = (req.url).query; |
| 1135 var queryOffset = 0; |
| 1136 var queryMap = {}; |
| 1137 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1138 parseBool(n) { |
| 1139 if (n == "true") return true; |
| 1140 if (n == "false") return false; |
| 1141 if (n == null) return null; |
| 1142 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1143 } |
| 1144 if (query.length > 0) { |
| 1145 for (var part in query.split("&")) { |
| 1146 var keyvalue = part.split("="); |
| 1147 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1148 } |
| 1149 } |
| 1150 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1151 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1152 |
| 1153 |
| 1154 var h = { |
| 1155 "content-type" : "application/json; charset=utf-8", |
| 1156 }; |
| 1157 var resp = convert.JSON.encode(buildListLogsResponse()); |
| 1158 return new async.Future.value(stringResponse(200, h, resp)); |
| 1159 }), true); |
| 1160 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListLogsResponse response) { |
| 1161 checkListLogsResponse(response); |
| 1162 }))); |
| 1163 }); |
| 1164 |
| 1037 }); | 1165 }); |
| 1038 | 1166 |
| 1039 | 1167 |
| 1040 unittest.group("resource-BillingAccountsSinksResourceApi", () { | 1168 unittest.group("resource-BillingAccountsSinksResourceApi", () { |
| 1041 unittest.test("method--create", () { | 1169 unittest.test("method--create", () { |
| 1042 | 1170 |
| 1043 var mock = new HttpServerMock(); | 1171 var mock = new HttpServerMock(); |
| 1044 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1172 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
| 1045 var arg_request = buildLogSink(); | 1173 var arg_request = buildLogSink(); |
| 1046 var arg_parent = "foo"; | 1174 var arg_parent = "foo"; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 return new async.Future.value(stringResponse(200, h, resp)); | 1501 return new async.Future.value(stringResponse(200, h, resp)); |
| 1374 }), true); | 1502 }), true); |
| 1375 res.write(arg_request).then(unittest.expectAsync(((api.WriteLogEntriesResp
onse response) { | 1503 res.write(arg_request).then(unittest.expectAsync(((api.WriteLogEntriesResp
onse response) { |
| 1376 checkWriteLogEntriesResponse(response); | 1504 checkWriteLogEntriesResponse(response); |
| 1377 }))); | 1505 }))); |
| 1378 }); | 1506 }); |
| 1379 | 1507 |
| 1380 }); | 1508 }); |
| 1381 | 1509 |
| 1382 | 1510 |
| 1383 unittest.group("resource-MonitoredResourceDescriptorsResourceApi", () { | 1511 unittest.group("resource-FoldersLogsResourceApi", () { |
| 1384 unittest.test("method--list", () { | 1512 unittest.test("method--delete", () { |
| 1385 | 1513 |
| 1386 var mock = new HttpServerMock(); | 1514 var mock = new HttpServerMock(); |
| 1387 api.MonitoredResourceDescriptorsResourceApi res = new api.LoggingApi(mock)
.monitoredResourceDescriptors; | 1515 api.FoldersLogsResourceApi res = new api.LoggingApi(mock).folders.logs; |
| 1388 var arg_pageSize = 42; | 1516 var arg_logName = "foo"; |
| 1389 var arg_pageToken = "foo"; | |
| 1390 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1517 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1391 var path = (req.url).path; | 1518 var path = (req.url).path; |
| 1392 var pathOffset = 0; | 1519 var pathOffset = 0; |
| 1393 var index; | 1520 var index; |
| 1394 var subPart; | 1521 var subPart; |
| 1395 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1522 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1396 pathOffset += 1; | 1523 pathOffset += 1; |
| 1397 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("v2/monitoredResourceDescriptors")); | 1524 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1398 pathOffset += 31; | 1525 pathOffset += 3; |
| 1526 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1399 | 1527 |
| 1400 var query = (req.url).query; | 1528 var query = (req.url).query; |
| 1401 var queryOffset = 0; | 1529 var queryOffset = 0; |
| 1402 var queryMap = {}; | 1530 var queryMap = {}; |
| 1403 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1531 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1404 parseBool(n) { | 1532 parseBool(n) { |
| 1405 if (n == "true") return true; | 1533 if (n == "true") return true; |
| 1406 if (n == "false") return false; | 1534 if (n == "false") return false; |
| 1407 if (n == null) return null; | 1535 if (n == null) return null; |
| 1408 throw new core.ArgumentError("Invalid boolean: $n"); | 1536 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1409 } | 1537 } |
| 1410 if (query.length > 0) { | 1538 if (query.length > 0) { |
| 1411 for (var part in query.split("&")) { | 1539 for (var part in query.split("&")) { |
| 1412 var keyvalue = part.split("="); | 1540 var keyvalue = part.split("="); |
| 1413 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1541 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1414 } | 1542 } |
| 1415 } | 1543 } |
| 1416 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
| 1417 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1418 | 1544 |
| 1419 | 1545 |
| 1420 var h = { | 1546 var h = { |
| 1421 "content-type" : "application/json; charset=utf-8", | 1547 "content-type" : "application/json; charset=utf-8", |
| 1422 }; | 1548 }; |
| 1423 var resp = convert.JSON.encode(buildListMonitoredResourceDescriptorsResp
onse()); | 1549 var resp = convert.JSON.encode(buildEmpty()); |
| 1424 return new async.Future.value(stringResponse(200, h, resp)); | 1550 return new async.Future.value(stringResponse(200, h, resp)); |
| 1425 }), true); | 1551 }), true); |
| 1426 res.list(pageSize: arg_pageSize, pageToken: arg_pageToken).then(unittest.e
xpectAsync(((api.ListMonitoredResourceDescriptorsResponse response) { | 1552 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { |
| 1427 checkListMonitoredResourceDescriptorsResponse(response); | 1553 checkEmpty(response); |
| 1428 }))); | 1554 }))); |
| 1429 }); | 1555 }); |
| 1430 | 1556 |
| 1431 }); | 1557 unittest.test("method--list", () { |
| 1432 | |
| 1433 | |
| 1434 unittest.group("resource-OrganizationsLogsResourceApi", () { | |
| 1435 unittest.test("method--delete", () { | |
| 1436 | 1558 |
| 1437 var mock = new HttpServerMock(); | 1559 var mock = new HttpServerMock(); |
| 1438 api.OrganizationsLogsResourceApi res = new api.LoggingApi(mock).organizati
ons.logs; | 1560 api.FoldersLogsResourceApi res = new api.LoggingApi(mock).folders.logs; |
| 1439 var arg_logName = "foo"; | 1561 var arg_parent = "foo"; |
| 1562 var arg_pageSize = 42; |
| 1563 var arg_pageToken = "foo"; |
| 1440 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1564 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1441 var path = (req.url).path; | 1565 var path = (req.url).path; |
| 1442 var pathOffset = 0; | 1566 var pathOffset = 0; |
| 1443 var index; | 1567 var index; |
| 1444 var subPart; | 1568 var subPart; |
| 1445 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1569 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1446 pathOffset += 1; | 1570 pathOffset += 1; |
| 1447 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1571 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1448 pathOffset += 3; | 1572 pathOffset += 3; |
| 1449 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1573 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1450 | 1574 |
| 1451 var query = (req.url).query; | 1575 var query = (req.url).query; |
| 1452 var queryOffset = 0; | 1576 var queryOffset = 0; |
| 1453 var queryMap = {}; | 1577 var queryMap = {}; |
| 1454 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1578 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1455 parseBool(n) { | 1579 parseBool(n) { |
| 1456 if (n == "true") return true; | 1580 if (n == "true") return true; |
| 1457 if (n == "false") return false; | 1581 if (n == "false") return false; |
| 1458 if (n == null) return null; | 1582 if (n == null) return null; |
| 1459 throw new core.ArgumentError("Invalid boolean: $n"); | 1583 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1460 } | 1584 } |
| 1461 if (query.length > 0) { | 1585 if (query.length > 0) { |
| 1462 for (var part in query.split("&")) { | 1586 for (var part in query.split("&")) { |
| 1463 var keyvalue = part.split("="); | 1587 var keyvalue = part.split("="); |
| 1464 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1588 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1465 } | 1589 } |
| 1466 } | 1590 } |
| 1591 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1592 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1467 | 1593 |
| 1468 | 1594 |
| 1469 var h = { | 1595 var h = { |
| 1470 "content-type" : "application/json; charset=utf-8", | 1596 "content-type" : "application/json; charset=utf-8", |
| 1471 }; | 1597 }; |
| 1472 var resp = convert.JSON.encode(buildEmpty()); | 1598 var resp = convert.JSON.encode(buildListLogsResponse()); |
| 1473 return new async.Future.value(stringResponse(200, h, resp)); | 1599 return new async.Future.value(stringResponse(200, h, resp)); |
| 1474 }), true); | 1600 }), true); |
| 1475 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { | 1601 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListLogsResponse response) { |
| 1476 checkEmpty(response); | 1602 checkListLogsResponse(response); |
| 1477 }))); | 1603 }))); |
| 1478 }); | 1604 }); |
| 1479 | 1605 |
| 1480 }); | 1606 }); |
| 1481 | 1607 |
| 1482 | 1608 |
| 1483 unittest.group("resource-OrganizationsSinksResourceApi", () { | 1609 unittest.group("resource-FoldersSinksResourceApi", () { |
| 1484 unittest.test("method--create", () { | 1610 unittest.test("method--create", () { |
| 1485 | 1611 |
| 1486 var mock = new HttpServerMock(); | 1612 var mock = new HttpServerMock(); |
| 1487 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 1613 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1488 var arg_request = buildLogSink(); | 1614 var arg_request = buildLogSink(); |
| 1489 var arg_parent = "foo"; | 1615 var arg_parent = "foo"; |
| 1490 var arg_uniqueWriterIdentity = true; | 1616 var arg_uniqueWriterIdentity = true; |
| 1491 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1617 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1492 var obj = new api.LogSink.fromJson(json); | 1618 var obj = new api.LogSink.fromJson(json); |
| 1493 checkLogSink(obj); | 1619 checkLogSink(obj); |
| 1494 | 1620 |
| 1495 var path = (req.url).path; | 1621 var path = (req.url).path; |
| 1496 var pathOffset = 0; | 1622 var pathOffset = 0; |
| 1497 var index; | 1623 var index; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1528 return new async.Future.value(stringResponse(200, h, resp)); | 1654 return new async.Future.value(stringResponse(200, h, resp)); |
| 1529 }), true); | 1655 }), true); |
| 1530 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync(((api.LogSink response) { | 1656 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync(((api.LogSink response) { |
| 1531 checkLogSink(response); | 1657 checkLogSink(response); |
| 1532 }))); | 1658 }))); |
| 1533 }); | 1659 }); |
| 1534 | 1660 |
| 1535 unittest.test("method--delete", () { | 1661 unittest.test("method--delete", () { |
| 1536 | 1662 |
| 1537 var mock = new HttpServerMock(); | 1663 var mock = new HttpServerMock(); |
| 1538 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 1664 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1539 var arg_sinkName = "foo"; | 1665 var arg_sinkName = "foo"; |
| 1540 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1666 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1541 var path = (req.url).path; | 1667 var path = (req.url).path; |
| 1542 var pathOffset = 0; | 1668 var pathOffset = 0; |
| 1543 var index; | 1669 var index; |
| 1544 var subPart; | 1670 var subPart; |
| 1545 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1671 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1546 pathOffset += 1; | 1672 pathOffset += 1; |
| 1547 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1673 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1548 pathOffset += 3; | 1674 pathOffset += 3; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1573 return new async.Future.value(stringResponse(200, h, resp)); | 1699 return new async.Future.value(stringResponse(200, h, resp)); |
| 1574 }), true); | 1700 }), true); |
| 1575 res.delete(arg_sinkName).then(unittest.expectAsync(((api.Empty response) { | 1701 res.delete(arg_sinkName).then(unittest.expectAsync(((api.Empty response) { |
| 1576 checkEmpty(response); | 1702 checkEmpty(response); |
| 1577 }))); | 1703 }))); |
| 1578 }); | 1704 }); |
| 1579 | 1705 |
| 1580 unittest.test("method--get", () { | 1706 unittest.test("method--get", () { |
| 1581 | 1707 |
| 1582 var mock = new HttpServerMock(); | 1708 var mock = new HttpServerMock(); |
| 1583 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 1709 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1584 var arg_sinkName = "foo"; | 1710 var arg_sinkName = "foo"; |
| 1585 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1711 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1586 var path = (req.url).path; | 1712 var path = (req.url).path; |
| 1587 var pathOffset = 0; | 1713 var pathOffset = 0; |
| 1588 var index; | 1714 var index; |
| 1589 var subPart; | 1715 var subPart; |
| 1590 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1716 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1591 pathOffset += 1; | 1717 pathOffset += 1; |
| 1592 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1718 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1593 pathOffset += 3; | 1719 pathOffset += 3; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1618 return new async.Future.value(stringResponse(200, h, resp)); | 1744 return new async.Future.value(stringResponse(200, h, resp)); |
| 1619 }), true); | 1745 }), true); |
| 1620 res.get(arg_sinkName).then(unittest.expectAsync(((api.LogSink response) { | 1746 res.get(arg_sinkName).then(unittest.expectAsync(((api.LogSink response) { |
| 1621 checkLogSink(response); | 1747 checkLogSink(response); |
| 1622 }))); | 1748 }))); |
| 1623 }); | 1749 }); |
| 1624 | 1750 |
| 1625 unittest.test("method--list", () { | 1751 unittest.test("method--list", () { |
| 1626 | 1752 |
| 1627 var mock = new HttpServerMock(); | 1753 var mock = new HttpServerMock(); |
| 1628 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 1754 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1629 var arg_parent = "foo"; | 1755 var arg_parent = "foo"; |
| 1630 var arg_pageSize = 42; | 1756 var arg_pageSize = 42; |
| 1631 var arg_pageToken = "foo"; | 1757 var arg_pageToken = "foo"; |
| 1632 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1758 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1633 var path = (req.url).path; | 1759 var path = (req.url).path; |
| 1634 var pathOffset = 0; | 1760 var pathOffset = 0; |
| 1635 var index; | 1761 var index; |
| 1636 var subPart; | 1762 var subPart; |
| 1637 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1763 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1638 pathOffset += 1; | 1764 pathOffset += 1; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1667 return new async.Future.value(stringResponse(200, h, resp)); | 1793 return new async.Future.value(stringResponse(200, h, resp)); |
| 1668 }), true); | 1794 }), true); |
| 1669 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListSinksResponse response) { | 1795 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListSinksResponse response) { |
| 1670 checkListSinksResponse(response); | 1796 checkListSinksResponse(response); |
| 1671 }))); | 1797 }))); |
| 1672 }); | 1798 }); |
| 1673 | 1799 |
| 1674 unittest.test("method--update", () { | 1800 unittest.test("method--update", () { |
| 1675 | 1801 |
| 1676 var mock = new HttpServerMock(); | 1802 var mock = new HttpServerMock(); |
| 1677 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 1803 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1678 var arg_request = buildLogSink(); | 1804 var arg_request = buildLogSink(); |
| 1679 var arg_sinkName = "foo"; | 1805 var arg_sinkName = "foo"; |
| 1680 var arg_uniqueWriterIdentity = true; | 1806 var arg_uniqueWriterIdentity = true; |
| 1681 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1807 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1682 var obj = new api.LogSink.fromJson(json); | 1808 var obj = new api.LogSink.fromJson(json); |
| 1683 checkLogSink(obj); | 1809 checkLogSink(obj); |
| 1684 | 1810 |
| 1685 var path = (req.url).path; | 1811 var path = (req.url).path; |
| 1686 var pathOffset = 0; | 1812 var pathOffset = 0; |
| 1687 var index; | 1813 var index; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1718 return new async.Future.value(stringResponse(200, h, resp)); | 1844 return new async.Future.value(stringResponse(200, h, resp)); |
| 1719 }), true); | 1845 }), true); |
| 1720 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { | 1846 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { |
| 1721 checkLogSink(response); | 1847 checkLogSink(response); |
| 1722 }))); | 1848 }))); |
| 1723 }); | 1849 }); |
| 1724 | 1850 |
| 1725 }); | 1851 }); |
| 1726 | 1852 |
| 1727 | 1853 |
| 1728 unittest.group("resource-ProjectsLogsResourceApi", () { | 1854 unittest.group("resource-MonitoredResourceDescriptorsResourceApi", () { |
| 1855 unittest.test("method--list", () { |
| 1856 |
| 1857 var mock = new HttpServerMock(); |
| 1858 api.MonitoredResourceDescriptorsResourceApi res = new api.LoggingApi(mock)
.monitoredResourceDescriptors; |
| 1859 var arg_pageSize = 42; |
| 1860 var arg_pageToken = "foo"; |
| 1861 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1862 var path = (req.url).path; |
| 1863 var pathOffset = 0; |
| 1864 var index; |
| 1865 var subPart; |
| 1866 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1867 pathOffset += 1; |
| 1868 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("v2/monitoredResourceDescriptors")); |
| 1869 pathOffset += 31; |
| 1870 |
| 1871 var query = (req.url).query; |
| 1872 var queryOffset = 0; |
| 1873 var queryMap = {}; |
| 1874 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1875 parseBool(n) { |
| 1876 if (n == "true") return true; |
| 1877 if (n == "false") return false; |
| 1878 if (n == null) return null; |
| 1879 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1880 } |
| 1881 if (query.length > 0) { |
| 1882 for (var part in query.split("&")) { |
| 1883 var keyvalue = part.split("="); |
| 1884 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1885 } |
| 1886 } |
| 1887 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1888 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1889 |
| 1890 |
| 1891 var h = { |
| 1892 "content-type" : "application/json; charset=utf-8", |
| 1893 }; |
| 1894 var resp = convert.JSON.encode(buildListMonitoredResourceDescriptorsResp
onse()); |
| 1895 return new async.Future.value(stringResponse(200, h, resp)); |
| 1896 }), true); |
| 1897 res.list(pageSize: arg_pageSize, pageToken: arg_pageToken).then(unittest.e
xpectAsync(((api.ListMonitoredResourceDescriptorsResponse response) { |
| 1898 checkListMonitoredResourceDescriptorsResponse(response); |
| 1899 }))); |
| 1900 }); |
| 1901 |
| 1902 }); |
| 1903 |
| 1904 |
| 1905 unittest.group("resource-OrganizationsLogsResourceApi", () { |
| 1729 unittest.test("method--delete", () { | 1906 unittest.test("method--delete", () { |
| 1730 | 1907 |
| 1731 var mock = new HttpServerMock(); | 1908 var mock = new HttpServerMock(); |
| 1732 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; | 1909 api.OrganizationsLogsResourceApi res = new api.LoggingApi(mock).organizati
ons.logs; |
| 1733 var arg_logName = "foo"; | 1910 var arg_logName = "foo"; |
| 1734 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1911 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1735 var path = (req.url).path; | 1912 var path = (req.url).path; |
| 1736 var pathOffset = 0; | 1913 var pathOffset = 0; |
| 1737 var index; | 1914 var index; |
| 1738 var subPart; | 1915 var subPart; |
| 1739 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1916 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1740 pathOffset += 1; | 1917 pathOffset += 1; |
| 1741 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1918 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1742 pathOffset += 3; | 1919 pathOffset += 3; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1764 "content-type" : "application/json; charset=utf-8", | 1941 "content-type" : "application/json; charset=utf-8", |
| 1765 }; | 1942 }; |
| 1766 var resp = convert.JSON.encode(buildEmpty()); | 1943 var resp = convert.JSON.encode(buildEmpty()); |
| 1767 return new async.Future.value(stringResponse(200, h, resp)); | 1944 return new async.Future.value(stringResponse(200, h, resp)); |
| 1768 }), true); | 1945 }), true); |
| 1769 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { | 1946 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { |
| 1770 checkEmpty(response); | 1947 checkEmpty(response); |
| 1771 }))); | 1948 }))); |
| 1772 }); | 1949 }); |
| 1773 | 1950 |
| 1951 unittest.test("method--list", () { |
| 1952 |
| 1953 var mock = new HttpServerMock(); |
| 1954 api.OrganizationsLogsResourceApi res = new api.LoggingApi(mock).organizati
ons.logs; |
| 1955 var arg_parent = "foo"; |
| 1956 var arg_pageSize = 42; |
| 1957 var arg_pageToken = "foo"; |
| 1958 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1959 var path = (req.url).path; |
| 1960 var pathOffset = 0; |
| 1961 var index; |
| 1962 var subPart; |
| 1963 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1964 pathOffset += 1; |
| 1965 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1966 pathOffset += 3; |
| 1967 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1968 |
| 1969 var query = (req.url).query; |
| 1970 var queryOffset = 0; |
| 1971 var queryMap = {}; |
| 1972 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1973 parseBool(n) { |
| 1974 if (n == "true") return true; |
| 1975 if (n == "false") return false; |
| 1976 if (n == null) return null; |
| 1977 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1978 } |
| 1979 if (query.length > 0) { |
| 1980 for (var part in query.split("&")) { |
| 1981 var keyvalue = part.split("="); |
| 1982 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1983 } |
| 1984 } |
| 1985 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1986 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1987 |
| 1988 |
| 1989 var h = { |
| 1990 "content-type" : "application/json; charset=utf-8", |
| 1991 }; |
| 1992 var resp = convert.JSON.encode(buildListLogsResponse()); |
| 1993 return new async.Future.value(stringResponse(200, h, resp)); |
| 1994 }), true); |
| 1995 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListLogsResponse response) { |
| 1996 checkListLogsResponse(response); |
| 1997 }))); |
| 1998 }); |
| 1999 |
| 1774 }); | 2000 }); |
| 1775 | 2001 |
| 1776 | 2002 |
| 2003 unittest.group("resource-OrganizationsSinksResourceApi", () { |
| 2004 unittest.test("method--create", () { |
| 2005 |
| 2006 var mock = new HttpServerMock(); |
| 2007 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
| 2008 var arg_request = buildLogSink(); |
| 2009 var arg_parent = "foo"; |
| 2010 var arg_uniqueWriterIdentity = true; |
| 2011 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2012 var obj = new api.LogSink.fromJson(json); |
| 2013 checkLogSink(obj); |
| 2014 |
| 2015 var path = (req.url).path; |
| 2016 var pathOffset = 0; |
| 2017 var index; |
| 2018 var subPart; |
| 2019 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2020 pathOffset += 1; |
| 2021 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2022 pathOffset += 3; |
| 2023 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2024 |
| 2025 var query = (req.url).query; |
| 2026 var queryOffset = 0; |
| 2027 var queryMap = {}; |
| 2028 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2029 parseBool(n) { |
| 2030 if (n == "true") return true; |
| 2031 if (n == "false") return false; |
| 2032 if (n == null) return null; |
| 2033 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2034 } |
| 2035 if (query.length > 0) { |
| 2036 for (var part in query.split("&")) { |
| 2037 var keyvalue = part.split("="); |
| 2038 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2039 } |
| 2040 } |
| 2041 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
| 2042 |
| 2043 |
| 2044 var h = { |
| 2045 "content-type" : "application/json; charset=utf-8", |
| 2046 }; |
| 2047 var resp = convert.JSON.encode(buildLogSink()); |
| 2048 return new async.Future.value(stringResponse(200, h, resp)); |
| 2049 }), true); |
| 2050 res.create(arg_request, arg_parent, uniqueWriterIdentity: arg_uniqueWriter
Identity).then(unittest.expectAsync(((api.LogSink response) { |
| 2051 checkLogSink(response); |
| 2052 }))); |
| 2053 }); |
| 2054 |
| 2055 unittest.test("method--delete", () { |
| 2056 |
| 2057 var mock = new HttpServerMock(); |
| 2058 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
| 2059 var arg_sinkName = "foo"; |
| 2060 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2061 var path = (req.url).path; |
| 2062 var pathOffset = 0; |
| 2063 var index; |
| 2064 var subPart; |
| 2065 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2066 pathOffset += 1; |
| 2067 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2068 pathOffset += 3; |
| 2069 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2070 |
| 2071 var query = (req.url).query; |
| 2072 var queryOffset = 0; |
| 2073 var queryMap = {}; |
| 2074 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2075 parseBool(n) { |
| 2076 if (n == "true") return true; |
| 2077 if (n == "false") return false; |
| 2078 if (n == null) return null; |
| 2079 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2080 } |
| 2081 if (query.length > 0) { |
| 2082 for (var part in query.split("&")) { |
| 2083 var keyvalue = part.split("="); |
| 2084 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2085 } |
| 2086 } |
| 2087 |
| 2088 |
| 2089 var h = { |
| 2090 "content-type" : "application/json; charset=utf-8", |
| 2091 }; |
| 2092 var resp = convert.JSON.encode(buildEmpty()); |
| 2093 return new async.Future.value(stringResponse(200, h, resp)); |
| 2094 }), true); |
| 2095 res.delete(arg_sinkName).then(unittest.expectAsync(((api.Empty response) { |
| 2096 checkEmpty(response); |
| 2097 }))); |
| 2098 }); |
| 2099 |
| 2100 unittest.test("method--get", () { |
| 2101 |
| 2102 var mock = new HttpServerMock(); |
| 2103 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
| 2104 var arg_sinkName = "foo"; |
| 2105 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2106 var path = (req.url).path; |
| 2107 var pathOffset = 0; |
| 2108 var index; |
| 2109 var subPart; |
| 2110 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2111 pathOffset += 1; |
| 2112 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2113 pathOffset += 3; |
| 2114 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2115 |
| 2116 var query = (req.url).query; |
| 2117 var queryOffset = 0; |
| 2118 var queryMap = {}; |
| 2119 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2120 parseBool(n) { |
| 2121 if (n == "true") return true; |
| 2122 if (n == "false") return false; |
| 2123 if (n == null) return null; |
| 2124 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2125 } |
| 2126 if (query.length > 0) { |
| 2127 for (var part in query.split("&")) { |
| 2128 var keyvalue = part.split("="); |
| 2129 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2130 } |
| 2131 } |
| 2132 |
| 2133 |
| 2134 var h = { |
| 2135 "content-type" : "application/json; charset=utf-8", |
| 2136 }; |
| 2137 var resp = convert.JSON.encode(buildLogSink()); |
| 2138 return new async.Future.value(stringResponse(200, h, resp)); |
| 2139 }), true); |
| 2140 res.get(arg_sinkName).then(unittest.expectAsync(((api.LogSink response) { |
| 2141 checkLogSink(response); |
| 2142 }))); |
| 2143 }); |
| 2144 |
| 2145 unittest.test("method--list", () { |
| 2146 |
| 2147 var mock = new HttpServerMock(); |
| 2148 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
| 2149 var arg_parent = "foo"; |
| 2150 var arg_pageSize = 42; |
| 2151 var arg_pageToken = "foo"; |
| 2152 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2153 var path = (req.url).path; |
| 2154 var pathOffset = 0; |
| 2155 var index; |
| 2156 var subPart; |
| 2157 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2158 pathOffset += 1; |
| 2159 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2160 pathOffset += 3; |
| 2161 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2162 |
| 2163 var query = (req.url).query; |
| 2164 var queryOffset = 0; |
| 2165 var queryMap = {}; |
| 2166 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2167 parseBool(n) { |
| 2168 if (n == "true") return true; |
| 2169 if (n == "false") return false; |
| 2170 if (n == null) return null; |
| 2171 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2172 } |
| 2173 if (query.length > 0) { |
| 2174 for (var part in query.split("&")) { |
| 2175 var keyvalue = part.split("="); |
| 2176 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2177 } |
| 2178 } |
| 2179 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2180 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2181 |
| 2182 |
| 2183 var h = { |
| 2184 "content-type" : "application/json; charset=utf-8", |
| 2185 }; |
| 2186 var resp = convert.JSON.encode(buildListSinksResponse()); |
| 2187 return new async.Future.value(stringResponse(200, h, resp)); |
| 2188 }), true); |
| 2189 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListSinksResponse response) { |
| 2190 checkListSinksResponse(response); |
| 2191 }))); |
| 2192 }); |
| 2193 |
| 2194 unittest.test("method--update", () { |
| 2195 |
| 2196 var mock = new HttpServerMock(); |
| 2197 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
| 2198 var arg_request = buildLogSink(); |
| 2199 var arg_sinkName = "foo"; |
| 2200 var arg_uniqueWriterIdentity = true; |
| 2201 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2202 var obj = new api.LogSink.fromJson(json); |
| 2203 checkLogSink(obj); |
| 2204 |
| 2205 var path = (req.url).path; |
| 2206 var pathOffset = 0; |
| 2207 var index; |
| 2208 var subPart; |
| 2209 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2210 pathOffset += 1; |
| 2211 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2212 pathOffset += 3; |
| 2213 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2214 |
| 2215 var query = (req.url).query; |
| 2216 var queryOffset = 0; |
| 2217 var queryMap = {}; |
| 2218 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2219 parseBool(n) { |
| 2220 if (n == "true") return true; |
| 2221 if (n == "false") return false; |
| 2222 if (n == null) return null; |
| 2223 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2224 } |
| 2225 if (query.length > 0) { |
| 2226 for (var part in query.split("&")) { |
| 2227 var keyvalue = part.split("="); |
| 2228 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2229 } |
| 2230 } |
| 2231 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
| 2232 |
| 2233 |
| 2234 var h = { |
| 2235 "content-type" : "application/json; charset=utf-8", |
| 2236 }; |
| 2237 var resp = convert.JSON.encode(buildLogSink()); |
| 2238 return new async.Future.value(stringResponse(200, h, resp)); |
| 2239 }), true); |
| 2240 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { |
| 2241 checkLogSink(response); |
| 2242 }))); |
| 2243 }); |
| 2244 |
| 2245 }); |
| 2246 |
| 2247 |
| 2248 unittest.group("resource-ProjectsLogsResourceApi", () { |
| 2249 unittest.test("method--delete", () { |
| 2250 |
| 2251 var mock = new HttpServerMock(); |
| 2252 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; |
| 2253 var arg_logName = "foo"; |
| 2254 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2255 var path = (req.url).path; |
| 2256 var pathOffset = 0; |
| 2257 var index; |
| 2258 var subPart; |
| 2259 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2260 pathOffset += 1; |
| 2261 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2262 pathOffset += 3; |
| 2263 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2264 |
| 2265 var query = (req.url).query; |
| 2266 var queryOffset = 0; |
| 2267 var queryMap = {}; |
| 2268 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2269 parseBool(n) { |
| 2270 if (n == "true") return true; |
| 2271 if (n == "false") return false; |
| 2272 if (n == null) return null; |
| 2273 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2274 } |
| 2275 if (query.length > 0) { |
| 2276 for (var part in query.split("&")) { |
| 2277 var keyvalue = part.split("="); |
| 2278 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2279 } |
| 2280 } |
| 2281 |
| 2282 |
| 2283 var h = { |
| 2284 "content-type" : "application/json; charset=utf-8", |
| 2285 }; |
| 2286 var resp = convert.JSON.encode(buildEmpty()); |
| 2287 return new async.Future.value(stringResponse(200, h, resp)); |
| 2288 }), true); |
| 2289 res.delete(arg_logName).then(unittest.expectAsync(((api.Empty response) { |
| 2290 checkEmpty(response); |
| 2291 }))); |
| 2292 }); |
| 2293 |
| 2294 unittest.test("method--list", () { |
| 2295 |
| 2296 var mock = new HttpServerMock(); |
| 2297 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; |
| 2298 var arg_parent = "foo"; |
| 2299 var arg_pageSize = 42; |
| 2300 var arg_pageToken = "foo"; |
| 2301 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2302 var path = (req.url).path; |
| 2303 var pathOffset = 0; |
| 2304 var index; |
| 2305 var subPart; |
| 2306 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2307 pathOffset += 1; |
| 2308 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2309 pathOffset += 3; |
| 2310 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2311 |
| 2312 var query = (req.url).query; |
| 2313 var queryOffset = 0; |
| 2314 var queryMap = {}; |
| 2315 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2316 parseBool(n) { |
| 2317 if (n == "true") return true; |
| 2318 if (n == "false") return false; |
| 2319 if (n == null) return null; |
| 2320 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2321 } |
| 2322 if (query.length > 0) { |
| 2323 for (var part in query.split("&")) { |
| 2324 var keyvalue = part.split("="); |
| 2325 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2326 } |
| 2327 } |
| 2328 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2329 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2330 |
| 2331 |
| 2332 var h = { |
| 2333 "content-type" : "application/json; charset=utf-8", |
| 2334 }; |
| 2335 var resp = convert.JSON.encode(buildListLogsResponse()); |
| 2336 return new async.Future.value(stringResponse(200, h, resp)); |
| 2337 }), true); |
| 2338 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListLogsResponse response) { |
| 2339 checkListLogsResponse(response); |
| 2340 }))); |
| 2341 }); |
| 2342 |
| 2343 }); |
| 2344 |
| 2345 |
| 1777 unittest.group("resource-ProjectsMetricsResourceApi", () { | 2346 unittest.group("resource-ProjectsMetricsResourceApi", () { |
| 1778 unittest.test("method--create", () { | 2347 unittest.test("method--create", () { |
| 1779 | 2348 |
| 1780 var mock = new HttpServerMock(); | 2349 var mock = new HttpServerMock(); |
| 1781 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2350 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
| 1782 var arg_request = buildLogMetric(); | 2351 var arg_request = buildLogMetric(); |
| 1783 var arg_parent = "foo"; | 2352 var arg_parent = "foo"; |
| 1784 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2353 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1785 var obj = new api.LogMetric.fromJson(json); | 2354 var obj = new api.LogMetric.fromJson(json); |
| 1786 checkLogMetric(obj); | 2355 checkLogMetric(obj); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2255 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { | 2824 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync(((api.LogSink response) { |
| 2256 checkLogSink(response); | 2825 checkLogSink(response); |
| 2257 }))); | 2826 }))); |
| 2258 }); | 2827 }); |
| 2259 | 2828 |
| 2260 }); | 2829 }); |
| 2261 | 2830 |
| 2262 | 2831 |
| 2263 } | 2832 } |
| 2264 | 2833 |
| OLD | NEW |