forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_task.go
554 lines (499 loc) · 14.5 KB
/
fake_task.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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
// This file was generated by counterfeiter
package directorfakes
import (
"sync"
"time"
"github.com/cloudfoundry/bosh-cli/director"
)
type FakeTask struct {
IDStub func() int
iDMutex sync.RWMutex
iDArgsForCall []struct{}
iDReturns struct {
result1 int
}
StartedAtStub func() time.Time
startedAtMutex sync.RWMutex
startedAtArgsForCall []struct{}
startedAtReturns struct {
result1 time.Time
}
LastActivityAtStub func() time.Time
lastActivityAtMutex sync.RWMutex
lastActivityAtArgsForCall []struct{}
lastActivityAtReturns struct {
result1 time.Time
}
StateStub func() string
stateMutex sync.RWMutex
stateArgsForCall []struct{}
stateReturns struct {
result1 string
}
IsErrorStub func() bool
isErrorMutex sync.RWMutex
isErrorArgsForCall []struct{}
isErrorReturns struct {
result1 bool
}
UserStub func() string
userMutex sync.RWMutex
userArgsForCall []struct{}
userReturns struct {
result1 string
}
DeploymentNameStub func() string
deploymentNameMutex sync.RWMutex
deploymentNameArgsForCall []struct{}
deploymentNameReturns struct {
result1 string
}
ContextIDStub func() string
contextIDMutex sync.RWMutex
contextIDArgsForCall []struct{}
contextIDReturns struct {
result1 string
}
DescriptionStub func() string
descriptionMutex sync.RWMutex
descriptionArgsForCall []struct{}
descriptionReturns struct {
result1 string
}
ResultStub func() string
resultMutex sync.RWMutex
resultArgsForCall []struct{}
resultReturns struct {
result1 string
}
EventOutputStub func(director.TaskReporter) error
eventOutputMutex sync.RWMutex
eventOutputArgsForCall []struct {
arg1 director.TaskReporter
}
eventOutputReturns struct {
result1 error
}
CPIOutputStub func(director.TaskReporter) error
cPIOutputMutex sync.RWMutex
cPIOutputArgsForCall []struct {
arg1 director.TaskReporter
}
cPIOutputReturns struct {
result1 error
}
DebugOutputStub func(director.TaskReporter) error
debugOutputMutex sync.RWMutex
debugOutputArgsForCall []struct {
arg1 director.TaskReporter
}
debugOutputReturns struct {
result1 error
}
ResultOutputStub func(director.TaskReporter) error
resultOutputMutex sync.RWMutex
resultOutputArgsForCall []struct {
arg1 director.TaskReporter
}
resultOutputReturns struct {
result1 error
}
CancelStub func() error
cancelMutex sync.RWMutex
cancelArgsForCall []struct{}
cancelReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeTask) ID() int {
fake.iDMutex.Lock()
fake.iDArgsForCall = append(fake.iDArgsForCall, struct{}{})
fake.recordInvocation("ID", []interface{}{})
fake.iDMutex.Unlock()
if fake.IDStub != nil {
return fake.IDStub()
}
return fake.iDReturns.result1
}
func (fake *FakeTask) IDCallCount() int {
fake.iDMutex.RLock()
defer fake.iDMutex.RUnlock()
return len(fake.iDArgsForCall)
}
func (fake *FakeTask) IDReturns(result1 int) {
fake.IDStub = nil
fake.iDReturns = struct {
result1 int
}{result1}
}
func (fake *FakeTask) StartedAt() time.Time {
fake.startedAtMutex.Lock()
fake.startedAtArgsForCall = append(fake.startedAtArgsForCall, struct{}{})
fake.recordInvocation("StartedAt", []interface{}{})
fake.startedAtMutex.Unlock()
if fake.StartedAtStub != nil {
return fake.StartedAtStub()
}
return fake.startedAtReturns.result1
}
func (fake *FakeTask) StartedAtCallCount() int {
fake.startedAtMutex.RLock()
defer fake.startedAtMutex.RUnlock()
return len(fake.startedAtArgsForCall)
}
func (fake *FakeTask) StartedAtReturns(result1 time.Time) {
fake.StartedAtStub = nil
fake.startedAtReturns = struct {
result1 time.Time
}{result1}
}
func (fake *FakeTask) LastActivityAt() time.Time {
fake.lastActivityAtMutex.Lock()
fake.lastActivityAtArgsForCall = append(fake.lastActivityAtArgsForCall, struct{}{})
fake.recordInvocation("LastActivityAt", []interface{}{})
fake.lastActivityAtMutex.Unlock()
if fake.LastActivityAtStub != nil {
return fake.LastActivityAtStub()
}
return fake.lastActivityAtReturns.result1
}
func (fake *FakeTask) LastActivityAtCallCount() int {
fake.lastActivityAtMutex.RLock()
defer fake.lastActivityAtMutex.RUnlock()
return len(fake.lastActivityAtArgsForCall)
}
func (fake *FakeTask) LastActivityAtReturns(result1 time.Time) {
fake.LastActivityAtStub = nil
fake.lastActivityAtReturns = struct {
result1 time.Time
}{result1}
}
func (fake *FakeTask) State() string {
fake.stateMutex.Lock()
fake.stateArgsForCall = append(fake.stateArgsForCall, struct{}{})
fake.recordInvocation("State", []interface{}{})
fake.stateMutex.Unlock()
if fake.StateStub != nil {
return fake.StateStub()
}
return fake.stateReturns.result1
}
func (fake *FakeTask) StateCallCount() int {
fake.stateMutex.RLock()
defer fake.stateMutex.RUnlock()
return len(fake.stateArgsForCall)
}
func (fake *FakeTask) StateReturns(result1 string) {
fake.StateStub = nil
fake.stateReturns = struct {
result1 string
}{result1}
}
func (fake *FakeTask) IsError() bool {
fake.isErrorMutex.Lock()
fake.isErrorArgsForCall = append(fake.isErrorArgsForCall, struct{}{})
fake.recordInvocation("IsError", []interface{}{})
fake.isErrorMutex.Unlock()
if fake.IsErrorStub != nil {
return fake.IsErrorStub()
}
return fake.isErrorReturns.result1
}
func (fake *FakeTask) IsErrorCallCount() int {
fake.isErrorMutex.RLock()
defer fake.isErrorMutex.RUnlock()
return len(fake.isErrorArgsForCall)
}
func (fake *FakeTask) IsErrorReturns(result1 bool) {
fake.IsErrorStub = nil
fake.isErrorReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeTask) User() string {
fake.userMutex.Lock()
fake.userArgsForCall = append(fake.userArgsForCall, struct{}{})
fake.recordInvocation("User", []interface{}{})
fake.userMutex.Unlock()
if fake.UserStub != nil {
return fake.UserStub()
}
return fake.userReturns.result1
}
func (fake *FakeTask) UserCallCount() int {
fake.userMutex.RLock()
defer fake.userMutex.RUnlock()
return len(fake.userArgsForCall)
}
func (fake *FakeTask) UserReturns(result1 string) {
fake.UserStub = nil
fake.userReturns = struct {
result1 string
}{result1}
}
func (fake *FakeTask) DeploymentName() string {
fake.deploymentNameMutex.Lock()
fake.deploymentNameArgsForCall = append(fake.deploymentNameArgsForCall, struct{}{})
fake.recordInvocation("DeploymentName", []interface{}{})
fake.deploymentNameMutex.Unlock()
if fake.DeploymentNameStub != nil {
return fake.DeploymentNameStub()
}
return fake.deploymentNameReturns.result1
}
func (fake *FakeTask) DeploymentNameCallCount() int {
fake.deploymentNameMutex.RLock()
defer fake.deploymentNameMutex.RUnlock()
return len(fake.deploymentNameArgsForCall)
}
func (fake *FakeTask) DeploymentNameReturns(result1 string) {
fake.DeploymentNameStub = nil
fake.deploymentNameReturns = struct {
result1 string
}{result1}
}
func (fake *FakeTask) ContextID() string {
fake.contextIDMutex.Lock()
fake.contextIDArgsForCall = append(fake.contextIDArgsForCall, struct{}{})
fake.recordInvocation("ContextID", []interface{}{})
fake.contextIDMutex.Unlock()
if fake.ContextIDStub != nil {
return fake.ContextIDStub()
}
return fake.contextIDReturns.result1
}
func (fake *FakeTask) ContextIDCallCount() int {
fake.contextIDMutex.RLock()
defer fake.contextIDMutex.RUnlock()
return len(fake.contextIDArgsForCall)
}
func (fake *FakeTask) ContextIDReturns(result1 string) {
fake.ContextIDStub = nil
fake.contextIDReturns = struct {
result1 string
}{result1}
}
func (fake *FakeTask) Description() string {
fake.descriptionMutex.Lock()
fake.descriptionArgsForCall = append(fake.descriptionArgsForCall, struct{}{})
fake.recordInvocation("Description", []interface{}{})
fake.descriptionMutex.Unlock()
if fake.DescriptionStub != nil {
return fake.DescriptionStub()
}
return fake.descriptionReturns.result1
}
func (fake *FakeTask) DescriptionCallCount() int {
fake.descriptionMutex.RLock()
defer fake.descriptionMutex.RUnlock()
return len(fake.descriptionArgsForCall)
}
func (fake *FakeTask) DescriptionReturns(result1 string) {
fake.DescriptionStub = nil
fake.descriptionReturns = struct {
result1 string
}{result1}
}
func (fake *FakeTask) Result() string {
fake.resultMutex.Lock()
fake.resultArgsForCall = append(fake.resultArgsForCall, struct{}{})
fake.recordInvocation("Result", []interface{}{})
fake.resultMutex.Unlock()
if fake.ResultStub != nil {
return fake.ResultStub()
}
return fake.resultReturns.result1
}
func (fake *FakeTask) ResultCallCount() int {
fake.resultMutex.RLock()
defer fake.resultMutex.RUnlock()
return len(fake.resultArgsForCall)
}
func (fake *FakeTask) ResultReturns(result1 string) {
fake.ResultStub = nil
fake.resultReturns = struct {
result1 string
}{result1}
}
func (fake *FakeTask) EventOutput(arg1 director.TaskReporter) error {
fake.eventOutputMutex.Lock()
fake.eventOutputArgsForCall = append(fake.eventOutputArgsForCall, struct {
arg1 director.TaskReporter
}{arg1})
fake.recordInvocation("EventOutput", []interface{}{arg1})
fake.eventOutputMutex.Unlock()
if fake.EventOutputStub != nil {
return fake.EventOutputStub(arg1)
}
return fake.eventOutputReturns.result1
}
func (fake *FakeTask) EventOutputCallCount() int {
fake.eventOutputMutex.RLock()
defer fake.eventOutputMutex.RUnlock()
return len(fake.eventOutputArgsForCall)
}
func (fake *FakeTask) EventOutputArgsForCall(i int) director.TaskReporter {
fake.eventOutputMutex.RLock()
defer fake.eventOutputMutex.RUnlock()
return fake.eventOutputArgsForCall[i].arg1
}
func (fake *FakeTask) EventOutputReturns(result1 error) {
fake.EventOutputStub = nil
fake.eventOutputReturns = struct {
result1 error
}{result1}
}
func (fake *FakeTask) CPIOutput(arg1 director.TaskReporter) error {
fake.cPIOutputMutex.Lock()
fake.cPIOutputArgsForCall = append(fake.cPIOutputArgsForCall, struct {
arg1 director.TaskReporter
}{arg1})
fake.recordInvocation("CPIOutput", []interface{}{arg1})
fake.cPIOutputMutex.Unlock()
if fake.CPIOutputStub != nil {
return fake.CPIOutputStub(arg1)
}
return fake.cPIOutputReturns.result1
}
func (fake *FakeTask) CPIOutputCallCount() int {
fake.cPIOutputMutex.RLock()
defer fake.cPIOutputMutex.RUnlock()
return len(fake.cPIOutputArgsForCall)
}
func (fake *FakeTask) CPIOutputArgsForCall(i int) director.TaskReporter {
fake.cPIOutputMutex.RLock()
defer fake.cPIOutputMutex.RUnlock()
return fake.cPIOutputArgsForCall[i].arg1
}
func (fake *FakeTask) CPIOutputReturns(result1 error) {
fake.CPIOutputStub = nil
fake.cPIOutputReturns = struct {
result1 error
}{result1}
}
func (fake *FakeTask) DebugOutput(arg1 director.TaskReporter) error {
fake.debugOutputMutex.Lock()
fake.debugOutputArgsForCall = append(fake.debugOutputArgsForCall, struct {
arg1 director.TaskReporter
}{arg1})
fake.recordInvocation("DebugOutput", []interface{}{arg1})
fake.debugOutputMutex.Unlock()
if fake.DebugOutputStub != nil {
return fake.DebugOutputStub(arg1)
}
return fake.debugOutputReturns.result1
}
func (fake *FakeTask) DebugOutputCallCount() int {
fake.debugOutputMutex.RLock()
defer fake.debugOutputMutex.RUnlock()
return len(fake.debugOutputArgsForCall)
}
func (fake *FakeTask) DebugOutputArgsForCall(i int) director.TaskReporter {
fake.debugOutputMutex.RLock()
defer fake.debugOutputMutex.RUnlock()
return fake.debugOutputArgsForCall[i].arg1
}
func (fake *FakeTask) DebugOutputReturns(result1 error) {
fake.DebugOutputStub = nil
fake.debugOutputReturns = struct {
result1 error
}{result1}
}
func (fake *FakeTask) ResultOutput(arg1 director.TaskReporter) error {
fake.resultOutputMutex.Lock()
fake.resultOutputArgsForCall = append(fake.resultOutputArgsForCall, struct {
arg1 director.TaskReporter
}{arg1})
fake.recordInvocation("ResultOutput", []interface{}{arg1})
fake.resultOutputMutex.Unlock()
if fake.ResultOutputStub != nil {
return fake.ResultOutputStub(arg1)
}
return fake.resultOutputReturns.result1
}
func (fake *FakeTask) ResultOutputCallCount() int {
fake.resultOutputMutex.RLock()
defer fake.resultOutputMutex.RUnlock()
return len(fake.resultOutputArgsForCall)
}
func (fake *FakeTask) ResultOutputArgsForCall(i int) director.TaskReporter {
fake.resultOutputMutex.RLock()
defer fake.resultOutputMutex.RUnlock()
return fake.resultOutputArgsForCall[i].arg1
}
func (fake *FakeTask) ResultOutputReturns(result1 error) {
fake.ResultOutputStub = nil
fake.resultOutputReturns = struct {
result1 error
}{result1}
}
func (fake *FakeTask) Cancel() error {
fake.cancelMutex.Lock()
fake.cancelArgsForCall = append(fake.cancelArgsForCall, struct{}{})
fake.recordInvocation("Cancel", []interface{}{})
fake.cancelMutex.Unlock()
if fake.CancelStub != nil {
return fake.CancelStub()
}
return fake.cancelReturns.result1
}
func (fake *FakeTask) CancelCallCount() int {
fake.cancelMutex.RLock()
defer fake.cancelMutex.RUnlock()
return len(fake.cancelArgsForCall)
}
func (fake *FakeTask) CancelReturns(result1 error) {
fake.CancelStub = nil
fake.cancelReturns = struct {
result1 error
}{result1}
}
func (fake *FakeTask) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.iDMutex.RLock()
defer fake.iDMutex.RUnlock()
fake.startedAtMutex.RLock()
defer fake.startedAtMutex.RUnlock()
fake.lastActivityAtMutex.RLock()
defer fake.lastActivityAtMutex.RUnlock()
fake.stateMutex.RLock()
defer fake.stateMutex.RUnlock()
fake.isErrorMutex.RLock()
defer fake.isErrorMutex.RUnlock()
fake.userMutex.RLock()
defer fake.userMutex.RUnlock()
fake.deploymentNameMutex.RLock()
defer fake.deploymentNameMutex.RUnlock()
fake.contextIDMutex.RLock()
defer fake.contextIDMutex.RUnlock()
fake.descriptionMutex.RLock()
defer fake.descriptionMutex.RUnlock()
fake.resultMutex.RLock()
defer fake.resultMutex.RUnlock()
fake.eventOutputMutex.RLock()
defer fake.eventOutputMutex.RUnlock()
fake.cPIOutputMutex.RLock()
defer fake.cPIOutputMutex.RUnlock()
fake.debugOutputMutex.RLock()
defer fake.debugOutputMutex.RUnlock()
fake.resultOutputMutex.RLock()
defer fake.resultOutputMutex.RUnlock()
fake.cancelMutex.RLock()
defer fake.cancelMutex.RUnlock()
return fake.invocations
}
func (fake *FakeTask) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ director.Task = new(FakeTask)