OLD | NEW |
1 library googleapis.cloudlatencytest.v2.test; | 1 library googleapis.cloudlatencytest.v2.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 buildUnnamed510() { | 54 buildUnnamed1299() { |
55 var o = new core.List<api.Stats>(); | 55 var o = new core.List<api.Stats>(); |
56 o.add(buildStats()); | 56 o.add(buildStats()); |
57 o.add(buildStats()); | 57 o.add(buildStats()); |
58 return o; | 58 return o; |
59 } | 59 } |
60 | 60 |
61 checkUnnamed510(core.List<api.Stats> o) { | 61 checkUnnamed1299(core.List<api.Stats> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
63 checkStats(o[0]); | 63 checkStats(o[0]); |
64 checkStats(o[1]); | 64 checkStats(o[1]); |
65 } | 65 } |
66 | 66 |
67 core.int buildCounterAggregatedStats = 0; | 67 core.int buildCounterAggregatedStats = 0; |
68 buildAggregatedStats() { | 68 buildAggregatedStats() { |
69 var o = new api.AggregatedStats(); | 69 var o = new api.AggregatedStats(); |
70 buildCounterAggregatedStats++; | 70 buildCounterAggregatedStats++; |
71 if (buildCounterAggregatedStats < 3) { | 71 if (buildCounterAggregatedStats < 3) { |
72 o.stats = buildUnnamed510(); | 72 o.stats = buildUnnamed1299(); |
73 } | 73 } |
74 buildCounterAggregatedStats--; | 74 buildCounterAggregatedStats--; |
75 return o; | 75 return o; |
76 } | 76 } |
77 | 77 |
78 checkAggregatedStats(api.AggregatedStats o) { | 78 checkAggregatedStats(api.AggregatedStats o) { |
79 buildCounterAggregatedStats++; | 79 buildCounterAggregatedStats++; |
80 if (buildCounterAggregatedStats < 3) { | 80 if (buildCounterAggregatedStats < 3) { |
81 checkUnnamed510(o.stats); | 81 checkUnnamed1299(o.stats); |
82 } | 82 } |
83 buildCounterAggregatedStats--; | 83 buildCounterAggregatedStats--; |
84 } | 84 } |
85 | 85 |
86 core.int buildCounterAggregatedStatsReply = 0; | 86 core.int buildCounterAggregatedStatsReply = 0; |
87 buildAggregatedStatsReply() { | 87 buildAggregatedStatsReply() { |
88 var o = new api.AggregatedStatsReply(); | 88 var o = new api.AggregatedStatsReply(); |
89 buildCounterAggregatedStatsReply++; | 89 buildCounterAggregatedStatsReply++; |
90 if (buildCounterAggregatedStatsReply < 3) { | 90 if (buildCounterAggregatedStatsReply < 3) { |
91 o.testValue = "foo"; | 91 o.testValue = "foo"; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 checkIntValue(api.IntValue o) { | 138 checkIntValue(api.IntValue o) { |
139 buildCounterIntValue++; | 139 buildCounterIntValue++; |
140 if (buildCounterIntValue < 3) { | 140 if (buildCounterIntValue < 3) { |
141 unittest.expect(o.label, unittest.equals('foo')); | 141 unittest.expect(o.label, unittest.equals('foo')); |
142 unittest.expect(o.value, unittest.equals('foo')); | 142 unittest.expect(o.value, unittest.equals('foo')); |
143 } | 143 } |
144 buildCounterIntValue--; | 144 buildCounterIntValue--; |
145 } | 145 } |
146 | 146 |
147 buildUnnamed511() { | 147 buildUnnamed1300() { |
148 var o = new core.List<api.DoubleValue>(); | 148 var o = new core.List<api.DoubleValue>(); |
149 o.add(buildDoubleValue()); | 149 o.add(buildDoubleValue()); |
150 o.add(buildDoubleValue()); | 150 o.add(buildDoubleValue()); |
151 return o; | 151 return o; |
152 } | 152 } |
153 | 153 |
154 checkUnnamed511(core.List<api.DoubleValue> o) { | 154 checkUnnamed1300(core.List<api.DoubleValue> o) { |
155 unittest.expect(o, unittest.hasLength(2)); | 155 unittest.expect(o, unittest.hasLength(2)); |
156 checkDoubleValue(o[0]); | 156 checkDoubleValue(o[0]); |
157 checkDoubleValue(o[1]); | 157 checkDoubleValue(o[1]); |
158 } | 158 } |
159 | 159 |
160 buildUnnamed512() { | 160 buildUnnamed1301() { |
161 var o = new core.List<api.IntValue>(); | 161 var o = new core.List<api.IntValue>(); |
162 o.add(buildIntValue()); | 162 o.add(buildIntValue()); |
163 o.add(buildIntValue()); | 163 o.add(buildIntValue()); |
164 return o; | 164 return o; |
165 } | 165 } |
166 | 166 |
167 checkUnnamed512(core.List<api.IntValue> o) { | 167 checkUnnamed1301(core.List<api.IntValue> o) { |
168 unittest.expect(o, unittest.hasLength(2)); | 168 unittest.expect(o, unittest.hasLength(2)); |
169 checkIntValue(o[0]); | 169 checkIntValue(o[0]); |
170 checkIntValue(o[1]); | 170 checkIntValue(o[1]); |
171 } | 171 } |
172 | 172 |
173 buildUnnamed513() { | 173 buildUnnamed1302() { |
174 var o = new core.List<api.StringValue>(); | 174 var o = new core.List<api.StringValue>(); |
175 o.add(buildStringValue()); | 175 o.add(buildStringValue()); |
176 o.add(buildStringValue()); | 176 o.add(buildStringValue()); |
177 return o; | 177 return o; |
178 } | 178 } |
179 | 179 |
180 checkUnnamed513(core.List<api.StringValue> o) { | 180 checkUnnamed1302(core.List<api.StringValue> o) { |
181 unittest.expect(o, unittest.hasLength(2)); | 181 unittest.expect(o, unittest.hasLength(2)); |
182 checkStringValue(o[0]); | 182 checkStringValue(o[0]); |
183 checkStringValue(o[1]); | 183 checkStringValue(o[1]); |
184 } | 184 } |
185 | 185 |
186 core.int buildCounterStats = 0; | 186 core.int buildCounterStats = 0; |
187 buildStats() { | 187 buildStats() { |
188 var o = new api.Stats(); | 188 var o = new api.Stats(); |
189 buildCounterStats++; | 189 buildCounterStats++; |
190 if (buildCounterStats < 3) { | 190 if (buildCounterStats < 3) { |
191 o.doubleValues = buildUnnamed511(); | 191 o.doubleValues = buildUnnamed1300(); |
192 o.intValues = buildUnnamed512(); | 192 o.intValues = buildUnnamed1301(); |
193 o.stringValues = buildUnnamed513(); | 193 o.stringValues = buildUnnamed1302(); |
194 o.time = 42.0; | 194 o.time = 42.0; |
195 } | 195 } |
196 buildCounterStats--; | 196 buildCounterStats--; |
197 return o; | 197 return o; |
198 } | 198 } |
199 | 199 |
200 checkStats(api.Stats o) { | 200 checkStats(api.Stats o) { |
201 buildCounterStats++; | 201 buildCounterStats++; |
202 if (buildCounterStats < 3) { | 202 if (buildCounterStats < 3) { |
203 checkUnnamed511(o.doubleValues); | 203 checkUnnamed1300(o.doubleValues); |
204 checkUnnamed512(o.intValues); | 204 checkUnnamed1301(o.intValues); |
205 checkUnnamed513(o.stringValues); | 205 checkUnnamed1302(o.stringValues); |
206 unittest.expect(o.time, unittest.equals(42.0)); | 206 unittest.expect(o.time, unittest.equals(42.0)); |
207 } | 207 } |
208 buildCounterStats--; | 208 buildCounterStats--; |
209 } | 209 } |
210 | 210 |
211 core.int buildCounterStatsReply = 0; | 211 core.int buildCounterStatsReply = 0; |
212 buildStatsReply() { | 212 buildStatsReply() { |
213 var o = new api.StatsReply(); | 213 var o = new api.StatsReply(); |
214 buildCounterStatsReply++; | 214 buildCounterStatsReply++; |
215 if (buildCounterStatsReply < 3) { | 215 if (buildCounterStatsReply < 3) { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 res.updatestats(arg_request).then(unittest.expectAsync(((api.StatsReply re
sponse) { | 410 res.updatestats(arg_request).then(unittest.expectAsync(((api.StatsReply re
sponse) { |
411 checkStatsReply(response); | 411 checkStatsReply(response); |
412 }))); | 412 }))); |
413 }); | 413 }); |
414 | 414 |
415 }); | 415 }); |
416 | 416 |
417 | 417 |
418 } | 418 } |
419 | 419 |
OLD | NEW |