github.com/cloudfoundry-attic/ltc@v0.0.0-20151123212628-098adc7919fc/app_runner/fake_app_runner/fake_app_runner.go (about) 1 // This file was generated by counterfeiter 2 package fake_app_runner 3 4 import ( 5 "sync" 6 7 "github.com/cloudfoundry-incubator/ltc/app_runner" 8 ) 9 10 type FakeAppRunner struct { 11 CreateAppStub func(params app_runner.CreateAppParams) error 12 createAppMutex sync.RWMutex 13 createAppArgsForCall []struct { 14 params app_runner.CreateAppParams 15 } 16 createAppReturns struct { 17 result1 error 18 } 19 SubmitLrpStub func(lrpJSON []byte) (string, error) 20 submitLrpMutex sync.RWMutex 21 submitLrpArgsForCall []struct { 22 lrpJSON []byte 23 } 24 submitLrpReturns struct { 25 result1 string 26 result2 error 27 } 28 ScaleAppStub func(name string, instances int) error 29 scaleAppMutex sync.RWMutex 30 scaleAppArgsForCall []struct { 31 name string 32 instances int 33 } 34 scaleAppReturns struct { 35 result1 error 36 } 37 UpdateAppRoutesStub func(name string, routes app_runner.RouteOverrides) error 38 updateAppRoutesMutex sync.RWMutex 39 updateAppRoutesArgsForCall []struct { 40 name string 41 routes app_runner.RouteOverrides 42 } 43 updateAppRoutesReturns struct { 44 result1 error 45 } 46 UpdateAppStub func(updateAppParams app_runner.UpdateAppParams) error 47 updateAppMutex sync.RWMutex 48 updateAppArgsForCall []struct { 49 updateAppParams app_runner.UpdateAppParams 50 } 51 updateAppReturns struct { 52 result1 error 53 } 54 RemoveAppStub func(name string) error 55 removeAppMutex sync.RWMutex 56 removeAppArgsForCall []struct { 57 name string 58 } 59 removeAppReturns struct { 60 result1 error 61 } 62 } 63 64 func (fake *FakeAppRunner) CreateApp(params app_runner.CreateAppParams) error { 65 fake.createAppMutex.Lock() 66 fake.createAppArgsForCall = append(fake.createAppArgsForCall, struct { 67 params app_runner.CreateAppParams 68 }{params}) 69 fake.createAppMutex.Unlock() 70 if fake.CreateAppStub != nil { 71 return fake.CreateAppStub(params) 72 } else { 73 return fake.createAppReturns.result1 74 } 75 } 76 77 func (fake *FakeAppRunner) CreateAppCallCount() int { 78 fake.createAppMutex.RLock() 79 defer fake.createAppMutex.RUnlock() 80 return len(fake.createAppArgsForCall) 81 } 82 83 func (fake *FakeAppRunner) CreateAppArgsForCall(i int) app_runner.CreateAppParams { 84 fake.createAppMutex.RLock() 85 defer fake.createAppMutex.RUnlock() 86 return fake.createAppArgsForCall[i].params 87 } 88 89 func (fake *FakeAppRunner) CreateAppReturns(result1 error) { 90 fake.CreateAppStub = nil 91 fake.createAppReturns = struct { 92 result1 error 93 }{result1} 94 } 95 96 func (fake *FakeAppRunner) SubmitLrp(lrpJSON []byte) (string, error) { 97 fake.submitLrpMutex.Lock() 98 fake.submitLrpArgsForCall = append(fake.submitLrpArgsForCall, struct { 99 lrpJSON []byte 100 }{lrpJSON}) 101 fake.submitLrpMutex.Unlock() 102 if fake.SubmitLrpStub != nil { 103 return fake.SubmitLrpStub(lrpJSON) 104 } else { 105 return fake.submitLrpReturns.result1, fake.submitLrpReturns.result2 106 } 107 } 108 109 func (fake *FakeAppRunner) SubmitLrpCallCount() int { 110 fake.submitLrpMutex.RLock() 111 defer fake.submitLrpMutex.RUnlock() 112 return len(fake.submitLrpArgsForCall) 113 } 114 115 func (fake *FakeAppRunner) SubmitLrpArgsForCall(i int) []byte { 116 fake.submitLrpMutex.RLock() 117 defer fake.submitLrpMutex.RUnlock() 118 return fake.submitLrpArgsForCall[i].lrpJSON 119 } 120 121 func (fake *FakeAppRunner) SubmitLrpReturns(result1 string, result2 error) { 122 fake.SubmitLrpStub = nil 123 fake.submitLrpReturns = struct { 124 result1 string 125 result2 error 126 }{result1, result2} 127 } 128 129 func (fake *FakeAppRunner) ScaleApp(name string, instances int) error { 130 fake.scaleAppMutex.Lock() 131 fake.scaleAppArgsForCall = append(fake.scaleAppArgsForCall, struct { 132 name string 133 instances int 134 }{name, instances}) 135 fake.scaleAppMutex.Unlock() 136 if fake.ScaleAppStub != nil { 137 return fake.ScaleAppStub(name, instances) 138 } else { 139 return fake.scaleAppReturns.result1 140 } 141 } 142 143 func (fake *FakeAppRunner) ScaleAppCallCount() int { 144 fake.scaleAppMutex.RLock() 145 defer fake.scaleAppMutex.RUnlock() 146 return len(fake.scaleAppArgsForCall) 147 } 148 149 func (fake *FakeAppRunner) ScaleAppArgsForCall(i int) (string, int) { 150 fake.scaleAppMutex.RLock() 151 defer fake.scaleAppMutex.RUnlock() 152 return fake.scaleAppArgsForCall[i].name, fake.scaleAppArgsForCall[i].instances 153 } 154 155 func (fake *FakeAppRunner) ScaleAppReturns(result1 error) { 156 fake.ScaleAppStub = nil 157 fake.scaleAppReturns = struct { 158 result1 error 159 }{result1} 160 } 161 162 func (fake *FakeAppRunner) UpdateAppRoutes(name string, routes app_runner.RouteOverrides) error { 163 fake.updateAppRoutesMutex.Lock() 164 fake.updateAppRoutesArgsForCall = append(fake.updateAppRoutesArgsForCall, struct { 165 name string 166 routes app_runner.RouteOverrides 167 }{name, routes}) 168 fake.updateAppRoutesMutex.Unlock() 169 if fake.UpdateAppRoutesStub != nil { 170 return fake.UpdateAppRoutesStub(name, routes) 171 } else { 172 return fake.updateAppRoutesReturns.result1 173 } 174 } 175 176 func (fake *FakeAppRunner) UpdateAppRoutesCallCount() int { 177 fake.updateAppRoutesMutex.RLock() 178 defer fake.updateAppRoutesMutex.RUnlock() 179 return len(fake.updateAppRoutesArgsForCall) 180 } 181 182 func (fake *FakeAppRunner) UpdateAppRoutesArgsForCall(i int) (string, app_runner.RouteOverrides) { 183 fake.updateAppRoutesMutex.RLock() 184 defer fake.updateAppRoutesMutex.RUnlock() 185 return fake.updateAppRoutesArgsForCall[i].name, fake.updateAppRoutesArgsForCall[i].routes 186 } 187 188 func (fake *FakeAppRunner) UpdateAppRoutesReturns(result1 error) { 189 fake.UpdateAppRoutesStub = nil 190 fake.updateAppRoutesReturns = struct { 191 result1 error 192 }{result1} 193 } 194 195 func (fake *FakeAppRunner) UpdateApp(updateAppParams app_runner.UpdateAppParams) error { 196 fake.updateAppMutex.Lock() 197 fake.updateAppArgsForCall = append(fake.updateAppArgsForCall, struct { 198 updateAppParams app_runner.UpdateAppParams 199 }{updateAppParams}) 200 fake.updateAppMutex.Unlock() 201 if fake.UpdateAppStub != nil { 202 return fake.UpdateAppStub(updateAppParams) 203 } else { 204 return fake.updateAppReturns.result1 205 } 206 } 207 208 func (fake *FakeAppRunner) UpdateAppCallCount() int { 209 fake.updateAppMutex.RLock() 210 defer fake.updateAppMutex.RUnlock() 211 return len(fake.updateAppArgsForCall) 212 } 213 214 func (fake *FakeAppRunner) UpdateAppArgsForCall(i int) app_runner.UpdateAppParams { 215 fake.updateAppMutex.RLock() 216 defer fake.updateAppMutex.RUnlock() 217 return fake.updateAppArgsForCall[i].updateAppParams 218 } 219 220 func (fake *FakeAppRunner) UpdateAppReturns(result1 error) { 221 fake.UpdateAppStub = nil 222 fake.updateAppReturns = struct { 223 result1 error 224 }{result1} 225 } 226 227 func (fake *FakeAppRunner) RemoveApp(name string) error { 228 fake.removeAppMutex.Lock() 229 fake.removeAppArgsForCall = append(fake.removeAppArgsForCall, struct { 230 name string 231 }{name}) 232 fake.removeAppMutex.Unlock() 233 if fake.RemoveAppStub != nil { 234 return fake.RemoveAppStub(name) 235 } else { 236 return fake.removeAppReturns.result1 237 } 238 } 239 240 func (fake *FakeAppRunner) RemoveAppCallCount() int { 241 fake.removeAppMutex.RLock() 242 defer fake.removeAppMutex.RUnlock() 243 return len(fake.removeAppArgsForCall) 244 } 245 246 func (fake *FakeAppRunner) RemoveAppArgsForCall(i int) string { 247 fake.removeAppMutex.RLock() 248 defer fake.removeAppMutex.RUnlock() 249 return fake.removeAppArgsForCall[i].name 250 } 251 252 func (fake *FakeAppRunner) RemoveAppReturns(result1 error) { 253 fake.RemoveAppStub = nil 254 fake.removeAppReturns = struct { 255 result1 error 256 }{result1} 257 } 258 259 var _ app_runner.AppRunner = new(FakeAppRunner)