Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 1 | // ignore_for_file: avoid_returning_null |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2 | // ignore_for_file: camel_case_types |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 3 | // ignore_for_file: cascade_invocations |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4 | // ignore_for_file: comment_references |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 5 | // ignore_for_file: file_names |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6 | // ignore_for_file: library_names |
| 7 | // ignore_for_file: lines_longer_than_80_chars |
| 8 | // ignore_for_file: non_constant_identifier_names |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 9 | // ignore_for_file: prefer_expression_function_bodies |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 10 | // ignore_for_file: prefer_final_locals |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 11 | // ignore_for_file: prefer_interpolation_to_compose_strings |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 12 | // ignore_for_file: prefer_single_quotes |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 13 | // ignore_for_file: unnecessary_brace_in_string_interps |
| 14 | // ignore_for_file: unnecessary_cast |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 15 | // ignore_for_file: unnecessary_lambdas |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 16 | // ignore_for_file: unnecessary_parenthesis |
| 17 | // ignore_for_file: unnecessary_string_interpolations |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 18 | // ignore_for_file: unused_local_variable |
| 19 | |
Kevin Moore | 2282df3 | 2021-01-27 19:15:24 -0800 | [diff] [blame] | 20 | import 'dart:async' as async; |
| 21 | import 'dart:convert' as convert; |
| 22 | import 'dart:core' as core; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 23 | |
| 24 | import 'package:http/http.dart' as http; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 25 | import 'package:test/test.dart' as unittest; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 26 | import 'package:googleapis/clouddebugger/v2.dart' as api; |
| 27 | |
Kevin Moore | 2282df3 | 2021-01-27 19:15:24 -0800 | [diff] [blame] | 28 | import '../test_shared.dart'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 29 | |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 30 | core.int buildCounterAliasContext = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 31 | api.AliasContext buildAliasContext() { |
| 32 | var o = api.AliasContext(); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 33 | buildCounterAliasContext++; |
| 34 | if (buildCounterAliasContext < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 35 | o.kind = 'foo'; |
| 36 | o.name = 'foo'; |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 37 | } |
| 38 | buildCounterAliasContext--; |
| 39 | return o; |
| 40 | } |
| 41 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 42 | void checkAliasContext(api.AliasContext o) { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 43 | buildCounterAliasContext++; |
| 44 | if (buildCounterAliasContext < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 45 | unittest.expect( |
| 46 | o.kind!, |
| 47 | unittest.equals('foo'), |
| 48 | ); |
| 49 | unittest.expect( |
| 50 | o.name!, |
| 51 | unittest.equals('foo'), |
| 52 | ); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 53 | } |
| 54 | buildCounterAliasContext--; |
| 55 | } |
| 56 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 57 | core.List<api.Variable> buildUnnamed4410() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 58 | var o = <api.Variable>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 59 | o.add(buildVariable()); |
| 60 | o.add(buildVariable()); |
| 61 | return o; |
| 62 | } |
| 63 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 64 | void checkUnnamed4410(core.List<api.Variable> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 65 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 66 | checkVariable(o[0] as api.Variable); |
| 67 | checkVariable(o[1] as api.Variable); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 68 | } |
| 69 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 70 | core.List<core.String> buildUnnamed4411() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 71 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 72 | o.add('foo'); |
| 73 | o.add('foo'); |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 74 | return o; |
| 75 | } |
| 76 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 77 | void checkUnnamed4411(core.List<core.String> o) { |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 78 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 79 | unittest.expect( |
| 80 | o[0], |
| 81 | unittest.equals('foo'), |
| 82 | ); |
| 83 | unittest.expect( |
| 84 | o[1], |
| 85 | unittest.equals('foo'), |
| 86 | ); |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 87 | } |
| 88 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 89 | core.Map<core.String, core.String> buildUnnamed4412() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 90 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 91 | o['x'] = 'foo'; |
| 92 | o['y'] = 'foo'; |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 93 | return o; |
| 94 | } |
| 95 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 96 | void checkUnnamed4412(core.Map<core.String, core.String> o) { |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 97 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 98 | unittest.expect( |
| 99 | o['x']!, |
| 100 | unittest.equals('foo'), |
| 101 | ); |
| 102 | unittest.expect( |
| 103 | o['y']!, |
| 104 | unittest.equals('foo'), |
| 105 | ); |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 106 | } |
| 107 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 108 | core.List<api.StackFrame> buildUnnamed4413() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 109 | var o = <api.StackFrame>[]; |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 110 | o.add(buildStackFrame()); |
| 111 | o.add(buildStackFrame()); |
| 112 | return o; |
| 113 | } |
| 114 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 115 | void checkUnnamed4413(core.List<api.StackFrame> o) { |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 116 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 117 | checkStackFrame(o[0] as api.StackFrame); |
| 118 | checkStackFrame(o[1] as api.StackFrame); |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 119 | } |
| 120 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 121 | core.List<api.Variable> buildUnnamed4414() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 122 | var o = <api.Variable>[]; |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 123 | o.add(buildVariable()); |
| 124 | o.add(buildVariable()); |
| 125 | return o; |
| 126 | } |
| 127 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 128 | void checkUnnamed4414(core.List<api.Variable> o) { |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 129 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 130 | checkVariable(o[0] as api.Variable); |
| 131 | checkVariable(o[1] as api.Variable); |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 132 | } |
| 133 | |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 134 | core.int buildCounterBreakpoint = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 135 | api.Breakpoint buildBreakpoint() { |
| 136 | var o = api.Breakpoint(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 137 | buildCounterBreakpoint++; |
| 138 | if (buildCounterBreakpoint < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 139 | o.action = 'foo'; |
| 140 | o.canaryExpireTime = 'foo'; |
| 141 | o.condition = 'foo'; |
| 142 | o.createTime = 'foo'; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 143 | o.evaluatedExpressions = buildUnnamed4410(); |
| 144 | o.expressions = buildUnnamed4411(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 145 | o.finalTime = 'foo'; |
| 146 | o.id = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 147 | o.isFinalState = true; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 148 | o.labels = buildUnnamed4412(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 149 | o.location = buildSourceLocation(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 150 | o.logLevel = 'foo'; |
| 151 | o.logMessageFormat = 'foo'; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 152 | o.stackFrames = buildUnnamed4413(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 153 | o.state = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 154 | o.status = buildStatusMessage(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 155 | o.userEmail = 'foo'; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 156 | o.variableTable = buildUnnamed4414(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 157 | } |
| 158 | buildCounterBreakpoint--; |
| 159 | return o; |
| 160 | } |
| 161 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 162 | void checkBreakpoint(api.Breakpoint o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 163 | buildCounterBreakpoint++; |
| 164 | if (buildCounterBreakpoint < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 165 | unittest.expect( |
| 166 | o.action!, |
| 167 | unittest.equals('foo'), |
| 168 | ); |
| 169 | unittest.expect( |
| 170 | o.canaryExpireTime!, |
| 171 | unittest.equals('foo'), |
| 172 | ); |
| 173 | unittest.expect( |
| 174 | o.condition!, |
| 175 | unittest.equals('foo'), |
| 176 | ); |
| 177 | unittest.expect( |
| 178 | o.createTime!, |
| 179 | unittest.equals('foo'), |
| 180 | ); |
| 181 | checkUnnamed4410(o.evaluatedExpressions!); |
| 182 | checkUnnamed4411(o.expressions!); |
| 183 | unittest.expect( |
| 184 | o.finalTime!, |
| 185 | unittest.equals('foo'), |
| 186 | ); |
| 187 | unittest.expect( |
| 188 | o.id!, |
| 189 | unittest.equals('foo'), |
| 190 | ); |
| 191 | unittest.expect(o.isFinalState!, unittest.isTrue); |
| 192 | checkUnnamed4412(o.labels!); |
| 193 | checkSourceLocation(o.location! as api.SourceLocation); |
| 194 | unittest.expect( |
| 195 | o.logLevel!, |
| 196 | unittest.equals('foo'), |
| 197 | ); |
| 198 | unittest.expect( |
| 199 | o.logMessageFormat!, |
| 200 | unittest.equals('foo'), |
| 201 | ); |
| 202 | checkUnnamed4413(o.stackFrames!); |
| 203 | unittest.expect( |
| 204 | o.state!, |
| 205 | unittest.equals('foo'), |
| 206 | ); |
| 207 | checkStatusMessage(o.status! as api.StatusMessage); |
| 208 | unittest.expect( |
| 209 | o.userEmail!, |
| 210 | unittest.equals('foo'), |
| 211 | ); |
| 212 | checkUnnamed4414(o.variableTable!); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 213 | } |
| 214 | buildCounterBreakpoint--; |
| 215 | } |
| 216 | |
| 217 | core.int buildCounterCloudRepoSourceContext = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 218 | api.CloudRepoSourceContext buildCloudRepoSourceContext() { |
| 219 | var o = api.CloudRepoSourceContext(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 220 | buildCounterCloudRepoSourceContext++; |
| 221 | if (buildCounterCloudRepoSourceContext < 3) { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 222 | o.aliasContext = buildAliasContext(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 223 | o.aliasName = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 224 | o.repoId = buildRepoId(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 225 | o.revisionId = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 226 | } |
| 227 | buildCounterCloudRepoSourceContext--; |
| 228 | return o; |
| 229 | } |
| 230 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 231 | void checkCloudRepoSourceContext(api.CloudRepoSourceContext o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 232 | buildCounterCloudRepoSourceContext++; |
| 233 | if (buildCounterCloudRepoSourceContext < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 234 | checkAliasContext(o.aliasContext! as api.AliasContext); |
| 235 | unittest.expect( |
| 236 | o.aliasName!, |
| 237 | unittest.equals('foo'), |
| 238 | ); |
| 239 | checkRepoId(o.repoId! as api.RepoId); |
| 240 | unittest.expect( |
| 241 | o.revisionId!, |
| 242 | unittest.equals('foo'), |
| 243 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 244 | } |
| 245 | buildCounterCloudRepoSourceContext--; |
| 246 | } |
| 247 | |
| 248 | core.int buildCounterCloudWorkspaceId = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 249 | api.CloudWorkspaceId buildCloudWorkspaceId() { |
| 250 | var o = api.CloudWorkspaceId(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 251 | buildCounterCloudWorkspaceId++; |
| 252 | if (buildCounterCloudWorkspaceId < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 253 | o.name = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 254 | o.repoId = buildRepoId(); |
| 255 | } |
| 256 | buildCounterCloudWorkspaceId--; |
| 257 | return o; |
| 258 | } |
| 259 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 260 | void checkCloudWorkspaceId(api.CloudWorkspaceId o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 261 | buildCounterCloudWorkspaceId++; |
| 262 | if (buildCounterCloudWorkspaceId < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 263 | unittest.expect( |
| 264 | o.name!, |
| 265 | unittest.equals('foo'), |
| 266 | ); |
| 267 | checkRepoId(o.repoId! as api.RepoId); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 268 | } |
| 269 | buildCounterCloudWorkspaceId--; |
| 270 | } |
| 271 | |
| 272 | core.int buildCounterCloudWorkspaceSourceContext = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 273 | api.CloudWorkspaceSourceContext buildCloudWorkspaceSourceContext() { |
| 274 | var o = api.CloudWorkspaceSourceContext(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 275 | buildCounterCloudWorkspaceSourceContext++; |
| 276 | if (buildCounterCloudWorkspaceSourceContext < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 277 | o.snapshotId = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 278 | o.workspaceId = buildCloudWorkspaceId(); |
| 279 | } |
| 280 | buildCounterCloudWorkspaceSourceContext--; |
| 281 | return o; |
| 282 | } |
| 283 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 284 | void checkCloudWorkspaceSourceContext(api.CloudWorkspaceSourceContext o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 285 | buildCounterCloudWorkspaceSourceContext++; |
| 286 | if (buildCounterCloudWorkspaceSourceContext < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 287 | unittest.expect( |
| 288 | o.snapshotId!, |
| 289 | unittest.equals('foo'), |
| 290 | ); |
| 291 | checkCloudWorkspaceId(o.workspaceId! as api.CloudWorkspaceId); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 292 | } |
| 293 | buildCounterCloudWorkspaceSourceContext--; |
| 294 | } |
| 295 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 296 | core.List<api.ExtendedSourceContext> buildUnnamed4415() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 297 | var o = <api.ExtendedSourceContext>[]; |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 298 | o.add(buildExtendedSourceContext()); |
| 299 | o.add(buildExtendedSourceContext()); |
| 300 | return o; |
| 301 | } |
| 302 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 303 | void checkUnnamed4415(core.List<api.ExtendedSourceContext> o) { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 304 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 305 | checkExtendedSourceContext(o[0] as api.ExtendedSourceContext); |
| 306 | checkExtendedSourceContext(o[1] as api.ExtendedSourceContext); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 307 | } |
| 308 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 309 | core.Map<core.String, core.String> buildUnnamed4416() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 310 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 311 | o['x'] = 'foo'; |
| 312 | o['y'] = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 313 | return o; |
| 314 | } |
| 315 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 316 | void checkUnnamed4416(core.Map<core.String, core.String> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 317 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 318 | unittest.expect( |
| 319 | o['x']!, |
| 320 | unittest.equals('foo'), |
| 321 | ); |
| 322 | unittest.expect( |
| 323 | o['y']!, |
| 324 | unittest.equals('foo'), |
| 325 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 326 | } |
| 327 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 328 | core.List<api.SourceContext> buildUnnamed4417() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 329 | var o = <api.SourceContext>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 330 | o.add(buildSourceContext()); |
| 331 | o.add(buildSourceContext()); |
| 332 | return o; |
| 333 | } |
| 334 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 335 | void checkUnnamed4417(core.List<api.SourceContext> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 336 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 337 | checkSourceContext(o[0] as api.SourceContext); |
| 338 | checkSourceContext(o[1] as api.SourceContext); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | core.int buildCounterDebuggee = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 342 | api.Debuggee buildDebuggee() { |
| 343 | var o = api.Debuggee(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 344 | buildCounterDebuggee++; |
| 345 | if (buildCounterDebuggee < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 346 | o.agentVersion = 'foo'; |
| 347 | o.canaryMode = 'foo'; |
| 348 | o.description = 'foo'; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 349 | o.extSourceContexts = buildUnnamed4415(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 350 | o.id = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 351 | o.isDisabled = true; |
| 352 | o.isInactive = true; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 353 | o.labels = buildUnnamed4416(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 354 | o.project = 'foo'; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 355 | o.sourceContexts = buildUnnamed4417(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 356 | o.status = buildStatusMessage(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 357 | o.uniquifier = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 358 | } |
| 359 | buildCounterDebuggee--; |
| 360 | return o; |
| 361 | } |
| 362 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 363 | void checkDebuggee(api.Debuggee o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 364 | buildCounterDebuggee++; |
| 365 | if (buildCounterDebuggee < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 366 | unittest.expect( |
| 367 | o.agentVersion!, |
| 368 | unittest.equals('foo'), |
| 369 | ); |
| 370 | unittest.expect( |
| 371 | o.canaryMode!, |
| 372 | unittest.equals('foo'), |
| 373 | ); |
| 374 | unittest.expect( |
| 375 | o.description!, |
| 376 | unittest.equals('foo'), |
| 377 | ); |
| 378 | checkUnnamed4415(o.extSourceContexts!); |
| 379 | unittest.expect( |
| 380 | o.id!, |
| 381 | unittest.equals('foo'), |
| 382 | ); |
| 383 | unittest.expect(o.isDisabled!, unittest.isTrue); |
| 384 | unittest.expect(o.isInactive!, unittest.isTrue); |
| 385 | checkUnnamed4416(o.labels!); |
| 386 | unittest.expect( |
| 387 | o.project!, |
| 388 | unittest.equals('foo'), |
| 389 | ); |
| 390 | checkUnnamed4417(o.sourceContexts!); |
| 391 | checkStatusMessage(o.status! as api.StatusMessage); |
| 392 | unittest.expect( |
| 393 | o.uniquifier!, |
| 394 | unittest.equals('foo'), |
| 395 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 396 | } |
| 397 | buildCounterDebuggee--; |
| 398 | } |
| 399 | |
| 400 | core.int buildCounterEmpty = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 401 | api.Empty buildEmpty() { |
| 402 | var o = api.Empty(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 403 | buildCounterEmpty++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 404 | if (buildCounterEmpty < 3) {} |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 405 | buildCounterEmpty--; |
| 406 | return o; |
| 407 | } |
| 408 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 409 | void checkEmpty(api.Empty o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 410 | buildCounterEmpty++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 411 | if (buildCounterEmpty < 3) {} |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 412 | buildCounterEmpty--; |
| 413 | } |
| 414 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 415 | core.Map<core.String, core.String> buildUnnamed4418() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 416 | var o = <core.String, core.String>{}; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 417 | o['x'] = 'foo'; |
| 418 | o['y'] = 'foo'; |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 419 | return o; |
| 420 | } |
| 421 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 422 | void checkUnnamed4418(core.Map<core.String, core.String> o) { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 423 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 424 | unittest.expect( |
| 425 | o['x']!, |
| 426 | unittest.equals('foo'), |
| 427 | ); |
| 428 | unittest.expect( |
| 429 | o['y']!, |
| 430 | unittest.equals('foo'), |
| 431 | ); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 432 | } |
| 433 | |
| 434 | core.int buildCounterExtendedSourceContext = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 435 | api.ExtendedSourceContext buildExtendedSourceContext() { |
| 436 | var o = api.ExtendedSourceContext(); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 437 | buildCounterExtendedSourceContext++; |
| 438 | if (buildCounterExtendedSourceContext < 3) { |
| 439 | o.context = buildSourceContext(); |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 440 | o.labels = buildUnnamed4418(); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 441 | } |
| 442 | buildCounterExtendedSourceContext--; |
| 443 | return o; |
| 444 | } |
| 445 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 446 | void checkExtendedSourceContext(api.ExtendedSourceContext o) { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 447 | buildCounterExtendedSourceContext++; |
| 448 | if (buildCounterExtendedSourceContext < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 449 | checkSourceContext(o.context! as api.SourceContext); |
| 450 | checkUnnamed4418(o.labels!); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 451 | } |
| 452 | buildCounterExtendedSourceContext--; |
| 453 | } |
| 454 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 455 | core.List<core.String> buildUnnamed4419() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 456 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 457 | o.add('foo'); |
| 458 | o.add('foo'); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 459 | return o; |
| 460 | } |
| 461 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 462 | void checkUnnamed4419(core.List<core.String> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 463 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 464 | unittest.expect( |
| 465 | o[0], |
| 466 | unittest.equals('foo'), |
| 467 | ); |
| 468 | unittest.expect( |
| 469 | o[1], |
| 470 | unittest.equals('foo'), |
| 471 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 472 | } |
| 473 | |
| 474 | core.int buildCounterFormatMessage = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 475 | api.FormatMessage buildFormatMessage() { |
| 476 | var o = api.FormatMessage(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 477 | buildCounterFormatMessage++; |
| 478 | if (buildCounterFormatMessage < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 479 | o.format = 'foo'; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 480 | o.parameters = buildUnnamed4419(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 481 | } |
| 482 | buildCounterFormatMessage--; |
| 483 | return o; |
| 484 | } |
| 485 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 486 | void checkFormatMessage(api.FormatMessage o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 487 | buildCounterFormatMessage++; |
| 488 | if (buildCounterFormatMessage < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 489 | unittest.expect( |
| 490 | o.format!, |
| 491 | unittest.equals('foo'), |
| 492 | ); |
| 493 | checkUnnamed4419(o.parameters!); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 494 | } |
| 495 | buildCounterFormatMessage--; |
| 496 | } |
| 497 | |
| 498 | core.int buildCounterGerritSourceContext = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 499 | api.GerritSourceContext buildGerritSourceContext() { |
| 500 | var o = api.GerritSourceContext(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 501 | buildCounterGerritSourceContext++; |
| 502 | if (buildCounterGerritSourceContext < 3) { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 503 | o.aliasContext = buildAliasContext(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 504 | o.aliasName = 'foo'; |
| 505 | o.gerritProject = 'foo'; |
| 506 | o.hostUri = 'foo'; |
| 507 | o.revisionId = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 508 | } |
| 509 | buildCounterGerritSourceContext--; |
| 510 | return o; |
| 511 | } |
| 512 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 513 | void checkGerritSourceContext(api.GerritSourceContext o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 514 | buildCounterGerritSourceContext++; |
| 515 | if (buildCounterGerritSourceContext < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 516 | checkAliasContext(o.aliasContext! as api.AliasContext); |
| 517 | unittest.expect( |
| 518 | o.aliasName!, |
| 519 | unittest.equals('foo'), |
| 520 | ); |
| 521 | unittest.expect( |
| 522 | o.gerritProject!, |
| 523 | unittest.equals('foo'), |
| 524 | ); |
| 525 | unittest.expect( |
| 526 | o.hostUri!, |
| 527 | unittest.equals('foo'), |
| 528 | ); |
| 529 | unittest.expect( |
| 530 | o.revisionId!, |
| 531 | unittest.equals('foo'), |
| 532 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 533 | } |
| 534 | buildCounterGerritSourceContext--; |
| 535 | } |
| 536 | |
| 537 | core.int buildCounterGetBreakpointResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 538 | api.GetBreakpointResponse buildGetBreakpointResponse() { |
| 539 | var o = api.GetBreakpointResponse(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 540 | buildCounterGetBreakpointResponse++; |
| 541 | if (buildCounterGetBreakpointResponse < 3) { |
| 542 | o.breakpoint = buildBreakpoint(); |
| 543 | } |
| 544 | buildCounterGetBreakpointResponse--; |
| 545 | return o; |
| 546 | } |
| 547 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 548 | void checkGetBreakpointResponse(api.GetBreakpointResponse o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 549 | buildCounterGetBreakpointResponse++; |
| 550 | if (buildCounterGetBreakpointResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 551 | checkBreakpoint(o.breakpoint! as api.Breakpoint); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 552 | } |
| 553 | buildCounterGetBreakpointResponse--; |
| 554 | } |
| 555 | |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 556 | core.int buildCounterGitSourceContext = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 557 | api.GitSourceContext buildGitSourceContext() { |
| 558 | var o = api.GitSourceContext(); |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 559 | buildCounterGitSourceContext++; |
| 560 | if (buildCounterGitSourceContext < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 561 | o.revisionId = 'foo'; |
| 562 | o.url = 'foo'; |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 563 | } |
| 564 | buildCounterGitSourceContext--; |
| 565 | return o; |
| 566 | } |
| 567 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 568 | void checkGitSourceContext(api.GitSourceContext o) { |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 569 | buildCounterGitSourceContext++; |
| 570 | if (buildCounterGitSourceContext < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 571 | unittest.expect( |
| 572 | o.revisionId!, |
| 573 | unittest.equals('foo'), |
| 574 | ); |
| 575 | unittest.expect( |
| 576 | o.url!, |
| 577 | unittest.equals('foo'), |
| 578 | ); |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 579 | } |
| 580 | buildCounterGitSourceContext--; |
| 581 | } |
| 582 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 583 | core.List<api.Breakpoint> buildUnnamed4420() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 584 | var o = <api.Breakpoint>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 585 | o.add(buildBreakpoint()); |
| 586 | o.add(buildBreakpoint()); |
| 587 | return o; |
| 588 | } |
| 589 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 590 | void checkUnnamed4420(core.List<api.Breakpoint> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 591 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 592 | checkBreakpoint(o[0] as api.Breakpoint); |
| 593 | checkBreakpoint(o[1] as api.Breakpoint); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 594 | } |
| 595 | |
| 596 | core.int buildCounterListActiveBreakpointsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 597 | api.ListActiveBreakpointsResponse buildListActiveBreakpointsResponse() { |
| 598 | var o = api.ListActiveBreakpointsResponse(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 599 | buildCounterListActiveBreakpointsResponse++; |
| 600 | if (buildCounterListActiveBreakpointsResponse < 3) { |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 601 | o.breakpoints = buildUnnamed4420(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 602 | o.nextWaitToken = 'foo'; |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 603 | o.waitExpired = true; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 604 | } |
| 605 | buildCounterListActiveBreakpointsResponse--; |
| 606 | return o; |
| 607 | } |
| 608 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 609 | void checkListActiveBreakpointsResponse(api.ListActiveBreakpointsResponse o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 610 | buildCounterListActiveBreakpointsResponse++; |
| 611 | if (buildCounterListActiveBreakpointsResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 612 | checkUnnamed4420(o.breakpoints!); |
| 613 | unittest.expect( |
| 614 | o.nextWaitToken!, |
| 615 | unittest.equals('foo'), |
| 616 | ); |
| 617 | unittest.expect(o.waitExpired!, unittest.isTrue); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 618 | } |
| 619 | buildCounterListActiveBreakpointsResponse--; |
| 620 | } |
| 621 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 622 | core.List<api.Breakpoint> buildUnnamed4421() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 623 | var o = <api.Breakpoint>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 624 | o.add(buildBreakpoint()); |
| 625 | o.add(buildBreakpoint()); |
| 626 | return o; |
| 627 | } |
| 628 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 629 | void checkUnnamed4421(core.List<api.Breakpoint> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 630 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 631 | checkBreakpoint(o[0] as api.Breakpoint); |
| 632 | checkBreakpoint(o[1] as api.Breakpoint); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 633 | } |
| 634 | |
| 635 | core.int buildCounterListBreakpointsResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 636 | api.ListBreakpointsResponse buildListBreakpointsResponse() { |
| 637 | var o = api.ListBreakpointsResponse(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 638 | buildCounterListBreakpointsResponse++; |
| 639 | if (buildCounterListBreakpointsResponse < 3) { |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 640 | o.breakpoints = buildUnnamed4421(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 641 | o.nextWaitToken = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 642 | } |
| 643 | buildCounterListBreakpointsResponse--; |
| 644 | return o; |
| 645 | } |
| 646 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 647 | void checkListBreakpointsResponse(api.ListBreakpointsResponse o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 648 | buildCounterListBreakpointsResponse++; |
| 649 | if (buildCounterListBreakpointsResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 650 | checkUnnamed4421(o.breakpoints!); |
| 651 | unittest.expect( |
| 652 | o.nextWaitToken!, |
| 653 | unittest.equals('foo'), |
| 654 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 655 | } |
| 656 | buildCounterListBreakpointsResponse--; |
| 657 | } |
| 658 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 659 | core.List<api.Debuggee> buildUnnamed4422() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 660 | var o = <api.Debuggee>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 661 | o.add(buildDebuggee()); |
| 662 | o.add(buildDebuggee()); |
| 663 | return o; |
| 664 | } |
| 665 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 666 | void checkUnnamed4422(core.List<api.Debuggee> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 667 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 668 | checkDebuggee(o[0] as api.Debuggee); |
| 669 | checkDebuggee(o[1] as api.Debuggee); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 670 | } |
| 671 | |
| 672 | core.int buildCounterListDebuggeesResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 673 | api.ListDebuggeesResponse buildListDebuggeesResponse() { |
| 674 | var o = api.ListDebuggeesResponse(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 675 | buildCounterListDebuggeesResponse++; |
| 676 | if (buildCounterListDebuggeesResponse < 3) { |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 677 | o.debuggees = buildUnnamed4422(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 678 | } |
| 679 | buildCounterListDebuggeesResponse--; |
| 680 | return o; |
| 681 | } |
| 682 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 683 | void checkListDebuggeesResponse(api.ListDebuggeesResponse o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 684 | buildCounterListDebuggeesResponse++; |
| 685 | if (buildCounterListDebuggeesResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 686 | checkUnnamed4422(o.debuggees!); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 687 | } |
| 688 | buildCounterListDebuggeesResponse--; |
| 689 | } |
| 690 | |
| 691 | core.int buildCounterProjectRepoId = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 692 | api.ProjectRepoId buildProjectRepoId() { |
| 693 | var o = api.ProjectRepoId(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 694 | buildCounterProjectRepoId++; |
| 695 | if (buildCounterProjectRepoId < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 696 | o.projectId = 'foo'; |
| 697 | o.repoName = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 698 | } |
| 699 | buildCounterProjectRepoId--; |
| 700 | return o; |
| 701 | } |
| 702 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 703 | void checkProjectRepoId(api.ProjectRepoId o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 704 | buildCounterProjectRepoId++; |
| 705 | if (buildCounterProjectRepoId < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 706 | unittest.expect( |
| 707 | o.projectId!, |
| 708 | unittest.equals('foo'), |
| 709 | ); |
| 710 | unittest.expect( |
| 711 | o.repoName!, |
| 712 | unittest.equals('foo'), |
| 713 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 714 | } |
| 715 | buildCounterProjectRepoId--; |
| 716 | } |
| 717 | |
| 718 | core.int buildCounterRegisterDebuggeeRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 719 | api.RegisterDebuggeeRequest buildRegisterDebuggeeRequest() { |
| 720 | var o = api.RegisterDebuggeeRequest(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 721 | buildCounterRegisterDebuggeeRequest++; |
| 722 | if (buildCounterRegisterDebuggeeRequest < 3) { |
| 723 | o.debuggee = buildDebuggee(); |
| 724 | } |
| 725 | buildCounterRegisterDebuggeeRequest--; |
| 726 | return o; |
| 727 | } |
| 728 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 729 | void checkRegisterDebuggeeRequest(api.RegisterDebuggeeRequest o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 730 | buildCounterRegisterDebuggeeRequest++; |
| 731 | if (buildCounterRegisterDebuggeeRequest < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 732 | checkDebuggee(o.debuggee! as api.Debuggee); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 733 | } |
| 734 | buildCounterRegisterDebuggeeRequest--; |
| 735 | } |
| 736 | |
| 737 | core.int buildCounterRegisterDebuggeeResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 738 | api.RegisterDebuggeeResponse buildRegisterDebuggeeResponse() { |
| 739 | var o = api.RegisterDebuggeeResponse(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 740 | buildCounterRegisterDebuggeeResponse++; |
| 741 | if (buildCounterRegisterDebuggeeResponse < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 742 | o.agentId = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 743 | o.debuggee = buildDebuggee(); |
| 744 | } |
| 745 | buildCounterRegisterDebuggeeResponse--; |
| 746 | return o; |
| 747 | } |
| 748 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 749 | void checkRegisterDebuggeeResponse(api.RegisterDebuggeeResponse o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 750 | buildCounterRegisterDebuggeeResponse++; |
| 751 | if (buildCounterRegisterDebuggeeResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 752 | unittest.expect( |
| 753 | o.agentId!, |
| 754 | unittest.equals('foo'), |
| 755 | ); |
| 756 | checkDebuggee(o.debuggee! as api.Debuggee); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 757 | } |
| 758 | buildCounterRegisterDebuggeeResponse--; |
| 759 | } |
| 760 | |
| 761 | core.int buildCounterRepoId = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 762 | api.RepoId buildRepoId() { |
| 763 | var o = api.RepoId(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 764 | buildCounterRepoId++; |
| 765 | if (buildCounterRepoId < 3) { |
| 766 | o.projectRepoId = buildProjectRepoId(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 767 | o.uid = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 768 | } |
| 769 | buildCounterRepoId--; |
| 770 | return o; |
| 771 | } |
| 772 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 773 | void checkRepoId(api.RepoId o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 774 | buildCounterRepoId++; |
| 775 | if (buildCounterRepoId < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 776 | checkProjectRepoId(o.projectRepoId! as api.ProjectRepoId); |
| 777 | unittest.expect( |
| 778 | o.uid!, |
| 779 | unittest.equals('foo'), |
| 780 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 781 | } |
| 782 | buildCounterRepoId--; |
| 783 | } |
| 784 | |
| 785 | core.int buildCounterSetBreakpointResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 786 | api.SetBreakpointResponse buildSetBreakpointResponse() { |
| 787 | var o = api.SetBreakpointResponse(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 788 | buildCounterSetBreakpointResponse++; |
| 789 | if (buildCounterSetBreakpointResponse < 3) { |
| 790 | o.breakpoint = buildBreakpoint(); |
| 791 | } |
| 792 | buildCounterSetBreakpointResponse--; |
| 793 | return o; |
| 794 | } |
| 795 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 796 | void checkSetBreakpointResponse(api.SetBreakpointResponse o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 797 | buildCounterSetBreakpointResponse++; |
| 798 | if (buildCounterSetBreakpointResponse < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 799 | checkBreakpoint(o.breakpoint! as api.Breakpoint); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 800 | } |
| 801 | buildCounterSetBreakpointResponse--; |
| 802 | } |
| 803 | |
| 804 | core.int buildCounterSourceContext = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 805 | api.SourceContext buildSourceContext() { |
| 806 | var o = api.SourceContext(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 807 | buildCounterSourceContext++; |
| 808 | if (buildCounterSourceContext < 3) { |
| 809 | o.cloudRepo = buildCloudRepoSourceContext(); |
| 810 | o.cloudWorkspace = buildCloudWorkspaceSourceContext(); |
| 811 | o.gerrit = buildGerritSourceContext(); |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 812 | o.git = buildGitSourceContext(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 813 | } |
| 814 | buildCounterSourceContext--; |
| 815 | return o; |
| 816 | } |
| 817 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 818 | void checkSourceContext(api.SourceContext o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 819 | buildCounterSourceContext++; |
| 820 | if (buildCounterSourceContext < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 821 | checkCloudRepoSourceContext(o.cloudRepo! as api.CloudRepoSourceContext); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 822 | checkCloudWorkspaceSourceContext( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 823 | o.cloudWorkspace! as api.CloudWorkspaceSourceContext); |
| 824 | checkGerritSourceContext(o.gerrit! as api.GerritSourceContext); |
| 825 | checkGitSourceContext(o.git! as api.GitSourceContext); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 826 | } |
| 827 | buildCounterSourceContext--; |
| 828 | } |
| 829 | |
| 830 | core.int buildCounterSourceLocation = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 831 | api.SourceLocation buildSourceLocation() { |
| 832 | var o = api.SourceLocation(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 833 | buildCounterSourceLocation++; |
| 834 | if (buildCounterSourceLocation < 3) { |
Martin Kustermann | 12cdd52 | 2018-08-27 10:46:50 +0200 | [diff] [blame] | 835 | o.column = 42; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 836 | o.line = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 837 | o.path = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 838 | } |
| 839 | buildCounterSourceLocation--; |
| 840 | return o; |
| 841 | } |
| 842 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 843 | void checkSourceLocation(api.SourceLocation o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 844 | buildCounterSourceLocation++; |
| 845 | if (buildCounterSourceLocation < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 846 | unittest.expect( |
| 847 | o.column!, |
| 848 | unittest.equals(42), |
| 849 | ); |
| 850 | unittest.expect( |
| 851 | o.line!, |
| 852 | unittest.equals(42), |
| 853 | ); |
| 854 | unittest.expect( |
| 855 | o.path!, |
| 856 | unittest.equals('foo'), |
| 857 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 858 | } |
| 859 | buildCounterSourceLocation--; |
| 860 | } |
| 861 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 862 | core.List<api.Variable> buildUnnamed4423() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 863 | var o = <api.Variable>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 864 | o.add(buildVariable()); |
| 865 | o.add(buildVariable()); |
| 866 | return o; |
| 867 | } |
| 868 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 869 | void checkUnnamed4423(core.List<api.Variable> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 870 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 871 | checkVariable(o[0] as api.Variable); |
| 872 | checkVariable(o[1] as api.Variable); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 873 | } |
| 874 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 875 | core.List<api.Variable> buildUnnamed4424() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 876 | var o = <api.Variable>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 877 | o.add(buildVariable()); |
| 878 | o.add(buildVariable()); |
| 879 | return o; |
| 880 | } |
| 881 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 882 | void checkUnnamed4424(core.List<api.Variable> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 883 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 884 | checkVariable(o[0] as api.Variable); |
| 885 | checkVariable(o[1] as api.Variable); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 886 | } |
| 887 | |
| 888 | core.int buildCounterStackFrame = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 889 | api.StackFrame buildStackFrame() { |
| 890 | var o = api.StackFrame(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 891 | buildCounterStackFrame++; |
| 892 | if (buildCounterStackFrame < 3) { |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 893 | o.arguments = buildUnnamed4423(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 894 | o.function = 'foo'; |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 895 | o.locals = buildUnnamed4424(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 896 | o.location = buildSourceLocation(); |
| 897 | } |
| 898 | buildCounterStackFrame--; |
| 899 | return o; |
| 900 | } |
| 901 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 902 | void checkStackFrame(api.StackFrame o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 903 | buildCounterStackFrame++; |
| 904 | if (buildCounterStackFrame < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 905 | checkUnnamed4423(o.arguments!); |
| 906 | unittest.expect( |
| 907 | o.function!, |
| 908 | unittest.equals('foo'), |
| 909 | ); |
| 910 | checkUnnamed4424(o.locals!); |
| 911 | checkSourceLocation(o.location! as api.SourceLocation); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 912 | } |
| 913 | buildCounterStackFrame--; |
| 914 | } |
| 915 | |
| 916 | core.int buildCounterStatusMessage = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 917 | api.StatusMessage buildStatusMessage() { |
| 918 | var o = api.StatusMessage(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 919 | buildCounterStatusMessage++; |
| 920 | if (buildCounterStatusMessage < 3) { |
| 921 | o.description = buildFormatMessage(); |
| 922 | o.isError = true; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 923 | o.refersTo = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 924 | } |
| 925 | buildCounterStatusMessage--; |
| 926 | return o; |
| 927 | } |
| 928 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 929 | void checkStatusMessage(api.StatusMessage o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 930 | buildCounterStatusMessage++; |
| 931 | if (buildCounterStatusMessage < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 932 | checkFormatMessage(o.description! as api.FormatMessage); |
| 933 | unittest.expect(o.isError!, unittest.isTrue); |
| 934 | unittest.expect( |
| 935 | o.refersTo!, |
| 936 | unittest.equals('foo'), |
| 937 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 938 | } |
| 939 | buildCounterStatusMessage--; |
| 940 | } |
| 941 | |
| 942 | core.int buildCounterUpdateActiveBreakpointRequest = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 943 | api.UpdateActiveBreakpointRequest buildUpdateActiveBreakpointRequest() { |
| 944 | var o = api.UpdateActiveBreakpointRequest(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 945 | buildCounterUpdateActiveBreakpointRequest++; |
| 946 | if (buildCounterUpdateActiveBreakpointRequest < 3) { |
| 947 | o.breakpoint = buildBreakpoint(); |
| 948 | } |
| 949 | buildCounterUpdateActiveBreakpointRequest--; |
| 950 | return o; |
| 951 | } |
| 952 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 953 | void checkUpdateActiveBreakpointRequest(api.UpdateActiveBreakpointRequest o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 954 | buildCounterUpdateActiveBreakpointRequest++; |
| 955 | if (buildCounterUpdateActiveBreakpointRequest < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 956 | checkBreakpoint(o.breakpoint! as api.Breakpoint); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 957 | } |
| 958 | buildCounterUpdateActiveBreakpointRequest--; |
| 959 | } |
| 960 | |
| 961 | core.int buildCounterUpdateActiveBreakpointResponse = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 962 | api.UpdateActiveBreakpointResponse buildUpdateActiveBreakpointResponse() { |
| 963 | var o = api.UpdateActiveBreakpointResponse(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 964 | buildCounterUpdateActiveBreakpointResponse++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 965 | if (buildCounterUpdateActiveBreakpointResponse < 3) {} |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 966 | buildCounterUpdateActiveBreakpointResponse--; |
| 967 | return o; |
| 968 | } |
| 969 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 970 | void checkUpdateActiveBreakpointResponse(api.UpdateActiveBreakpointResponse o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 971 | buildCounterUpdateActiveBreakpointResponse++; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 972 | if (buildCounterUpdateActiveBreakpointResponse < 3) {} |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 973 | buildCounterUpdateActiveBreakpointResponse--; |
| 974 | } |
| 975 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 976 | core.List<api.Variable> buildUnnamed4425() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 977 | var o = <api.Variable>[]; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 978 | o.add(buildVariable()); |
| 979 | o.add(buildVariable()); |
| 980 | return o; |
| 981 | } |
| 982 | |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 983 | void checkUnnamed4425(core.List<api.Variable> o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 984 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 985 | checkVariable(o[0] as api.Variable); |
| 986 | checkVariable(o[1] as api.Variable); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 987 | } |
| 988 | |
| 989 | core.int buildCounterVariable = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 990 | api.Variable buildVariable() { |
| 991 | var o = api.Variable(); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 992 | buildCounterVariable++; |
| 993 | if (buildCounterVariable < 3) { |
Kevin Moore | b3758bc | 2021-02-25 10:03:59 -0800 | [diff] [blame] | 994 | o.members = buildUnnamed4425(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 995 | o.name = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 996 | o.status = buildStatusMessage(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 997 | o.type = 'foo'; |
| 998 | o.value = 'foo'; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 999 | o.varTableIndex = 42; |
| 1000 | } |
| 1001 | buildCounterVariable--; |
| 1002 | return o; |
| 1003 | } |
| 1004 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1005 | void checkVariable(api.Variable o) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1006 | buildCounterVariable++; |
| 1007 | if (buildCounterVariable < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1008 | checkUnnamed4425(o.members!); |
| 1009 | unittest.expect( |
| 1010 | o.name!, |
| 1011 | unittest.equals('foo'), |
| 1012 | ); |
| 1013 | checkStatusMessage(o.status! as api.StatusMessage); |
| 1014 | unittest.expect( |
| 1015 | o.type!, |
| 1016 | unittest.equals('foo'), |
| 1017 | ); |
| 1018 | unittest.expect( |
| 1019 | o.value!, |
| 1020 | unittest.equals('foo'), |
| 1021 | ); |
| 1022 | unittest.expect( |
| 1023 | o.varTableIndex!, |
| 1024 | unittest.equals(42), |
| 1025 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1026 | } |
| 1027 | buildCounterVariable--; |
| 1028 | } |
| 1029 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1030 | void main() { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1031 | unittest.group('obj-schema-AliasContext', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1032 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 1033 | var o = buildAliasContext(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1034 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1035 | var od = api.AliasContext.fromJson( |
| 1036 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1037 | checkAliasContext(od as api.AliasContext); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 1038 | }); |
| 1039 | }); |
| 1040 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1041 | unittest.group('obj-schema-Breakpoint', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1042 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1043 | var o = buildBreakpoint(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1044 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1045 | var od = |
| 1046 | api.Breakpoint.fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1047 | checkBreakpoint(od as api.Breakpoint); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1048 | }); |
| 1049 | }); |
| 1050 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1051 | unittest.group('obj-schema-CloudRepoSourceContext', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1052 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1053 | var o = buildCloudRepoSourceContext(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1054 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1055 | var od = api.CloudRepoSourceContext.fromJson( |
| 1056 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1057 | checkCloudRepoSourceContext(od as api.CloudRepoSourceContext); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1058 | }); |
| 1059 | }); |
| 1060 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1061 | unittest.group('obj-schema-CloudWorkspaceId', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1062 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1063 | var o = buildCloudWorkspaceId(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1064 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1065 | var od = api.CloudWorkspaceId.fromJson( |
| 1066 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1067 | checkCloudWorkspaceId(od as api.CloudWorkspaceId); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1068 | }); |
| 1069 | }); |
| 1070 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1071 | unittest.group('obj-schema-CloudWorkspaceSourceContext', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1072 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1073 | var o = buildCloudWorkspaceSourceContext(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1074 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1075 | var od = api.CloudWorkspaceSourceContext.fromJson( |
| 1076 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1077 | checkCloudWorkspaceSourceContext(od as api.CloudWorkspaceSourceContext); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1078 | }); |
| 1079 | }); |
| 1080 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1081 | unittest.group('obj-schema-Debuggee', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1082 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1083 | var o = buildDebuggee(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1084 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1085 | var od = |
| 1086 | api.Debuggee.fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1087 | checkDebuggee(od as api.Debuggee); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1088 | }); |
| 1089 | }); |
| 1090 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1091 | unittest.group('obj-schema-Empty', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1092 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1093 | var o = buildEmpty(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1094 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1095 | var od = api.Empty.fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1096 | checkEmpty(od as api.Empty); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1097 | }); |
| 1098 | }); |
| 1099 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1100 | unittest.group('obj-schema-ExtendedSourceContext', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1101 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 1102 | var o = buildExtendedSourceContext(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1103 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1104 | var od = api.ExtendedSourceContext.fromJson( |
| 1105 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1106 | checkExtendedSourceContext(od as api.ExtendedSourceContext); |
Martin Kustermann | 2617181 | 2015-12-21 15:06:06 +0100 | [diff] [blame] | 1107 | }); |
| 1108 | }); |
| 1109 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1110 | unittest.group('obj-schema-FormatMessage', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1111 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1112 | var o = buildFormatMessage(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1113 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1114 | var od = api.FormatMessage.fromJson( |
| 1115 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1116 | checkFormatMessage(od as api.FormatMessage); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1117 | }); |
| 1118 | }); |
| 1119 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1120 | unittest.group('obj-schema-GerritSourceContext', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1121 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1122 | var o = buildGerritSourceContext(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1123 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1124 | var od = api.GerritSourceContext.fromJson( |
| 1125 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1126 | checkGerritSourceContext(od as api.GerritSourceContext); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1127 | }); |
| 1128 | }); |
| 1129 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1130 | unittest.group('obj-schema-GetBreakpointResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1131 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1132 | var o = buildGetBreakpointResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1133 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1134 | var od = api.GetBreakpointResponse.fromJson( |
| 1135 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1136 | checkGetBreakpointResponse(od as api.GetBreakpointResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1137 | }); |
| 1138 | }); |
| 1139 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1140 | unittest.group('obj-schema-GitSourceContext', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1141 | unittest.test('to-json--from-json', () async { |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 1142 | var o = buildGitSourceContext(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1143 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1144 | var od = api.GitSourceContext.fromJson( |
| 1145 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1146 | checkGitSourceContext(od as api.GitSourceContext); |
Martin Kustermann | 3bffce4 | 2015-08-17 16:09:38 +0200 | [diff] [blame] | 1147 | }); |
| 1148 | }); |
| 1149 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1150 | unittest.group('obj-schema-ListActiveBreakpointsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1151 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1152 | var o = buildListActiveBreakpointsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1153 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1154 | var od = api.ListActiveBreakpointsResponse.fromJson( |
| 1155 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1156 | checkListActiveBreakpointsResponse( |
| 1157 | od as api.ListActiveBreakpointsResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1158 | }); |
| 1159 | }); |
| 1160 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1161 | unittest.group('obj-schema-ListBreakpointsResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1162 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1163 | var o = buildListBreakpointsResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1164 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1165 | var od = api.ListBreakpointsResponse.fromJson( |
| 1166 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1167 | checkListBreakpointsResponse(od as api.ListBreakpointsResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1168 | }); |
| 1169 | }); |
| 1170 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1171 | unittest.group('obj-schema-ListDebuggeesResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1172 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1173 | var o = buildListDebuggeesResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1174 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1175 | var od = api.ListDebuggeesResponse.fromJson( |
| 1176 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1177 | checkListDebuggeesResponse(od as api.ListDebuggeesResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1178 | }); |
| 1179 | }); |
| 1180 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1181 | unittest.group('obj-schema-ProjectRepoId', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1182 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1183 | var o = buildProjectRepoId(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1184 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1185 | var od = api.ProjectRepoId.fromJson( |
| 1186 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1187 | checkProjectRepoId(od as api.ProjectRepoId); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1188 | }); |
| 1189 | }); |
| 1190 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1191 | unittest.group('obj-schema-RegisterDebuggeeRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1192 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1193 | var o = buildRegisterDebuggeeRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1194 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1195 | var od = api.RegisterDebuggeeRequest.fromJson( |
| 1196 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1197 | checkRegisterDebuggeeRequest(od as api.RegisterDebuggeeRequest); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1198 | }); |
| 1199 | }); |
| 1200 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1201 | unittest.group('obj-schema-RegisterDebuggeeResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1202 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1203 | var o = buildRegisterDebuggeeResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1204 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1205 | var od = api.RegisterDebuggeeResponse.fromJson( |
| 1206 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1207 | checkRegisterDebuggeeResponse(od as api.RegisterDebuggeeResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1208 | }); |
| 1209 | }); |
| 1210 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1211 | unittest.group('obj-schema-RepoId', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1212 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1213 | var o = buildRepoId(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1214 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1215 | var od = |
| 1216 | api.RepoId.fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1217 | checkRepoId(od as api.RepoId); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1218 | }); |
| 1219 | }); |
| 1220 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1221 | unittest.group('obj-schema-SetBreakpointResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1222 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1223 | var o = buildSetBreakpointResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1224 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1225 | var od = api.SetBreakpointResponse.fromJson( |
| 1226 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1227 | checkSetBreakpointResponse(od as api.SetBreakpointResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1228 | }); |
| 1229 | }); |
| 1230 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1231 | unittest.group('obj-schema-SourceContext', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1232 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1233 | var o = buildSourceContext(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1234 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1235 | var od = api.SourceContext.fromJson( |
| 1236 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1237 | checkSourceContext(od as api.SourceContext); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1238 | }); |
| 1239 | }); |
| 1240 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1241 | unittest.group('obj-schema-SourceLocation', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1242 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1243 | var o = buildSourceLocation(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1244 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1245 | var od = api.SourceLocation.fromJson( |
| 1246 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1247 | checkSourceLocation(od as api.SourceLocation); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1248 | }); |
| 1249 | }); |
| 1250 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1251 | unittest.group('obj-schema-StackFrame', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1252 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1253 | var o = buildStackFrame(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1254 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1255 | var od = |
| 1256 | api.StackFrame.fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1257 | checkStackFrame(od as api.StackFrame); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1258 | }); |
| 1259 | }); |
| 1260 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1261 | unittest.group('obj-schema-StatusMessage', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1262 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1263 | var o = buildStatusMessage(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1264 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1265 | var od = api.StatusMessage.fromJson( |
| 1266 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1267 | checkStatusMessage(od as api.StatusMessage); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1268 | }); |
| 1269 | }); |
| 1270 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1271 | unittest.group('obj-schema-UpdateActiveBreakpointRequest', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1272 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1273 | var o = buildUpdateActiveBreakpointRequest(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1274 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1275 | var od = api.UpdateActiveBreakpointRequest.fromJson( |
| 1276 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1277 | checkUpdateActiveBreakpointRequest( |
| 1278 | od as api.UpdateActiveBreakpointRequest); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1279 | }); |
| 1280 | }); |
| 1281 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1282 | unittest.group('obj-schema-UpdateActiveBreakpointResponse', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1283 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1284 | var o = buildUpdateActiveBreakpointResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1285 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1286 | var od = api.UpdateActiveBreakpointResponse.fromJson( |
| 1287 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1288 | checkUpdateActiveBreakpointResponse( |
| 1289 | od as api.UpdateActiveBreakpointResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1290 | }); |
| 1291 | }); |
| 1292 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1293 | unittest.group('obj-schema-Variable', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1294 | unittest.test('to-json--from-json', () async { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1295 | var o = buildVariable(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 1296 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 1297 | var od = |
| 1298 | api.Variable.fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1299 | checkVariable(od as api.Variable); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1300 | }); |
| 1301 | }); |
| 1302 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 1303 | unittest.group('resource-ControllerDebuggeesResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1304 | unittest.test('method--register', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1305 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1306 | var res = api.CloudDebuggerApi(mock).controller.debuggees; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1307 | var arg_request = buildRegisterDebuggeeRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1308 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1309 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1310 | var obj = api.RegisterDebuggeeRequest.fromJson( |
| 1311 | json as core.Map<core.String, core.dynamic>); |
| 1312 | checkRegisterDebuggeeRequest(obj as api.RegisterDebuggeeRequest); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1313 | |
| 1314 | var path = (req.url).path; |
| 1315 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1316 | core.int index; |
| 1317 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1318 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1319 | path.substring(pathOffset, pathOffset + 1), |
| 1320 | unittest.equals("/"), |
| 1321 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1322 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1323 | unittest.expect( |
| 1324 | path.substring(pathOffset, pathOffset + 32), |
| 1325 | unittest.equals("v2/controller/debuggees/register"), |
| 1326 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1327 | pathOffset += 32; |
| 1328 | |
| 1329 | var query = (req.url).query; |
| 1330 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1331 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1332 | void addQueryParam(core.String n, core.String v) => |
| 1333 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1334 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1335 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1336 | for (var part in query.split('&')) { |
| 1337 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1338 | addQueryParam( |
| 1339 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1340 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1341 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1342 | } |
| 1343 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1344 | unittest.expect( |
| 1345 | queryMap["fields"]!.first, |
| 1346 | unittest.equals(arg_$fields), |
| 1347 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1348 | |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1349 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1350 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1351 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1352 | var resp = convert.json.encode(buildRegisterDebuggeeResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1353 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1354 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1355 | final response = await res.register(arg_request, $fields: arg_$fields); |
| 1356 | checkRegisterDebuggeeResponse(response as api.RegisterDebuggeeResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1357 | }); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1358 | }); |
| 1359 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 1360 | unittest.group('resource-ControllerDebuggeesBreakpointsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1361 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1362 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1363 | var res = api.CloudDebuggerApi(mock).controller.debuggees.breakpoints; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1364 | var arg_debuggeeId = 'foo'; |
| 1365 | var arg_agentId = 'foo'; |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1366 | var arg_successOnTimeout = true; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1367 | var arg_waitToken = 'foo'; |
| 1368 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1369 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1370 | var path = (req.url).path; |
| 1371 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1372 | core.int index; |
| 1373 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1374 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1375 | path.substring(pathOffset, pathOffset + 1), |
| 1376 | unittest.equals("/"), |
| 1377 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1378 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1379 | unittest.expect( |
| 1380 | path.substring(pathOffset, pathOffset + 24), |
| 1381 | unittest.equals("v2/controller/debuggees/"), |
| 1382 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1383 | pathOffset += 24; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1384 | index = path.indexOf('/breakpoints', pathOffset); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1385 | unittest.expect(index >= 0, unittest.isTrue); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1386 | subPart = |
| 1387 | core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1388 | pathOffset = index; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1389 | unittest.expect( |
| 1390 | subPart, |
| 1391 | unittest.equals('$arg_debuggeeId'), |
| 1392 | ); |
| 1393 | unittest.expect( |
| 1394 | path.substring(pathOffset, pathOffset + 12), |
| 1395 | unittest.equals("/breakpoints"), |
| 1396 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1397 | pathOffset += 12; |
| 1398 | |
| 1399 | var query = (req.url).query; |
| 1400 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1401 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1402 | void addQueryParam(core.String n, core.String v) => |
| 1403 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1404 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1405 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1406 | for (var part in query.split('&')) { |
| 1407 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1408 | addQueryParam( |
| 1409 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1410 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1411 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1412 | } |
| 1413 | } |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1414 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1415 | queryMap["agentId"]!.first, |
| 1416 | unittest.equals(arg_agentId), |
| 1417 | ); |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 1418 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1419 | queryMap["successOnTimeout"]!.first, |
| 1420 | unittest.equals("$arg_successOnTimeout"), |
| 1421 | ); |
| 1422 | unittest.expect( |
| 1423 | queryMap["waitToken"]!.first, |
| 1424 | unittest.equals(arg_waitToken), |
| 1425 | ); |
| 1426 | unittest.expect( |
| 1427 | queryMap["fields"]!.first, |
| 1428 | unittest.equals(arg_$fields), |
| 1429 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1430 | |
| 1431 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1432 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1433 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1434 | var resp = convert.json.encode(buildListActiveBreakpointsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1435 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1436 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1437 | final response = await res.list(arg_debuggeeId, |
| 1438 | agentId: arg_agentId, |
| 1439 | successOnTimeout: arg_successOnTimeout, |
| 1440 | waitToken: arg_waitToken, |
| 1441 | $fields: arg_$fields); |
| 1442 | checkListActiveBreakpointsResponse( |
| 1443 | response as api.ListActiveBreakpointsResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1444 | }); |
| 1445 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1446 | unittest.test('method--update', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1447 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1448 | var res = api.CloudDebuggerApi(mock).controller.debuggees.breakpoints; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1449 | var arg_request = buildUpdateActiveBreakpointRequest(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1450 | var arg_debuggeeId = 'foo'; |
| 1451 | var arg_id = 'foo'; |
| 1452 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1453 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1454 | var obj = api.UpdateActiveBreakpointRequest.fromJson( |
| 1455 | json as core.Map<core.String, core.dynamic>); |
| 1456 | checkUpdateActiveBreakpointRequest( |
| 1457 | obj as api.UpdateActiveBreakpointRequest); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1458 | |
| 1459 | var path = (req.url).path; |
| 1460 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1461 | core.int index; |
| 1462 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1463 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1464 | path.substring(pathOffset, pathOffset + 1), |
| 1465 | unittest.equals("/"), |
| 1466 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1467 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1468 | unittest.expect( |
| 1469 | path.substring(pathOffset, pathOffset + 24), |
| 1470 | unittest.equals("v2/controller/debuggees/"), |
| 1471 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1472 | pathOffset += 24; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1473 | index = path.indexOf('/breakpoints/', pathOffset); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1474 | unittest.expect(index >= 0, unittest.isTrue); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1475 | subPart = |
| 1476 | core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1477 | pathOffset = index; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1478 | unittest.expect( |
| 1479 | subPart, |
| 1480 | unittest.equals('$arg_debuggeeId'), |
| 1481 | ); |
| 1482 | unittest.expect( |
| 1483 | path.substring(pathOffset, pathOffset + 13), |
| 1484 | unittest.equals("/breakpoints/"), |
| 1485 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1486 | pathOffset += 13; |
| 1487 | subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1488 | pathOffset = path.length; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1489 | unittest.expect( |
| 1490 | subPart, |
| 1491 | unittest.equals('$arg_id'), |
| 1492 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1493 | |
| 1494 | var query = (req.url).query; |
| 1495 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1496 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1497 | void addQueryParam(core.String n, core.String v) => |
| 1498 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1499 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1500 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1501 | for (var part in query.split('&')) { |
| 1502 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1503 | addQueryParam( |
| 1504 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1505 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1506 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1507 | } |
| 1508 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1509 | unittest.expect( |
| 1510 | queryMap["fields"]!.first, |
| 1511 | unittest.equals(arg_$fields), |
| 1512 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1513 | |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1514 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1515 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1516 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1517 | var resp = convert.json.encode(buildUpdateActiveBreakpointResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1518 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1519 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1520 | final response = await res.update(arg_request, arg_debuggeeId, arg_id, |
| 1521 | $fields: arg_$fields); |
| 1522 | checkUpdateActiveBreakpointResponse( |
| 1523 | response as api.UpdateActiveBreakpointResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1524 | }); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1525 | }); |
| 1526 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 1527 | unittest.group('resource-DebuggerDebuggeesResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1528 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1529 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1530 | var res = api.CloudDebuggerApi(mock).debugger.debuggees; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1531 | var arg_clientVersion = 'foo'; |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 1532 | var arg_includeInactive = true; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 1533 | var arg_project = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1534 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1535 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1536 | var path = (req.url).path; |
| 1537 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1538 | core.int index; |
| 1539 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1540 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1541 | path.substring(pathOffset, pathOffset + 1), |
| 1542 | unittest.equals("/"), |
| 1543 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1544 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1545 | unittest.expect( |
| 1546 | path.substring(pathOffset, pathOffset + 21), |
| 1547 | unittest.equals("v2/debugger/debuggees"), |
| 1548 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1549 | pathOffset += 21; |
| 1550 | |
| 1551 | var query = (req.url).query; |
| 1552 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1553 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1554 | void addQueryParam(core.String n, core.String v) => |
| 1555 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1556 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1557 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1558 | for (var part in query.split('&')) { |
| 1559 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1560 | addQueryParam( |
| 1561 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1562 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1563 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1564 | } |
| 1565 | } |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 1566 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1567 | queryMap["clientVersion"]!.first, |
| 1568 | unittest.equals(arg_clientVersion), |
| 1569 | ); |
| 1570 | unittest.expect( |
| 1571 | queryMap["includeInactive"]!.first, |
| 1572 | unittest.equals("$arg_includeInactive"), |
| 1573 | ); |
| 1574 | unittest.expect( |
| 1575 | queryMap["project"]!.first, |
| 1576 | unittest.equals(arg_project), |
| 1577 | ); |
| 1578 | unittest.expect( |
| 1579 | queryMap["fields"]!.first, |
| 1580 | unittest.equals(arg_$fields), |
| 1581 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1582 | |
| 1583 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1584 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1585 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1586 | var resp = convert.json.encode(buildListDebuggeesResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1587 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1588 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1589 | final response = await res.list( |
| 1590 | clientVersion: arg_clientVersion, |
| 1591 | includeInactive: arg_includeInactive, |
| 1592 | project: arg_project, |
| 1593 | $fields: arg_$fields); |
| 1594 | checkListDebuggeesResponse(response as api.ListDebuggeesResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1595 | }); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1596 | }); |
| 1597 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 1598 | unittest.group('resource-DebuggerDebuggeesBreakpointsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1599 | unittest.test('method--delete', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1600 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1601 | var res = api.CloudDebuggerApi(mock).debugger.debuggees.breakpoints; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1602 | var arg_debuggeeId = 'foo'; |
| 1603 | var arg_breakpointId = 'foo'; |
| 1604 | var arg_clientVersion = 'foo'; |
| 1605 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1606 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1607 | var path = (req.url).path; |
| 1608 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1609 | core.int index; |
| 1610 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1611 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1612 | path.substring(pathOffset, pathOffset + 1), |
| 1613 | unittest.equals("/"), |
| 1614 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1615 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1616 | unittest.expect( |
| 1617 | path.substring(pathOffset, pathOffset + 22), |
| 1618 | unittest.equals("v2/debugger/debuggees/"), |
| 1619 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1620 | pathOffset += 22; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1621 | index = path.indexOf('/breakpoints/', pathOffset); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1622 | unittest.expect(index >= 0, unittest.isTrue); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1623 | subPart = |
| 1624 | core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1625 | pathOffset = index; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1626 | unittest.expect( |
| 1627 | subPart, |
| 1628 | unittest.equals('$arg_debuggeeId'), |
| 1629 | ); |
| 1630 | unittest.expect( |
| 1631 | path.substring(pathOffset, pathOffset + 13), |
| 1632 | unittest.equals("/breakpoints/"), |
| 1633 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1634 | pathOffset += 13; |
| 1635 | subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1636 | pathOffset = path.length; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1637 | unittest.expect( |
| 1638 | subPart, |
| 1639 | unittest.equals('$arg_breakpointId'), |
| 1640 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1641 | |
| 1642 | var query = (req.url).query; |
| 1643 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1644 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1645 | void addQueryParam(core.String n, core.String v) => |
| 1646 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1647 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1648 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1649 | for (var part in query.split('&')) { |
| 1650 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1651 | addQueryParam( |
| 1652 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1653 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1654 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1655 | } |
| 1656 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1657 | unittest.expect( |
| 1658 | queryMap["clientVersion"]!.first, |
| 1659 | unittest.equals(arg_clientVersion), |
| 1660 | ); |
| 1661 | unittest.expect( |
| 1662 | queryMap["fields"]!.first, |
| 1663 | unittest.equals(arg_$fields), |
| 1664 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1665 | |
| 1666 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1667 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1668 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1669 | var resp = convert.json.encode(buildEmpty()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1670 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1671 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1672 | final response = await res.delete(arg_debuggeeId, arg_breakpointId, |
| 1673 | clientVersion: arg_clientVersion, $fields: arg_$fields); |
| 1674 | checkEmpty(response as api.Empty); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1675 | }); |
| 1676 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1677 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1678 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1679 | var res = api.CloudDebuggerApi(mock).debugger.debuggees.breakpoints; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1680 | var arg_debuggeeId = 'foo'; |
| 1681 | var arg_breakpointId = 'foo'; |
| 1682 | var arg_clientVersion = 'foo'; |
| 1683 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1684 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1685 | var path = (req.url).path; |
| 1686 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1687 | core.int index; |
| 1688 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1689 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1690 | path.substring(pathOffset, pathOffset + 1), |
| 1691 | unittest.equals("/"), |
| 1692 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1693 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1694 | unittest.expect( |
| 1695 | path.substring(pathOffset, pathOffset + 22), |
| 1696 | unittest.equals("v2/debugger/debuggees/"), |
| 1697 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1698 | pathOffset += 22; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1699 | index = path.indexOf('/breakpoints/', pathOffset); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1700 | unittest.expect(index >= 0, unittest.isTrue); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1701 | subPart = |
| 1702 | core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1703 | pathOffset = index; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1704 | unittest.expect( |
| 1705 | subPart, |
| 1706 | unittest.equals('$arg_debuggeeId'), |
| 1707 | ); |
| 1708 | unittest.expect( |
| 1709 | path.substring(pathOffset, pathOffset + 13), |
| 1710 | unittest.equals("/breakpoints/"), |
| 1711 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1712 | pathOffset += 13; |
| 1713 | subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1714 | pathOffset = path.length; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1715 | unittest.expect( |
| 1716 | subPart, |
| 1717 | unittest.equals('$arg_breakpointId'), |
| 1718 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1719 | |
| 1720 | var query = (req.url).query; |
| 1721 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1722 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1723 | void addQueryParam(core.String n, core.String v) => |
| 1724 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1725 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1726 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1727 | for (var part in query.split('&')) { |
| 1728 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1729 | addQueryParam( |
| 1730 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1731 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1732 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1733 | } |
| 1734 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1735 | unittest.expect( |
| 1736 | queryMap["clientVersion"]!.first, |
| 1737 | unittest.equals(arg_clientVersion), |
| 1738 | ); |
| 1739 | unittest.expect( |
| 1740 | queryMap["fields"]!.first, |
| 1741 | unittest.equals(arg_$fields), |
| 1742 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1743 | |
| 1744 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1745 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1746 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1747 | var resp = convert.json.encode(buildGetBreakpointResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1748 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1749 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1750 | final response = await res.get(arg_debuggeeId, arg_breakpointId, |
| 1751 | clientVersion: arg_clientVersion, $fields: arg_$fields); |
| 1752 | checkGetBreakpointResponse(response as api.GetBreakpointResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1753 | }); |
| 1754 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1755 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1756 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1757 | var res = api.CloudDebuggerApi(mock).debugger.debuggees.breakpoints; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1758 | var arg_debuggeeId = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1759 | var arg_action_value = 'foo'; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 1760 | var arg_clientVersion = 'foo'; |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 1761 | var arg_includeAllUsers = true; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 1762 | var arg_includeInactive = true; |
| 1763 | var arg_stripResults = true; |
| 1764 | var arg_waitToken = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1765 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1766 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1767 | var path = (req.url).path; |
| 1768 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1769 | core.int index; |
| 1770 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1771 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1772 | path.substring(pathOffset, pathOffset + 1), |
| 1773 | unittest.equals("/"), |
| 1774 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1775 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1776 | unittest.expect( |
| 1777 | path.substring(pathOffset, pathOffset + 22), |
| 1778 | unittest.equals("v2/debugger/debuggees/"), |
| 1779 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1780 | pathOffset += 22; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1781 | index = path.indexOf('/breakpoints', pathOffset); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1782 | unittest.expect(index >= 0, unittest.isTrue); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1783 | subPart = |
| 1784 | core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1785 | pathOffset = index; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1786 | unittest.expect( |
| 1787 | subPart, |
| 1788 | unittest.equals('$arg_debuggeeId'), |
| 1789 | ); |
| 1790 | unittest.expect( |
| 1791 | path.substring(pathOffset, pathOffset + 12), |
| 1792 | unittest.equals("/breakpoints"), |
| 1793 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1794 | pathOffset += 12; |
| 1795 | |
| 1796 | var query = (req.url).query; |
| 1797 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1798 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1799 | void addQueryParam(core.String n, core.String v) => |
| 1800 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1801 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1802 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1803 | for (var part in query.split('&')) { |
| 1804 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1805 | addQueryParam( |
| 1806 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1807 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1808 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1809 | } |
| 1810 | } |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 1811 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1812 | queryMap["action.value"]!.first, |
| 1813 | unittest.equals(arg_action_value), |
| 1814 | ); |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 1815 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1816 | queryMap["clientVersion"]!.first, |
| 1817 | unittest.equals(arg_clientVersion), |
| 1818 | ); |
| 1819 | unittest.expect( |
| 1820 | queryMap["includeAllUsers"]!.first, |
| 1821 | unittest.equals("$arg_includeAllUsers"), |
| 1822 | ); |
| 1823 | unittest.expect( |
| 1824 | queryMap["includeInactive"]!.first, |
| 1825 | unittest.equals("$arg_includeInactive"), |
| 1826 | ); |
| 1827 | unittest.expect( |
| 1828 | queryMap["stripResults"]!.first, |
| 1829 | unittest.equals("$arg_stripResults"), |
| 1830 | ); |
| 1831 | unittest.expect( |
| 1832 | queryMap["waitToken"]!.first, |
| 1833 | unittest.equals(arg_waitToken), |
| 1834 | ); |
| 1835 | unittest.expect( |
| 1836 | queryMap["fields"]!.first, |
| 1837 | unittest.equals(arg_$fields), |
| 1838 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1839 | |
| 1840 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1841 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1842 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1843 | var resp = convert.json.encode(buildListBreakpointsResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1844 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1845 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1846 | final response = await res.list(arg_debuggeeId, |
| 1847 | action_value: arg_action_value, |
| 1848 | clientVersion: arg_clientVersion, |
| 1849 | includeAllUsers: arg_includeAllUsers, |
| 1850 | includeInactive: arg_includeInactive, |
| 1851 | stripResults: arg_stripResults, |
| 1852 | waitToken: arg_waitToken, |
| 1853 | $fields: arg_$fields); |
| 1854 | checkListBreakpointsResponse(response as api.ListBreakpointsResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1855 | }); |
| 1856 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1857 | unittest.test('method--set', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1858 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1859 | var res = api.CloudDebuggerApi(mock).debugger.debuggees.breakpoints; |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1860 | var arg_request = buildBreakpoint(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1861 | var arg_debuggeeId = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1862 | var arg_canaryOption = 'foo'; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 1863 | var arg_clientVersion = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1864 | var arg_$fields = 'foo'; |
Martin Kustermann | 3953f0d | 2017-06-12 16:59:53 +0200 | [diff] [blame] | 1865 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1866 | var obj = api.Breakpoint.fromJson( |
| 1867 | json as core.Map<core.String, core.dynamic>); |
| 1868 | checkBreakpoint(obj as api.Breakpoint); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1869 | |
| 1870 | var path = (req.url).path; |
| 1871 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1872 | core.int index; |
| 1873 | core.String subPart; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1874 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1875 | path.substring(pathOffset, pathOffset + 1), |
| 1876 | unittest.equals("/"), |
| 1877 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1878 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1879 | unittest.expect( |
| 1880 | path.substring(pathOffset, pathOffset + 22), |
| 1881 | unittest.equals("v2/debugger/debuggees/"), |
| 1882 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1883 | pathOffset += 22; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1884 | index = path.indexOf('/breakpoints/set', pathOffset); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1885 | unittest.expect(index >= 0, unittest.isTrue); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1886 | subPart = |
| 1887 | core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1888 | pathOffset = index; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1889 | unittest.expect( |
| 1890 | subPart, |
| 1891 | unittest.equals('$arg_debuggeeId'), |
| 1892 | ); |
| 1893 | unittest.expect( |
| 1894 | path.substring(pathOffset, pathOffset + 16), |
| 1895 | unittest.equals("/breakpoints/set"), |
| 1896 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1897 | pathOffset += 16; |
| 1898 | |
| 1899 | var query = (req.url).query; |
| 1900 | var queryOffset = 0; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1901 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1902 | void addQueryParam(core.String n, core.String v) => |
| 1903 | queryMap.putIfAbsent(n, () => []).add(v); |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1904 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1905 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1906 | for (var part in query.split('&')) { |
| 1907 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1908 | addQueryParam( |
| 1909 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1910 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1911 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1912 | } |
| 1913 | } |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1914 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1915 | queryMap["canaryOption"]!.first, |
| 1916 | unittest.equals(arg_canaryOption), |
| 1917 | ); |
| 1918 | unittest.expect( |
| 1919 | queryMap["clientVersion"]!.first, |
| 1920 | unittest.equals(arg_clientVersion), |
| 1921 | ); |
| 1922 | unittest.expect( |
| 1923 | queryMap["fields"]!.first, |
| 1924 | unittest.equals(arg_$fields), |
| 1925 | ); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1926 | |
| 1927 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1928 | 'content-type': 'application/json; charset=utf-8', |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1929 | }; |
Jakob Andersen | 52715df | 2018-05-01 13:58:48 +0200 | [diff] [blame] | 1930 | var resp = convert.json.encode(buildSetBreakpointResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1931 | return async.Future.value(stringResponse(200, h, resp)); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1932 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1933 | final response = await res.set(arg_request, arg_debuggeeId, |
| 1934 | canaryOption: arg_canaryOption, |
| 1935 | clientVersion: arg_clientVersion, |
| 1936 | $fields: arg_$fields); |
| 1937 | checkSetBreakpointResponse(response as api.SetBreakpointResponse); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1938 | }); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1939 | }); |
Søren Gjesse | c68cc41 | 2015-08-04 16:14:45 +0200 | [diff] [blame] | 1940 | } |