forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_factory.go
312 lines (290 loc) · 12.6 KB
/
fake_factory.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
// This file was generated by counterfeiter
package execfakes
import (
"sync"
"time"
"code.cloudfoundry.org/clock"
"code.cloudfoundry.org/lager"
"github.com/concourse/atc"
"github.com/concourse/atc/exec"
"github.com/concourse/atc/worker"
)
type FakeFactory struct {
GetStub func(lager.Logger, exec.StepMetadata, exec.SourceName, worker.Identifier, worker.Metadata, exec.GetDelegate, atc.ResourceConfig, atc.Tags, int, atc.Params, atc.Version, atc.ResourceTypes, time.Duration, time.Duration) exec.StepFactory
getMutex sync.RWMutex
getArgsForCall []struct {
arg1 lager.Logger
arg2 exec.StepMetadata
arg3 exec.SourceName
arg4 worker.Identifier
arg5 worker.Metadata
arg6 exec.GetDelegate
arg7 atc.ResourceConfig
arg8 atc.Tags
arg9 int
arg10 atc.Params
arg11 atc.Version
arg12 atc.ResourceTypes
arg13 time.Duration
arg14 time.Duration
}
getReturns struct {
result1 exec.StepFactory
}
PutStub func(lager.Logger, exec.StepMetadata, worker.Identifier, worker.Metadata, exec.PutDelegate, atc.ResourceConfig, atc.Tags, int, atc.Params, atc.ResourceTypes, time.Duration, time.Duration) exec.StepFactory
putMutex sync.RWMutex
putArgsForCall []struct {
arg1 lager.Logger
arg2 exec.StepMetadata
arg3 worker.Identifier
arg4 worker.Metadata
arg5 exec.PutDelegate
arg6 atc.ResourceConfig
arg7 atc.Tags
arg8 int
arg9 atc.Params
arg10 atc.ResourceTypes
arg11 time.Duration
arg12 time.Duration
}
putReturns struct {
result1 exec.StepFactory
}
DependentGetStub func(lager.Logger, exec.StepMetadata, exec.SourceName, worker.Identifier, worker.Metadata, exec.GetDelegate, atc.ResourceConfig, atc.Tags, int, atc.Params, atc.ResourceTypes, time.Duration, time.Duration) exec.StepFactory
dependentGetMutex sync.RWMutex
dependentGetArgsForCall []struct {
arg1 lager.Logger
arg2 exec.StepMetadata
arg3 exec.SourceName
arg4 worker.Identifier
arg5 worker.Metadata
arg6 exec.GetDelegate
arg7 atc.ResourceConfig
arg8 atc.Tags
arg9 int
arg10 atc.Params
arg11 atc.ResourceTypes
arg12 time.Duration
arg13 time.Duration
}
dependentGetReturns struct {
result1 exec.StepFactory
}
TaskStub func(lager.Logger, exec.SourceName, worker.Identifier, worker.Metadata, exec.TaskDelegate, exec.Privileged, atc.Tags, int, exec.TaskConfigSource, atc.ResourceTypes, map[string]string, map[string]string, string, clock.Clock, time.Duration, time.Duration) exec.StepFactory
taskMutex sync.RWMutex
taskArgsForCall []struct {
arg1 lager.Logger
arg2 exec.SourceName
arg3 worker.Identifier
arg4 worker.Metadata
arg5 exec.TaskDelegate
arg6 exec.Privileged
arg7 atc.Tags
arg8 int
arg9 exec.TaskConfigSource
arg10 atc.ResourceTypes
arg11 map[string]string
arg12 map[string]string
arg13 string
arg14 clock.Clock
arg15 time.Duration
arg16 time.Duration
}
taskReturns struct {
result1 exec.StepFactory
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeFactory) Get(arg1 lager.Logger, arg2 exec.StepMetadata, arg3 exec.SourceName, arg4 worker.Identifier, arg5 worker.Metadata, arg6 exec.GetDelegate, arg7 atc.ResourceConfig, arg8 atc.Tags, arg9 int, arg10 atc.Params, arg11 atc.Version, arg12 atc.ResourceTypes, arg13 time.Duration, arg14 time.Duration) exec.StepFactory {
fake.getMutex.Lock()
fake.getArgsForCall = append(fake.getArgsForCall, struct {
arg1 lager.Logger
arg2 exec.StepMetadata
arg3 exec.SourceName
arg4 worker.Identifier
arg5 worker.Metadata
arg6 exec.GetDelegate
arg7 atc.ResourceConfig
arg8 atc.Tags
arg9 int
arg10 atc.Params
arg11 atc.Version
arg12 atc.ResourceTypes
arg13 time.Duration
arg14 time.Duration
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14})
fake.recordInvocation("Get", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14})
fake.getMutex.Unlock()
if fake.GetStub != nil {
return fake.GetStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14)
} else {
return fake.getReturns.result1
}
}
func (fake *FakeFactory) GetCallCount() int {
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
return len(fake.getArgsForCall)
}
func (fake *FakeFactory) GetArgsForCall(i int) (lager.Logger, exec.StepMetadata, exec.SourceName, worker.Identifier, worker.Metadata, exec.GetDelegate, atc.ResourceConfig, atc.Tags, int, atc.Params, atc.Version, atc.ResourceTypes, time.Duration, time.Duration) {
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
return fake.getArgsForCall[i].arg1, fake.getArgsForCall[i].arg2, fake.getArgsForCall[i].arg3, fake.getArgsForCall[i].arg4, fake.getArgsForCall[i].arg5, fake.getArgsForCall[i].arg6, fake.getArgsForCall[i].arg7, fake.getArgsForCall[i].arg8, fake.getArgsForCall[i].arg9, fake.getArgsForCall[i].arg10, fake.getArgsForCall[i].arg11, fake.getArgsForCall[i].arg12, fake.getArgsForCall[i].arg13, fake.getArgsForCall[i].arg14
}
func (fake *FakeFactory) GetReturns(result1 exec.StepFactory) {
fake.GetStub = nil
fake.getReturns = struct {
result1 exec.StepFactory
}{result1}
}
func (fake *FakeFactory) Put(arg1 lager.Logger, arg2 exec.StepMetadata, arg3 worker.Identifier, arg4 worker.Metadata, arg5 exec.PutDelegate, arg6 atc.ResourceConfig, arg7 atc.Tags, arg8 int, arg9 atc.Params, arg10 atc.ResourceTypes, arg11 time.Duration, arg12 time.Duration) exec.StepFactory {
fake.putMutex.Lock()
fake.putArgsForCall = append(fake.putArgsForCall, struct {
arg1 lager.Logger
arg2 exec.StepMetadata
arg3 worker.Identifier
arg4 worker.Metadata
arg5 exec.PutDelegate
arg6 atc.ResourceConfig
arg7 atc.Tags
arg8 int
arg9 atc.Params
arg10 atc.ResourceTypes
arg11 time.Duration
arg12 time.Duration
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12})
fake.recordInvocation("Put", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12})
fake.putMutex.Unlock()
if fake.PutStub != nil {
return fake.PutStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)
} else {
return fake.putReturns.result1
}
}
func (fake *FakeFactory) PutCallCount() int {
fake.putMutex.RLock()
defer fake.putMutex.RUnlock()
return len(fake.putArgsForCall)
}
func (fake *FakeFactory) PutArgsForCall(i int) (lager.Logger, exec.StepMetadata, worker.Identifier, worker.Metadata, exec.PutDelegate, atc.ResourceConfig, atc.Tags, int, atc.Params, atc.ResourceTypes, time.Duration, time.Duration) {
fake.putMutex.RLock()
defer fake.putMutex.RUnlock()
return fake.putArgsForCall[i].arg1, fake.putArgsForCall[i].arg2, fake.putArgsForCall[i].arg3, fake.putArgsForCall[i].arg4, fake.putArgsForCall[i].arg5, fake.putArgsForCall[i].arg6, fake.putArgsForCall[i].arg7, fake.putArgsForCall[i].arg8, fake.putArgsForCall[i].arg9, fake.putArgsForCall[i].arg10, fake.putArgsForCall[i].arg11, fake.putArgsForCall[i].arg12
}
func (fake *FakeFactory) PutReturns(result1 exec.StepFactory) {
fake.PutStub = nil
fake.putReturns = struct {
result1 exec.StepFactory
}{result1}
}
func (fake *FakeFactory) DependentGet(arg1 lager.Logger, arg2 exec.StepMetadata, arg3 exec.SourceName, arg4 worker.Identifier, arg5 worker.Metadata, arg6 exec.GetDelegate, arg7 atc.ResourceConfig, arg8 atc.Tags, arg9 int, arg10 atc.Params, arg11 atc.ResourceTypes, arg12 time.Duration, arg13 time.Duration) exec.StepFactory {
fake.dependentGetMutex.Lock()
fake.dependentGetArgsForCall = append(fake.dependentGetArgsForCall, struct {
arg1 lager.Logger
arg2 exec.StepMetadata
arg3 exec.SourceName
arg4 worker.Identifier
arg5 worker.Metadata
arg6 exec.GetDelegate
arg7 atc.ResourceConfig
arg8 atc.Tags
arg9 int
arg10 atc.Params
arg11 atc.ResourceTypes
arg12 time.Duration
arg13 time.Duration
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13})
fake.recordInvocation("DependentGet", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13})
fake.dependentGetMutex.Unlock()
if fake.DependentGetStub != nil {
return fake.DependentGetStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13)
} else {
return fake.dependentGetReturns.result1
}
}
func (fake *FakeFactory) DependentGetCallCount() int {
fake.dependentGetMutex.RLock()
defer fake.dependentGetMutex.RUnlock()
return len(fake.dependentGetArgsForCall)
}
func (fake *FakeFactory) DependentGetArgsForCall(i int) (lager.Logger, exec.StepMetadata, exec.SourceName, worker.Identifier, worker.Metadata, exec.GetDelegate, atc.ResourceConfig, atc.Tags, int, atc.Params, atc.ResourceTypes, time.Duration, time.Duration) {
fake.dependentGetMutex.RLock()
defer fake.dependentGetMutex.RUnlock()
return fake.dependentGetArgsForCall[i].arg1, fake.dependentGetArgsForCall[i].arg2, fake.dependentGetArgsForCall[i].arg3, fake.dependentGetArgsForCall[i].arg4, fake.dependentGetArgsForCall[i].arg5, fake.dependentGetArgsForCall[i].arg6, fake.dependentGetArgsForCall[i].arg7, fake.dependentGetArgsForCall[i].arg8, fake.dependentGetArgsForCall[i].arg9, fake.dependentGetArgsForCall[i].arg10, fake.dependentGetArgsForCall[i].arg11, fake.dependentGetArgsForCall[i].arg12, fake.dependentGetArgsForCall[i].arg13
}
func (fake *FakeFactory) DependentGetReturns(result1 exec.StepFactory) {
fake.DependentGetStub = nil
fake.dependentGetReturns = struct {
result1 exec.StepFactory
}{result1}
}
func (fake *FakeFactory) Task(arg1 lager.Logger, arg2 exec.SourceName, arg3 worker.Identifier, arg4 worker.Metadata, arg5 exec.TaskDelegate, arg6 exec.Privileged, arg7 atc.Tags, arg8 int, arg9 exec.TaskConfigSource, arg10 atc.ResourceTypes, arg11 map[string]string, arg12 map[string]string, arg13 string, arg14 clock.Clock, arg15 time.Duration, arg16 time.Duration) exec.StepFactory {
fake.taskMutex.Lock()
fake.taskArgsForCall = append(fake.taskArgsForCall, struct {
arg1 lager.Logger
arg2 exec.SourceName
arg3 worker.Identifier
arg4 worker.Metadata
arg5 exec.TaskDelegate
arg6 exec.Privileged
arg7 atc.Tags
arg8 int
arg9 exec.TaskConfigSource
arg10 atc.ResourceTypes
arg11 map[string]string
arg12 map[string]string
arg13 string
arg14 clock.Clock
arg15 time.Duration
arg16 time.Duration
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16})
fake.recordInvocation("Task", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16})
fake.taskMutex.Unlock()
if fake.TaskStub != nil {
return fake.TaskStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16)
} else {
return fake.taskReturns.result1
}
}
func (fake *FakeFactory) TaskCallCount() int {
fake.taskMutex.RLock()
defer fake.taskMutex.RUnlock()
return len(fake.taskArgsForCall)
}
func (fake *FakeFactory) TaskArgsForCall(i int) (lager.Logger, exec.SourceName, worker.Identifier, worker.Metadata, exec.TaskDelegate, exec.Privileged, atc.Tags, int, exec.TaskConfigSource, atc.ResourceTypes, map[string]string, map[string]string, string, clock.Clock, time.Duration, time.Duration) {
fake.taskMutex.RLock()
defer fake.taskMutex.RUnlock()
return fake.taskArgsForCall[i].arg1, fake.taskArgsForCall[i].arg2, fake.taskArgsForCall[i].arg3, fake.taskArgsForCall[i].arg4, fake.taskArgsForCall[i].arg5, fake.taskArgsForCall[i].arg6, fake.taskArgsForCall[i].arg7, fake.taskArgsForCall[i].arg8, fake.taskArgsForCall[i].arg9, fake.taskArgsForCall[i].arg10, fake.taskArgsForCall[i].arg11, fake.taskArgsForCall[i].arg12, fake.taskArgsForCall[i].arg13, fake.taskArgsForCall[i].arg14, fake.taskArgsForCall[i].arg15, fake.taskArgsForCall[i].arg16
}
func (fake *FakeFactory) TaskReturns(result1 exec.StepFactory) {
fake.TaskStub = nil
fake.taskReturns = struct {
result1 exec.StepFactory
}{result1}
}
func (fake *FakeFactory) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
fake.putMutex.RLock()
defer fake.putMutex.RUnlock()
fake.dependentGetMutex.RLock()
defer fake.dependentGetMutex.RUnlock()
fake.taskMutex.RLock()
defer fake.taskMutex.RUnlock()
return fake.invocations
}
func (fake *FakeFactory) 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.Factory = new(FakeFactory)