forked from vmware-archive/atc
/
fake_step.go
143 lines (127 loc) · 3.5 KB
/
fake_step.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
// This file was generated by counterfeiter
package execfakes
import (
"os"
"sync"
"github.com/concourse/atc/exec"
)
type FakeStep struct {
RunStub func(signals <-chan os.Signal, ready chan<- struct{}) error
runMutex sync.RWMutex
runArgsForCall []struct {
signals <-chan os.Signal
ready chan<- struct{}
}
runReturns struct {
result1 error
}
ReleaseStub func()
releaseMutex sync.RWMutex
releaseArgsForCall []struct{}
ResultStub func(interface{}) bool
resultMutex sync.RWMutex
resultArgsForCall []struct {
arg1 interface{}
}
resultReturns struct {
result1 bool
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeStep) Run(signals <-chan os.Signal, ready chan<- struct{}) error {
fake.runMutex.Lock()
fake.runArgsForCall = append(fake.runArgsForCall, struct {
signals <-chan os.Signal
ready chan<- struct{}
}{signals, ready})
fake.recordInvocation("Run", []interface{}{signals, ready})
fake.runMutex.Unlock()
if fake.RunStub != nil {
return fake.RunStub(signals, ready)
} else {
return fake.runReturns.result1
}
}
func (fake *FakeStep) RunCallCount() int {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
return len(fake.runArgsForCall)
}
func (fake *FakeStep) RunArgsForCall(i int) (<-chan os.Signal, chan<- struct{}) {
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
return fake.runArgsForCall[i].signals, fake.runArgsForCall[i].ready
}
func (fake *FakeStep) RunReturns(result1 error) {
fake.RunStub = nil
fake.runReturns = struct {
result1 error
}{result1}
}
func (fake *FakeStep) Release() {
fake.releaseMutex.Lock()
fake.releaseArgsForCall = append(fake.releaseArgsForCall, struct{}{})
fake.recordInvocation("Release", []interface{}{})
fake.releaseMutex.Unlock()
if fake.ReleaseStub != nil {
fake.ReleaseStub()
}
}
func (fake *FakeStep) ReleaseCallCount() int {
fake.releaseMutex.RLock()
defer fake.releaseMutex.RUnlock()
return len(fake.releaseArgsForCall)
}
func (fake *FakeStep) Result(arg1 interface{}) bool {
fake.resultMutex.Lock()
fake.resultArgsForCall = append(fake.resultArgsForCall, struct {
arg1 interface{}
}{arg1})
fake.recordInvocation("Result", []interface{}{arg1})
fake.resultMutex.Unlock()
if fake.ResultStub != nil {
return fake.ResultStub(arg1)
} else {
return fake.resultReturns.result1
}
}
func (fake *FakeStep) ResultCallCount() int {
fake.resultMutex.RLock()
defer fake.resultMutex.RUnlock()
return len(fake.resultArgsForCall)
}
func (fake *FakeStep) ResultArgsForCall(i int) interface{} {
fake.resultMutex.RLock()
defer fake.resultMutex.RUnlock()
return fake.resultArgsForCall[i].arg1
}
func (fake *FakeStep) ResultReturns(result1 bool) {
fake.ResultStub = nil
fake.resultReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeStep) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.runMutex.RLock()
defer fake.runMutex.RUnlock()
fake.releaseMutex.RLock()
defer fake.releaseMutex.RUnlock()
fake.resultMutex.RLock()
defer fake.resultMutex.RUnlock()
return fake.invocations
}
func (fake *FakeStep) 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 _ exec.Step = new(FakeStep)