This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
fake_routing_table.go
317 lines (283 loc) · 9.54 KB
/
fake_routing_table.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
// This file was generated by counterfeiter
package fakes
import (
"sync"
"code.cloudfoundry.org/bbs/models"
"code.cloudfoundry.org/tcp-emitter/routing_table/schema"
"code.cloudfoundry.org/tcp-emitter/routing_table/schema/event"
)
type FakeRoutingTable struct {
RouteCountStub func() int
routeCountMutex sync.RWMutex
routeCountArgsForCall []struct{}
routeCountReturns struct {
result1 int
}
AddRoutesStub func(desiredLRP *models.DesiredLRPSchedulingInfo) event.RoutingEvents
addRoutesMutex sync.RWMutex
addRoutesArgsForCall []struct {
desiredLRP *models.DesiredLRPSchedulingInfo
}
addRoutesReturns struct {
result1 event.RoutingEvents
}
UpdateRoutesStub func(beforeLRP, afterLRP *models.DesiredLRPSchedulingInfo) event.RoutingEvents
updateRoutesMutex sync.RWMutex
updateRoutesArgsForCall []struct {
beforeLRP *models.DesiredLRPSchedulingInfo
afterLRP *models.DesiredLRPSchedulingInfo
}
updateRoutesReturns struct {
result1 event.RoutingEvents
}
RemoveRoutesStub func(desiredLRP *models.DesiredLRPSchedulingInfo) event.RoutingEvents
removeRoutesMutex sync.RWMutex
removeRoutesArgsForCall []struct {
desiredLRP *models.DesiredLRPSchedulingInfo
}
removeRoutesReturns struct {
result1 event.RoutingEvents
}
AddEndpointStub func(actualLRP *models.ActualLRPGroup) event.RoutingEvents
addEndpointMutex sync.RWMutex
addEndpointArgsForCall []struct {
actualLRP *models.ActualLRPGroup
}
addEndpointReturns struct {
result1 event.RoutingEvents
}
RemoveEndpointStub func(actualLRP *models.ActualLRPGroup) event.RoutingEvents
removeEndpointMutex sync.RWMutex
removeEndpointArgsForCall []struct {
actualLRP *models.ActualLRPGroup
}
removeEndpointReturns struct {
result1 event.RoutingEvents
}
SwapStub func(t schema.RoutingTable) event.RoutingEvents
swapMutex sync.RWMutex
swapArgsForCall []struct {
t schema.RoutingTable
}
swapReturns struct {
result1 event.RoutingEvents
}
GetRoutingEventsStub func() event.RoutingEvents
getRoutingEventsMutex sync.RWMutex
getRoutingEventsArgsForCall []struct{}
getRoutingEventsReturns struct {
result1 event.RoutingEvents
}
}
func (fake *FakeRoutingTable) RouteCount() int {
fake.routeCountMutex.Lock()
fake.routeCountArgsForCall = append(fake.routeCountArgsForCall, struct{}{})
fake.routeCountMutex.Unlock()
if fake.RouteCountStub != nil {
return fake.RouteCountStub()
} else {
return fake.routeCountReturns.result1
}
}
func (fake *FakeRoutingTable) RouteCountCallCount() int {
fake.routeCountMutex.RLock()
defer fake.routeCountMutex.RUnlock()
return len(fake.routeCountArgsForCall)
}
func (fake *FakeRoutingTable) RouteCountReturns(result1 int) {
fake.RouteCountStub = nil
fake.routeCountReturns = struct {
result1 int
}{result1}
}
func (fake *FakeRoutingTable) AddRoutes(desiredLRP *models.DesiredLRPSchedulingInfo) event.RoutingEvents {
fake.addRoutesMutex.Lock()
fake.addRoutesArgsForCall = append(fake.addRoutesArgsForCall, struct {
desiredLRP *models.DesiredLRPSchedulingInfo
}{desiredLRP})
fake.addRoutesMutex.Unlock()
if fake.AddRoutesStub != nil {
return fake.AddRoutesStub(desiredLRP)
} else {
return fake.addRoutesReturns.result1
}
}
func (fake *FakeRoutingTable) AddRoutesCallCount() int {
fake.addRoutesMutex.RLock()
defer fake.addRoutesMutex.RUnlock()
return len(fake.addRoutesArgsForCall)
}
func (fake *FakeRoutingTable) AddRoutesArgsForCall(i int) *models.DesiredLRPSchedulingInfo {
fake.addRoutesMutex.RLock()
defer fake.addRoutesMutex.RUnlock()
return fake.addRoutesArgsForCall[i].desiredLRP
}
func (fake *FakeRoutingTable) AddRoutesReturns(result1 event.RoutingEvents) {
fake.AddRoutesStub = nil
fake.addRoutesReturns = struct {
result1 event.RoutingEvents
}{result1}
}
func (fake *FakeRoutingTable) UpdateRoutes(beforeLRP *models.DesiredLRPSchedulingInfo, afterLRP *models.DesiredLRPSchedulingInfo) event.RoutingEvents {
fake.updateRoutesMutex.Lock()
fake.updateRoutesArgsForCall = append(fake.updateRoutesArgsForCall, struct {
beforeLRP *models.DesiredLRPSchedulingInfo
afterLRP *models.DesiredLRPSchedulingInfo
}{beforeLRP, afterLRP})
fake.updateRoutesMutex.Unlock()
if fake.UpdateRoutesStub != nil {
return fake.UpdateRoutesStub(beforeLRP, afterLRP)
} else {
return fake.updateRoutesReturns.result1
}
}
func (fake *FakeRoutingTable) UpdateRoutesCallCount() int {
fake.updateRoutesMutex.RLock()
defer fake.updateRoutesMutex.RUnlock()
return len(fake.updateRoutesArgsForCall)
}
func (fake *FakeRoutingTable) UpdateRoutesArgsForCall(i int) (*models.DesiredLRPSchedulingInfo, *models.DesiredLRPSchedulingInfo) {
fake.updateRoutesMutex.RLock()
defer fake.updateRoutesMutex.RUnlock()
return fake.updateRoutesArgsForCall[i].beforeLRP, fake.updateRoutesArgsForCall[i].afterLRP
}
func (fake *FakeRoutingTable) UpdateRoutesReturns(result1 event.RoutingEvents) {
fake.UpdateRoutesStub = nil
fake.updateRoutesReturns = struct {
result1 event.RoutingEvents
}{result1}
}
func (fake *FakeRoutingTable) RemoveRoutes(desiredLRP *models.DesiredLRPSchedulingInfo) event.RoutingEvents {
fake.removeRoutesMutex.Lock()
fake.removeRoutesArgsForCall = append(fake.removeRoutesArgsForCall, struct {
desiredLRP *models.DesiredLRPSchedulingInfo
}{desiredLRP})
fake.removeRoutesMutex.Unlock()
if fake.RemoveRoutesStub != nil {
return fake.RemoveRoutesStub(desiredLRP)
} else {
return fake.removeRoutesReturns.result1
}
}
func (fake *FakeRoutingTable) RemoveRoutesCallCount() int {
fake.removeRoutesMutex.RLock()
defer fake.removeRoutesMutex.RUnlock()
return len(fake.removeRoutesArgsForCall)
}
func (fake *FakeRoutingTable) RemoveRoutesArgsForCall(i int) *models.DesiredLRPSchedulingInfo {
fake.removeRoutesMutex.RLock()
defer fake.removeRoutesMutex.RUnlock()
return fake.removeRoutesArgsForCall[i].desiredLRP
}
func (fake *FakeRoutingTable) RemoveRoutesReturns(result1 event.RoutingEvents) {
fake.RemoveRoutesStub = nil
fake.removeRoutesReturns = struct {
result1 event.RoutingEvents
}{result1}
}
func (fake *FakeRoutingTable) AddEndpoint(actualLRP *models.ActualLRPGroup) event.RoutingEvents {
fake.addEndpointMutex.Lock()
fake.addEndpointArgsForCall = append(fake.addEndpointArgsForCall, struct {
actualLRP *models.ActualLRPGroup
}{actualLRP})
fake.addEndpointMutex.Unlock()
if fake.AddEndpointStub != nil {
return fake.AddEndpointStub(actualLRP)
} else {
return fake.addEndpointReturns.result1
}
}
func (fake *FakeRoutingTable) AddEndpointCallCount() int {
fake.addEndpointMutex.RLock()
defer fake.addEndpointMutex.RUnlock()
return len(fake.addEndpointArgsForCall)
}
func (fake *FakeRoutingTable) AddEndpointArgsForCall(i int) *models.ActualLRPGroup {
fake.addEndpointMutex.RLock()
defer fake.addEndpointMutex.RUnlock()
return fake.addEndpointArgsForCall[i].actualLRP
}
func (fake *FakeRoutingTable) AddEndpointReturns(result1 event.RoutingEvents) {
fake.AddEndpointStub = nil
fake.addEndpointReturns = struct {
result1 event.RoutingEvents
}{result1}
}
func (fake *FakeRoutingTable) RemoveEndpoint(actualLRP *models.ActualLRPGroup) event.RoutingEvents {
fake.removeEndpointMutex.Lock()
fake.removeEndpointArgsForCall = append(fake.removeEndpointArgsForCall, struct {
actualLRP *models.ActualLRPGroup
}{actualLRP})
fake.removeEndpointMutex.Unlock()
if fake.RemoveEndpointStub != nil {
return fake.RemoveEndpointStub(actualLRP)
} else {
return fake.removeEndpointReturns.result1
}
}
func (fake *FakeRoutingTable) RemoveEndpointCallCount() int {
fake.removeEndpointMutex.RLock()
defer fake.removeEndpointMutex.RUnlock()
return len(fake.removeEndpointArgsForCall)
}
func (fake *FakeRoutingTable) RemoveEndpointArgsForCall(i int) *models.ActualLRPGroup {
fake.removeEndpointMutex.RLock()
defer fake.removeEndpointMutex.RUnlock()
return fake.removeEndpointArgsForCall[i].actualLRP
}
func (fake *FakeRoutingTable) RemoveEndpointReturns(result1 event.RoutingEvents) {
fake.RemoveEndpointStub = nil
fake.removeEndpointReturns = struct {
result1 event.RoutingEvents
}{result1}
}
func (fake *FakeRoutingTable) Swap(t schema.RoutingTable) event.RoutingEvents {
fake.swapMutex.Lock()
fake.swapArgsForCall = append(fake.swapArgsForCall, struct {
t schema.RoutingTable
}{t})
fake.swapMutex.Unlock()
if fake.SwapStub != nil {
return fake.SwapStub(t)
} else {
return fake.swapReturns.result1
}
}
func (fake *FakeRoutingTable) SwapCallCount() int {
fake.swapMutex.RLock()
defer fake.swapMutex.RUnlock()
return len(fake.swapArgsForCall)
}
func (fake *FakeRoutingTable) SwapArgsForCall(i int) schema.RoutingTable {
fake.swapMutex.RLock()
defer fake.swapMutex.RUnlock()
return fake.swapArgsForCall[i].t
}
func (fake *FakeRoutingTable) SwapReturns(result1 event.RoutingEvents) {
fake.SwapStub = nil
fake.swapReturns = struct {
result1 event.RoutingEvents
}{result1}
}
func (fake *FakeRoutingTable) GetRoutingEvents() event.RoutingEvents {
fake.getRoutingEventsMutex.Lock()
fake.getRoutingEventsArgsForCall = append(fake.getRoutingEventsArgsForCall, struct{}{})
fake.getRoutingEventsMutex.Unlock()
if fake.GetRoutingEventsStub != nil {
return fake.GetRoutingEventsStub()
} else {
return fake.getRoutingEventsReturns.result1
}
}
func (fake *FakeRoutingTable) GetRoutingEventsCallCount() int {
fake.getRoutingEventsMutex.RLock()
defer fake.getRoutingEventsMutex.RUnlock()
return len(fake.getRoutingEventsArgsForCall)
}
func (fake *FakeRoutingTable) GetRoutingEventsReturns(result1 event.RoutingEvents) {
fake.GetRoutingEventsStub = nil
fake.getRoutingEventsReturns = struct {
result1 event.RoutingEvents
}{result1}
}
var _ schema.RoutingTable = new(FakeRoutingTable)