forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fake_input_source.go
190 lines (172 loc) · 5.15 KB
/
fake_input_source.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
// Code generated by counterfeiter. DO NOT EDIT.
package workerfakes
import (
"sync"
"github.com/concourse/atc/worker"
)
type FakeInputSource struct {
NameStub func() worker.ArtifactName
nameMutex sync.RWMutex
nameArgsForCall []struct{}
nameReturns struct {
result1 worker.ArtifactName
}
nameReturnsOnCall map[int]struct {
result1 worker.ArtifactName
}
SourceStub func() worker.ArtifactSource
sourceMutex sync.RWMutex
sourceArgsForCall []struct{}
sourceReturns struct {
result1 worker.ArtifactSource
}
sourceReturnsOnCall map[int]struct {
result1 worker.ArtifactSource
}
DestinationPathStub func() string
destinationPathMutex sync.RWMutex
destinationPathArgsForCall []struct{}
destinationPathReturns struct {
result1 string
}
destinationPathReturnsOnCall map[int]struct {
result1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeInputSource) Name() worker.ArtifactName {
fake.nameMutex.Lock()
ret, specificReturn := fake.nameReturnsOnCall[len(fake.nameArgsForCall)]
fake.nameArgsForCall = append(fake.nameArgsForCall, struct{}{})
fake.recordInvocation("Name", []interface{}{})
fake.nameMutex.Unlock()
if fake.NameStub != nil {
return fake.NameStub()
}
if specificReturn {
return ret.result1
}
return fake.nameReturns.result1
}
func (fake *FakeInputSource) NameCallCount() int {
fake.nameMutex.RLock()
defer fake.nameMutex.RUnlock()
return len(fake.nameArgsForCall)
}
func (fake *FakeInputSource) NameReturns(result1 worker.ArtifactName) {
fake.NameStub = nil
fake.nameReturns = struct {
result1 worker.ArtifactName
}{result1}
}
func (fake *FakeInputSource) NameReturnsOnCall(i int, result1 worker.ArtifactName) {
fake.NameStub = nil
if fake.nameReturnsOnCall == nil {
fake.nameReturnsOnCall = make(map[int]struct {
result1 worker.ArtifactName
})
}
fake.nameReturnsOnCall[i] = struct {
result1 worker.ArtifactName
}{result1}
}
func (fake *FakeInputSource) Source() worker.ArtifactSource {
fake.sourceMutex.Lock()
ret, specificReturn := fake.sourceReturnsOnCall[len(fake.sourceArgsForCall)]
fake.sourceArgsForCall = append(fake.sourceArgsForCall, struct{}{})
fake.recordInvocation("Source", []interface{}{})
fake.sourceMutex.Unlock()
if fake.SourceStub != nil {
return fake.SourceStub()
}
if specificReturn {
return ret.result1
}
return fake.sourceReturns.result1
}
func (fake *FakeInputSource) SourceCallCount() int {
fake.sourceMutex.RLock()
defer fake.sourceMutex.RUnlock()
return len(fake.sourceArgsForCall)
}
func (fake *FakeInputSource) SourceReturns(result1 worker.ArtifactSource) {
fake.SourceStub = nil
fake.sourceReturns = struct {
result1 worker.ArtifactSource
}{result1}
}
func (fake *FakeInputSource) SourceReturnsOnCall(i int, result1 worker.ArtifactSource) {
fake.SourceStub = nil
if fake.sourceReturnsOnCall == nil {
fake.sourceReturnsOnCall = make(map[int]struct {
result1 worker.ArtifactSource
})
}
fake.sourceReturnsOnCall[i] = struct {
result1 worker.ArtifactSource
}{result1}
}
func (fake *FakeInputSource) DestinationPath() string {
fake.destinationPathMutex.Lock()
ret, specificReturn := fake.destinationPathReturnsOnCall[len(fake.destinationPathArgsForCall)]
fake.destinationPathArgsForCall = append(fake.destinationPathArgsForCall, struct{}{})
fake.recordInvocation("DestinationPath", []interface{}{})
fake.destinationPathMutex.Unlock()
if fake.DestinationPathStub != nil {
return fake.DestinationPathStub()
}
if specificReturn {
return ret.result1
}
return fake.destinationPathReturns.result1
}
func (fake *FakeInputSource) DestinationPathCallCount() int {
fake.destinationPathMutex.RLock()
defer fake.destinationPathMutex.RUnlock()
return len(fake.destinationPathArgsForCall)
}
func (fake *FakeInputSource) DestinationPathReturns(result1 string) {
fake.DestinationPathStub = nil
fake.destinationPathReturns = struct {
result1 string
}{result1}
}
func (fake *FakeInputSource) DestinationPathReturnsOnCall(i int, result1 string) {
fake.DestinationPathStub = nil
if fake.destinationPathReturnsOnCall == nil {
fake.destinationPathReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.destinationPathReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeInputSource) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.nameMutex.RLock()
defer fake.nameMutex.RUnlock()
fake.sourceMutex.RLock()
defer fake.sourceMutex.RUnlock()
fake.destinationPathMutex.RLock()
defer fake.destinationPathMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeInputSource) 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 _ worker.InputSource = new(FakeInputSource)