github.com/cloudfoundry-attic/ltc@v0.0.0-20151123212628-098adc7919fc/ssh/mocks/fake_session.go (about) 1 // This file was generated by counterfeiter 2 package mocks 3 4 import ( 5 "sync" 6 7 "github.com/cloudfoundry-incubator/ltc/ssh" 8 ) 9 10 type FakeSession struct { 11 KeepAliveStub func() (stopChan chan<- struct{}) 12 keepAliveMutex sync.RWMutex 13 keepAliveArgsForCall []struct{} 14 keepAliveReturns struct { 15 result1 chan<- struct{} 16 } 17 ResizeStub func(width, height int) error 18 resizeMutex sync.RWMutex 19 resizeArgsForCall []struct { 20 width int 21 height int 22 } 23 resizeReturns struct { 24 result1 error 25 } 26 ShellStub func() error 27 shellMutex sync.RWMutex 28 shellArgsForCall []struct{} 29 shellReturns struct { 30 result1 error 31 } 32 RunStub func(string) error 33 runMutex sync.RWMutex 34 runArgsForCall []struct { 35 arg1 string 36 } 37 runReturns struct { 38 result1 error 39 } 40 WaitStub func() error 41 waitMutex sync.RWMutex 42 waitArgsForCall []struct{} 43 waitReturns struct { 44 result1 error 45 } 46 CloseStub func() error 47 closeMutex sync.RWMutex 48 closeArgsForCall []struct{} 49 closeReturns struct { 50 result1 error 51 } 52 } 53 54 func (fake *FakeSession) KeepAlive() (stopChan chan<- struct{}) { 55 fake.keepAliveMutex.Lock() 56 fake.keepAliveArgsForCall = append(fake.keepAliveArgsForCall, struct{}{}) 57 fake.keepAliveMutex.Unlock() 58 if fake.KeepAliveStub != nil { 59 return fake.KeepAliveStub() 60 } else { 61 return fake.keepAliveReturns.result1 62 } 63 } 64 65 func (fake *FakeSession) KeepAliveCallCount() int { 66 fake.keepAliveMutex.RLock() 67 defer fake.keepAliveMutex.RUnlock() 68 return len(fake.keepAliveArgsForCall) 69 } 70 71 func (fake *FakeSession) KeepAliveReturns(result1 chan<- struct{}) { 72 fake.KeepAliveStub = nil 73 fake.keepAliveReturns = struct { 74 result1 chan<- struct{} 75 }{result1} 76 } 77 78 func (fake *FakeSession) Resize(width int, height int) error { 79 fake.resizeMutex.Lock() 80 fake.resizeArgsForCall = append(fake.resizeArgsForCall, struct { 81 width int 82 height int 83 }{width, height}) 84 fake.resizeMutex.Unlock() 85 if fake.ResizeStub != nil { 86 return fake.ResizeStub(width, height) 87 } else { 88 return fake.resizeReturns.result1 89 } 90 } 91 92 func (fake *FakeSession) ResizeCallCount() int { 93 fake.resizeMutex.RLock() 94 defer fake.resizeMutex.RUnlock() 95 return len(fake.resizeArgsForCall) 96 } 97 98 func (fake *FakeSession) ResizeArgsForCall(i int) (int, int) { 99 fake.resizeMutex.RLock() 100 defer fake.resizeMutex.RUnlock() 101 return fake.resizeArgsForCall[i].width, fake.resizeArgsForCall[i].height 102 } 103 104 func (fake *FakeSession) ResizeReturns(result1 error) { 105 fake.ResizeStub = nil 106 fake.resizeReturns = struct { 107 result1 error 108 }{result1} 109 } 110 111 func (fake *FakeSession) Shell() error { 112 fake.shellMutex.Lock() 113 fake.shellArgsForCall = append(fake.shellArgsForCall, struct{}{}) 114 fake.shellMutex.Unlock() 115 if fake.ShellStub != nil { 116 return fake.ShellStub() 117 } else { 118 return fake.shellReturns.result1 119 } 120 } 121 122 func (fake *FakeSession) ShellCallCount() int { 123 fake.shellMutex.RLock() 124 defer fake.shellMutex.RUnlock() 125 return len(fake.shellArgsForCall) 126 } 127 128 func (fake *FakeSession) ShellReturns(result1 error) { 129 fake.ShellStub = nil 130 fake.shellReturns = struct { 131 result1 error 132 }{result1} 133 } 134 135 func (fake *FakeSession) Run(arg1 string) error { 136 fake.runMutex.Lock() 137 fake.runArgsForCall = append(fake.runArgsForCall, struct { 138 arg1 string 139 }{arg1}) 140 fake.runMutex.Unlock() 141 if fake.RunStub != nil { 142 return fake.RunStub(arg1) 143 } else { 144 return fake.runReturns.result1 145 } 146 } 147 148 func (fake *FakeSession) RunCallCount() int { 149 fake.runMutex.RLock() 150 defer fake.runMutex.RUnlock() 151 return len(fake.runArgsForCall) 152 } 153 154 func (fake *FakeSession) RunArgsForCall(i int) string { 155 fake.runMutex.RLock() 156 defer fake.runMutex.RUnlock() 157 return fake.runArgsForCall[i].arg1 158 } 159 160 func (fake *FakeSession) RunReturns(result1 error) { 161 fake.RunStub = nil 162 fake.runReturns = struct { 163 result1 error 164 }{result1} 165 } 166 167 func (fake *FakeSession) Wait() error { 168 fake.waitMutex.Lock() 169 fake.waitArgsForCall = append(fake.waitArgsForCall, struct{}{}) 170 fake.waitMutex.Unlock() 171 if fake.WaitStub != nil { 172 return fake.WaitStub() 173 } else { 174 return fake.waitReturns.result1 175 } 176 } 177 178 func (fake *FakeSession) WaitCallCount() int { 179 fake.waitMutex.RLock() 180 defer fake.waitMutex.RUnlock() 181 return len(fake.waitArgsForCall) 182 } 183 184 func (fake *FakeSession) WaitReturns(result1 error) { 185 fake.WaitStub = nil 186 fake.waitReturns = struct { 187 result1 error 188 }{result1} 189 } 190 191 func (fake *FakeSession) Close() error { 192 fake.closeMutex.Lock() 193 fake.closeArgsForCall = append(fake.closeArgsForCall, struct{}{}) 194 fake.closeMutex.Unlock() 195 if fake.CloseStub != nil { 196 return fake.CloseStub() 197 } else { 198 return fake.closeReturns.result1 199 } 200 } 201 202 func (fake *FakeSession) CloseCallCount() int { 203 fake.closeMutex.RLock() 204 defer fake.closeMutex.RUnlock() 205 return len(fake.closeArgsForCall) 206 } 207 208 func (fake *FakeSession) CloseReturns(result1 error) { 209 fake.CloseStub = nil 210 fake.closeReturns = struct { 211 result1 error 212 }{result1} 213 } 214 215 var _ ssh.Session = new(FakeSession)