| OLD | NEW |
| 1 library googleapis_beta.pubsub.v1beta1.test; | 1 library googleapis_beta.pubsub.v1beta1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 import 'package:googleapis_beta/common/common.dart' as common; | 11 import 'package:googleapis_beta/common/common.dart' as common; |
| 12 import 'package:googleapis_beta/src/common_internal.dart' as common_internal; | 12 import 'package:googleapis_beta/src/common_internal.dart' as common_internal; |
| 13 import '../common/common_internal_test.dart' as common_test; | 13 import '../common/common_internal_test.dart' as common_test; |
| 14 | 14 |
| 15 import 'package:googleapis_beta/pubsub/v1beta1.dart' as api; | 15 import 'package:googleapis_beta/pubsub/v1beta1.dart' as api; |
| 16 | 16 |
| 17 | 17 |
| 18 | 18 |
| 19 buildUnnamed1141() { | 19 buildUnnamed1266() { |
| 20 var o = new core.List<core.String>(); | 20 var o = new core.List<core.String>(); |
| 21 o.add("foo"); | 21 o.add("foo"); |
| 22 o.add("foo"); | 22 o.add("foo"); |
| 23 return o; | 23 return o; |
| 24 } | 24 } |
| 25 | 25 |
| 26 checkUnnamed1141(core.List<core.String> o) { | 26 checkUnnamed1266(core.List<core.String> o) { |
| 27 unittest.expect(o, unittest.hasLength(2)); | 27 unittest.expect(o, unittest.hasLength(2)); |
| 28 unittest.expect(o[0], unittest.equals('foo')); | 28 unittest.expect(o[0], unittest.equals('foo')); |
| 29 unittest.expect(o[1], unittest.equals('foo')); | 29 unittest.expect(o[1], unittest.equals('foo')); |
| 30 } | 30 } |
| 31 | 31 |
| 32 core.int buildCounterAcknowledgeRequest = 0; | 32 core.int buildCounterAcknowledgeRequest = 0; |
| 33 buildAcknowledgeRequest() { | 33 buildAcknowledgeRequest() { |
| 34 var o = new api.AcknowledgeRequest(); | 34 var o = new api.AcknowledgeRequest(); |
| 35 buildCounterAcknowledgeRequest++; | 35 buildCounterAcknowledgeRequest++; |
| 36 if (buildCounterAcknowledgeRequest < 3) { | 36 if (buildCounterAcknowledgeRequest < 3) { |
| 37 o.ackId = buildUnnamed1141(); | 37 o.ackId = buildUnnamed1266(); |
| 38 o.subscription = "foo"; | 38 o.subscription = "foo"; |
| 39 } | 39 } |
| 40 buildCounterAcknowledgeRequest--; | 40 buildCounterAcknowledgeRequest--; |
| 41 return o; | 41 return o; |
| 42 } | 42 } |
| 43 | 43 |
| 44 checkAcknowledgeRequest(api.AcknowledgeRequest o) { | 44 checkAcknowledgeRequest(api.AcknowledgeRequest o) { |
| 45 buildCounterAcknowledgeRequest++; | 45 buildCounterAcknowledgeRequest++; |
| 46 if (buildCounterAcknowledgeRequest < 3) { | 46 if (buildCounterAcknowledgeRequest < 3) { |
| 47 checkUnnamed1141(o.ackId); | 47 checkUnnamed1266(o.ackId); |
| 48 unittest.expect(o.subscription, unittest.equals('foo')); | 48 unittest.expect(o.subscription, unittest.equals('foo')); |
| 49 } | 49 } |
| 50 buildCounterAcknowledgeRequest--; | 50 buildCounterAcknowledgeRequest--; |
| 51 } | 51 } |
| 52 | 52 |
| 53 core.int buildCounterLabel = 0; | 53 core.int buildCounterLabel = 0; |
| 54 buildLabel() { | 54 buildLabel() { |
| 55 var o = new api.Label(); | 55 var o = new api.Label(); |
| 56 buildCounterLabel++; | 56 buildCounterLabel++; |
| 57 if (buildCounterLabel < 3) { | 57 if (buildCounterLabel < 3) { |
| 58 o.key = "foo"; | 58 o.key = "foo"; |
| 59 o.numValue = "foo"; | 59 o.numValue = "foo"; |
| 60 o.strValue = "foo"; | 60 o.strValue = "foo"; |
| 61 } | 61 } |
| 62 buildCounterLabel--; | 62 buildCounterLabel--; |
| 63 return o; | 63 return o; |
| 64 } | 64 } |
| 65 | 65 |
| 66 checkLabel(api.Label o) { | 66 checkLabel(api.Label o) { |
| 67 buildCounterLabel++; | 67 buildCounterLabel++; |
| 68 if (buildCounterLabel < 3) { | 68 if (buildCounterLabel < 3) { |
| 69 unittest.expect(o.key, unittest.equals('foo')); | 69 unittest.expect(o.key, unittest.equals('foo')); |
| 70 unittest.expect(o.numValue, unittest.equals('foo')); | 70 unittest.expect(o.numValue, unittest.equals('foo')); |
| 71 unittest.expect(o.strValue, unittest.equals('foo')); | 71 unittest.expect(o.strValue, unittest.equals('foo')); |
| 72 } | 72 } |
| 73 buildCounterLabel--; | 73 buildCounterLabel--; |
| 74 } | 74 } |
| 75 | 75 |
| 76 buildUnnamed1142() { | 76 buildUnnamed1267() { |
| 77 var o = new core.List<api.Subscription>(); | 77 var o = new core.List<api.Subscription>(); |
| 78 o.add(buildSubscription()); | 78 o.add(buildSubscription()); |
| 79 o.add(buildSubscription()); | 79 o.add(buildSubscription()); |
| 80 return o; | 80 return o; |
| 81 } | 81 } |
| 82 | 82 |
| 83 checkUnnamed1142(core.List<api.Subscription> o) { | 83 checkUnnamed1267(core.List<api.Subscription> o) { |
| 84 unittest.expect(o, unittest.hasLength(2)); | 84 unittest.expect(o, unittest.hasLength(2)); |
| 85 checkSubscription(o[0]); | 85 checkSubscription(o[0]); |
| 86 checkSubscription(o[1]); | 86 checkSubscription(o[1]); |
| 87 } | 87 } |
| 88 | 88 |
| 89 core.int buildCounterListSubscriptionsResponse = 0; | 89 core.int buildCounterListSubscriptionsResponse = 0; |
| 90 buildListSubscriptionsResponse() { | 90 buildListSubscriptionsResponse() { |
| 91 var o = new api.ListSubscriptionsResponse(); | 91 var o = new api.ListSubscriptionsResponse(); |
| 92 buildCounterListSubscriptionsResponse++; | 92 buildCounterListSubscriptionsResponse++; |
| 93 if (buildCounterListSubscriptionsResponse < 3) { | 93 if (buildCounterListSubscriptionsResponse < 3) { |
| 94 o.nextPageToken = "foo"; | 94 o.nextPageToken = "foo"; |
| 95 o.subscription = buildUnnamed1142(); | 95 o.subscription = buildUnnamed1267(); |
| 96 } | 96 } |
| 97 buildCounterListSubscriptionsResponse--; | 97 buildCounterListSubscriptionsResponse--; |
| 98 return o; | 98 return o; |
| 99 } | 99 } |
| 100 | 100 |
| 101 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { | 101 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { |
| 102 buildCounterListSubscriptionsResponse++; | 102 buildCounterListSubscriptionsResponse++; |
| 103 if (buildCounterListSubscriptionsResponse < 3) { | 103 if (buildCounterListSubscriptionsResponse < 3) { |
| 104 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 104 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 105 checkUnnamed1142(o.subscription); | 105 checkUnnamed1267(o.subscription); |
| 106 } | 106 } |
| 107 buildCounterListSubscriptionsResponse--; | 107 buildCounterListSubscriptionsResponse--; |
| 108 } | 108 } |
| 109 | 109 |
| 110 buildUnnamed1143() { | 110 buildUnnamed1268() { |
| 111 var o = new core.List<api.Topic>(); | 111 var o = new core.List<api.Topic>(); |
| 112 o.add(buildTopic()); | 112 o.add(buildTopic()); |
| 113 o.add(buildTopic()); | 113 o.add(buildTopic()); |
| 114 return o; | 114 return o; |
| 115 } | 115 } |
| 116 | 116 |
| 117 checkUnnamed1143(core.List<api.Topic> o) { | 117 checkUnnamed1268(core.List<api.Topic> o) { |
| 118 unittest.expect(o, unittest.hasLength(2)); | 118 unittest.expect(o, unittest.hasLength(2)); |
| 119 checkTopic(o[0]); | 119 checkTopic(o[0]); |
| 120 checkTopic(o[1]); | 120 checkTopic(o[1]); |
| 121 } | 121 } |
| 122 | 122 |
| 123 core.int buildCounterListTopicsResponse = 0; | 123 core.int buildCounterListTopicsResponse = 0; |
| 124 buildListTopicsResponse() { | 124 buildListTopicsResponse() { |
| 125 var o = new api.ListTopicsResponse(); | 125 var o = new api.ListTopicsResponse(); |
| 126 buildCounterListTopicsResponse++; | 126 buildCounterListTopicsResponse++; |
| 127 if (buildCounterListTopicsResponse < 3) { | 127 if (buildCounterListTopicsResponse < 3) { |
| 128 o.nextPageToken = "foo"; | 128 o.nextPageToken = "foo"; |
| 129 o.topic = buildUnnamed1143(); | 129 o.topic = buildUnnamed1268(); |
| 130 } | 130 } |
| 131 buildCounterListTopicsResponse--; | 131 buildCounterListTopicsResponse--; |
| 132 return o; | 132 return o; |
| 133 } | 133 } |
| 134 | 134 |
| 135 checkListTopicsResponse(api.ListTopicsResponse o) { | 135 checkListTopicsResponse(api.ListTopicsResponse o) { |
| 136 buildCounterListTopicsResponse++; | 136 buildCounterListTopicsResponse++; |
| 137 if (buildCounterListTopicsResponse < 3) { | 137 if (buildCounterListTopicsResponse < 3) { |
| 138 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 138 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 139 checkUnnamed1143(o.topic); | 139 checkUnnamed1268(o.topic); |
| 140 } | 140 } |
| 141 buildCounterListTopicsResponse--; | 141 buildCounterListTopicsResponse--; |
| 142 } | 142 } |
| 143 | 143 |
| 144 core.int buildCounterModifyAckDeadlineRequest = 0; | 144 core.int buildCounterModifyAckDeadlineRequest = 0; |
| 145 buildModifyAckDeadlineRequest() { | 145 buildModifyAckDeadlineRequest() { |
| 146 var o = new api.ModifyAckDeadlineRequest(); | 146 var o = new api.ModifyAckDeadlineRequest(); |
| 147 buildCounterModifyAckDeadlineRequest++; | 147 buildCounterModifyAckDeadlineRequest++; |
| 148 if (buildCounterModifyAckDeadlineRequest < 3) { | 148 if (buildCounterModifyAckDeadlineRequest < 3) { |
| 149 o.ackDeadlineSeconds = 42; | 149 o.ackDeadlineSeconds = 42; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 buildCounterPubsubEvent++; | 224 buildCounterPubsubEvent++; |
| 225 if (buildCounterPubsubEvent < 3) { | 225 if (buildCounterPubsubEvent < 3) { |
| 226 unittest.expect(o.deleted, unittest.isTrue); | 226 unittest.expect(o.deleted, unittest.isTrue); |
| 227 checkPubsubMessage(o.message); | 227 checkPubsubMessage(o.message); |
| 228 unittest.expect(o.subscription, unittest.equals('foo')); | 228 unittest.expect(o.subscription, unittest.equals('foo')); |
| 229 unittest.expect(o.truncated, unittest.isTrue); | 229 unittest.expect(o.truncated, unittest.isTrue); |
| 230 } | 230 } |
| 231 buildCounterPubsubEvent--; | 231 buildCounterPubsubEvent--; |
| 232 } | 232 } |
| 233 | 233 |
| 234 buildUnnamed1144() { | 234 buildUnnamed1269() { |
| 235 var o = new core.List<api.Label>(); | 235 var o = new core.List<api.Label>(); |
| 236 o.add(buildLabel()); | 236 o.add(buildLabel()); |
| 237 o.add(buildLabel()); | 237 o.add(buildLabel()); |
| 238 return o; | 238 return o; |
| 239 } | 239 } |
| 240 | 240 |
| 241 checkUnnamed1144(core.List<api.Label> o) { | 241 checkUnnamed1269(core.List<api.Label> o) { |
| 242 unittest.expect(o, unittest.hasLength(2)); | 242 unittest.expect(o, unittest.hasLength(2)); |
| 243 checkLabel(o[0]); | 243 checkLabel(o[0]); |
| 244 checkLabel(o[1]); | 244 checkLabel(o[1]); |
| 245 } | 245 } |
| 246 | 246 |
| 247 core.int buildCounterPubsubMessage = 0; | 247 core.int buildCounterPubsubMessage = 0; |
| 248 buildPubsubMessage() { | 248 buildPubsubMessage() { |
| 249 var o = new api.PubsubMessage(); | 249 var o = new api.PubsubMessage(); |
| 250 buildCounterPubsubMessage++; | 250 buildCounterPubsubMessage++; |
| 251 if (buildCounterPubsubMessage < 3) { | 251 if (buildCounterPubsubMessage < 3) { |
| 252 o.data = "foo"; | 252 o.data = "foo"; |
| 253 o.label = buildUnnamed1144(); | 253 o.label = buildUnnamed1269(); |
| 254 } | 254 } |
| 255 buildCounterPubsubMessage--; | 255 buildCounterPubsubMessage--; |
| 256 return o; | 256 return o; |
| 257 } | 257 } |
| 258 | 258 |
| 259 checkPubsubMessage(api.PubsubMessage o) { | 259 checkPubsubMessage(api.PubsubMessage o) { |
| 260 buildCounterPubsubMessage++; | 260 buildCounterPubsubMessage++; |
| 261 if (buildCounterPubsubMessage < 3) { | 261 if (buildCounterPubsubMessage < 3) { |
| 262 unittest.expect(o.data, unittest.equals('foo')); | 262 unittest.expect(o.data, unittest.equals('foo')); |
| 263 checkUnnamed1144(o.label); | 263 checkUnnamed1269(o.label); |
| 264 } | 264 } |
| 265 buildCounterPubsubMessage--; | 265 buildCounterPubsubMessage--; |
| 266 } | 266 } |
| 267 | 267 |
| 268 core.int buildCounterPullRequest = 0; | 268 core.int buildCounterPullRequest = 0; |
| 269 buildPullRequest() { | 269 buildPullRequest() { |
| 270 var o = new api.PullRequest(); | 270 var o = new api.PullRequest(); |
| 271 buildCounterPullRequest++; | 271 buildCounterPullRequest++; |
| 272 if (buildCounterPullRequest < 3) { | 272 if (buildCounterPullRequest < 3) { |
| 273 o.returnImmediately = true; | 273 o.returnImmediately = true; |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 return new async.Future.value(common_test.stringResponse(200, h, resp)); | 1122 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1123 }), true); | 1123 }), true); |
| 1124 res.publish(arg_request).then(unittest.expectAsync((_) {})); | 1124 res.publish(arg_request).then(unittest.expectAsync((_) {})); |
| 1125 }); | 1125 }); |
| 1126 | 1126 |
| 1127 }); | 1127 }); |
| 1128 | 1128 |
| 1129 | 1129 |
| 1130 } | 1130 } |
| 1131 | 1131 |
| OLD | NEW |