forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_reporter.go
237 lines (213 loc) · 8.82 KB
/
fake_reporter.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
// This file was generated by counterfeiter
package indexfakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/releasedir/index"
)
type FakeReporter struct {
IndexEntryStartedAddingStub func(type_, desc string)
indexEntryStartedAddingMutex sync.RWMutex
indexEntryStartedAddingArgsForCall []struct {
type_ string
desc string
}
IndexEntryFinishedAddingStub func(type_, desc string, err error)
indexEntryFinishedAddingMutex sync.RWMutex
indexEntryFinishedAddingArgsForCall []struct {
type_ string
desc string
err error
}
IndexEntryDownloadStartedStub func(type_, desc string)
indexEntryDownloadStartedMutex sync.RWMutex
indexEntryDownloadStartedArgsForCall []struct {
type_ string
desc string
}
IndexEntryDownloadFinishedStub func(type_, desc string, err error)
indexEntryDownloadFinishedMutex sync.RWMutex
indexEntryDownloadFinishedArgsForCall []struct {
type_ string
desc string
err error
}
IndexEntryUploadStartedStub func(type_, desc string)
indexEntryUploadStartedMutex sync.RWMutex
indexEntryUploadStartedArgsForCall []struct {
type_ string
desc string
}
IndexEntryUploadFinishedStub func(type_, desc string, err error)
indexEntryUploadFinishedMutex sync.RWMutex
indexEntryUploadFinishedArgsForCall []struct {
type_ string
desc string
err error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeReporter) IndexEntryStartedAdding(type_ string, desc string) {
fake.indexEntryStartedAddingMutex.Lock()
fake.indexEntryStartedAddingArgsForCall = append(fake.indexEntryStartedAddingArgsForCall, struct {
type_ string
desc string
}{type_, desc})
fake.recordInvocation("IndexEntryStartedAdding", []interface{}{type_, desc})
fake.indexEntryStartedAddingMutex.Unlock()
if fake.IndexEntryStartedAddingStub != nil {
fake.IndexEntryStartedAddingStub(type_, desc)
}
}
func (fake *FakeReporter) IndexEntryStartedAddingCallCount() int {
fake.indexEntryStartedAddingMutex.RLock()
defer fake.indexEntryStartedAddingMutex.RUnlock()
return len(fake.indexEntryStartedAddingArgsForCall)
}
func (fake *FakeReporter) IndexEntryStartedAddingArgsForCall(i int) (string, string) {
fake.indexEntryStartedAddingMutex.RLock()
defer fake.indexEntryStartedAddingMutex.RUnlock()
return fake.indexEntryStartedAddingArgsForCall[i].type_, fake.indexEntryStartedAddingArgsForCall[i].desc
}
func (fake *FakeReporter) IndexEntryFinishedAdding(type_ string, desc string, err error) {
fake.indexEntryFinishedAddingMutex.Lock()
fake.indexEntryFinishedAddingArgsForCall = append(fake.indexEntryFinishedAddingArgsForCall, struct {
type_ string
desc string
err error
}{type_, desc, err})
fake.recordInvocation("IndexEntryFinishedAdding", []interface{}{type_, desc, err})
fake.indexEntryFinishedAddingMutex.Unlock()
if fake.IndexEntryFinishedAddingStub != nil {
fake.IndexEntryFinishedAddingStub(type_, desc, err)
}
}
func (fake *FakeReporter) IndexEntryFinishedAddingCallCount() int {
fake.indexEntryFinishedAddingMutex.RLock()
defer fake.indexEntryFinishedAddingMutex.RUnlock()
return len(fake.indexEntryFinishedAddingArgsForCall)
}
func (fake *FakeReporter) IndexEntryFinishedAddingArgsForCall(i int) (string, string, error) {
fake.indexEntryFinishedAddingMutex.RLock()
defer fake.indexEntryFinishedAddingMutex.RUnlock()
return fake.indexEntryFinishedAddingArgsForCall[i].type_, fake.indexEntryFinishedAddingArgsForCall[i].desc, fake.indexEntryFinishedAddingArgsForCall[i].err
}
func (fake *FakeReporter) IndexEntryDownloadStarted(type_ string, desc string) {
fake.indexEntryDownloadStartedMutex.Lock()
fake.indexEntryDownloadStartedArgsForCall = append(fake.indexEntryDownloadStartedArgsForCall, struct {
type_ string
desc string
}{type_, desc})
fake.recordInvocation("IndexEntryDownloadStarted", []interface{}{type_, desc})
fake.indexEntryDownloadStartedMutex.Unlock()
if fake.IndexEntryDownloadStartedStub != nil {
fake.IndexEntryDownloadStartedStub(type_, desc)
}
}
func (fake *FakeReporter) IndexEntryDownloadStartedCallCount() int {
fake.indexEntryDownloadStartedMutex.RLock()
defer fake.indexEntryDownloadStartedMutex.RUnlock()
return len(fake.indexEntryDownloadStartedArgsForCall)
}
func (fake *FakeReporter) IndexEntryDownloadStartedArgsForCall(i int) (string, string) {
fake.indexEntryDownloadStartedMutex.RLock()
defer fake.indexEntryDownloadStartedMutex.RUnlock()
return fake.indexEntryDownloadStartedArgsForCall[i].type_, fake.indexEntryDownloadStartedArgsForCall[i].desc
}
func (fake *FakeReporter) IndexEntryDownloadFinished(type_ string, desc string, err error) {
fake.indexEntryDownloadFinishedMutex.Lock()
fake.indexEntryDownloadFinishedArgsForCall = append(fake.indexEntryDownloadFinishedArgsForCall, struct {
type_ string
desc string
err error
}{type_, desc, err})
fake.recordInvocation("IndexEntryDownloadFinished", []interface{}{type_, desc, err})
fake.indexEntryDownloadFinishedMutex.Unlock()
if fake.IndexEntryDownloadFinishedStub != nil {
fake.IndexEntryDownloadFinishedStub(type_, desc, err)
}
}
func (fake *FakeReporter) IndexEntryDownloadFinishedCallCount() int {
fake.indexEntryDownloadFinishedMutex.RLock()
defer fake.indexEntryDownloadFinishedMutex.RUnlock()
return len(fake.indexEntryDownloadFinishedArgsForCall)
}
func (fake *FakeReporter) IndexEntryDownloadFinishedArgsForCall(i int) (string, string, error) {
fake.indexEntryDownloadFinishedMutex.RLock()
defer fake.indexEntryDownloadFinishedMutex.RUnlock()
return fake.indexEntryDownloadFinishedArgsForCall[i].type_, fake.indexEntryDownloadFinishedArgsForCall[i].desc, fake.indexEntryDownloadFinishedArgsForCall[i].err
}
func (fake *FakeReporter) IndexEntryUploadStarted(type_ string, desc string) {
fake.indexEntryUploadStartedMutex.Lock()
fake.indexEntryUploadStartedArgsForCall = append(fake.indexEntryUploadStartedArgsForCall, struct {
type_ string
desc string
}{type_, desc})
fake.recordInvocation("IndexEntryUploadStarted", []interface{}{type_, desc})
fake.indexEntryUploadStartedMutex.Unlock()
if fake.IndexEntryUploadStartedStub != nil {
fake.IndexEntryUploadStartedStub(type_, desc)
}
}
func (fake *FakeReporter) IndexEntryUploadStartedCallCount() int {
fake.indexEntryUploadStartedMutex.RLock()
defer fake.indexEntryUploadStartedMutex.RUnlock()
return len(fake.indexEntryUploadStartedArgsForCall)
}
func (fake *FakeReporter) IndexEntryUploadStartedArgsForCall(i int) (string, string) {
fake.indexEntryUploadStartedMutex.RLock()
defer fake.indexEntryUploadStartedMutex.RUnlock()
return fake.indexEntryUploadStartedArgsForCall[i].type_, fake.indexEntryUploadStartedArgsForCall[i].desc
}
func (fake *FakeReporter) IndexEntryUploadFinished(type_ string, desc string, err error) {
fake.indexEntryUploadFinishedMutex.Lock()
fake.indexEntryUploadFinishedArgsForCall = append(fake.indexEntryUploadFinishedArgsForCall, struct {
type_ string
desc string
err error
}{type_, desc, err})
fake.recordInvocation("IndexEntryUploadFinished", []interface{}{type_, desc, err})
fake.indexEntryUploadFinishedMutex.Unlock()
if fake.IndexEntryUploadFinishedStub != nil {
fake.IndexEntryUploadFinishedStub(type_, desc, err)
}
}
func (fake *FakeReporter) IndexEntryUploadFinishedCallCount() int {
fake.indexEntryUploadFinishedMutex.RLock()
defer fake.indexEntryUploadFinishedMutex.RUnlock()
return len(fake.indexEntryUploadFinishedArgsForCall)
}
func (fake *FakeReporter) IndexEntryUploadFinishedArgsForCall(i int) (string, string, error) {
fake.indexEntryUploadFinishedMutex.RLock()
defer fake.indexEntryUploadFinishedMutex.RUnlock()
return fake.indexEntryUploadFinishedArgsForCall[i].type_, fake.indexEntryUploadFinishedArgsForCall[i].desc, fake.indexEntryUploadFinishedArgsForCall[i].err
}
func (fake *FakeReporter) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.indexEntryStartedAddingMutex.RLock()
defer fake.indexEntryStartedAddingMutex.RUnlock()
fake.indexEntryFinishedAddingMutex.RLock()
defer fake.indexEntryFinishedAddingMutex.RUnlock()
fake.indexEntryDownloadStartedMutex.RLock()
defer fake.indexEntryDownloadStartedMutex.RUnlock()
fake.indexEntryDownloadFinishedMutex.RLock()
defer fake.indexEntryDownloadFinishedMutex.RUnlock()
fake.indexEntryUploadStartedMutex.RLock()
defer fake.indexEntryUploadStartedMutex.RUnlock()
fake.indexEntryUploadFinishedMutex.RLock()
defer fake.indexEntryUploadFinishedMutex.RUnlock()
return fake.invocations
}
func (fake *FakeReporter) 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 _ index.Reporter = new(FakeReporter)