github.com/asifdxtreme/cli@v6.1.3-0.20150123051144-9ead8700b4ae+incompatible/cf/actors/fakes/fake_push_actor.go (about)

     1  // This file was generated by counterfeiter
     2  package fakes
     3  
     4  import (
     5  	. "github.com/cloudfoundry/cli/cf/actors"
     6  	"github.com/cloudfoundry/cli/cf/api/resources"
     7  
     8  	"os"
     9  	"sync"
    10  )
    11  
    12  type FakePushActor struct {
    13  	UploadAppStub        func(appGuid string, zipFile *os.File, presentFiles []resources.AppFileResource) error
    14  	uploadAppMutex       sync.RWMutex
    15  	uploadAppArgsForCall []struct {
    16  		appGuid      string
    17  		zipFile      *os.File
    18  		presentFiles []resources.AppFileResource
    19  	}
    20  	uploadAppReturns struct {
    21  		result1 error
    22  	}
    23  	GatherFilesStub        func(appDir string, uploadDir string) ([]resources.AppFileResource, error)
    24  	gatherFilesMutex       sync.RWMutex
    25  	gatherFilesArgsForCall []struct {
    26  		appDir    string
    27  		uploadDir string
    28  	}
    29  	gatherFilesReturns struct {
    30  		result1 []resources.AppFileResource
    31  		result2 error
    32  	}
    33  }
    34  
    35  func (fake *FakePushActor) UploadApp(appGuid string, zipFile *os.File, presentFiles []resources.AppFileResource) error {
    36  	fake.uploadAppMutex.Lock()
    37  	defer fake.uploadAppMutex.Unlock()
    38  	fake.uploadAppArgsForCall = append(fake.uploadAppArgsForCall, struct {
    39  		appGuid      string
    40  		zipFile      *os.File
    41  		presentFiles []resources.AppFileResource
    42  	}{appGuid, zipFile, presentFiles})
    43  	if fake.UploadAppStub != nil {
    44  		return fake.UploadAppStub(appGuid, zipFile, presentFiles)
    45  	} else {
    46  		return fake.uploadAppReturns.result1
    47  	}
    48  }
    49  
    50  func (fake *FakePushActor) UploadAppCallCount() int {
    51  	fake.uploadAppMutex.RLock()
    52  	defer fake.uploadAppMutex.RUnlock()
    53  	return len(fake.uploadAppArgsForCall)
    54  }
    55  
    56  func (fake *FakePushActor) UploadAppArgsForCall(i int) (string, *os.File, []resources.AppFileResource) {
    57  	fake.uploadAppMutex.RLock()
    58  	defer fake.uploadAppMutex.RUnlock()
    59  	return fake.uploadAppArgsForCall[i].appGuid, fake.uploadAppArgsForCall[i].zipFile, fake.uploadAppArgsForCall[i].presentFiles
    60  }
    61  
    62  func (fake *FakePushActor) UploadAppReturns(result1 error) {
    63  	fake.uploadAppReturns = struct {
    64  		result1 error
    65  	}{result1}
    66  }
    67  
    68  func (fake *FakePushActor) GatherFiles(appDir string, uploadDir string) ([]resources.AppFileResource, error) {
    69  	fake.gatherFilesMutex.Lock()
    70  	defer fake.gatherFilesMutex.Unlock()
    71  	fake.gatherFilesArgsForCall = append(fake.gatherFilesArgsForCall, struct {
    72  		appDir    string
    73  		uploadDir string
    74  	}{appDir, uploadDir})
    75  	if fake.GatherFilesStub != nil {
    76  		return fake.GatherFilesStub(appDir, uploadDir)
    77  	} else {
    78  		return fake.gatherFilesReturns.result1, fake.gatherFilesReturns.result2
    79  	}
    80  }
    81  
    82  func (fake *FakePushActor) GatherFilesCallCount() int {
    83  	fake.gatherFilesMutex.RLock()
    84  	defer fake.gatherFilesMutex.RUnlock()
    85  	return len(fake.gatherFilesArgsForCall)
    86  }
    87  
    88  func (fake *FakePushActor) GatherFilesArgsForCall(i int) (string, string) {
    89  	fake.gatherFilesMutex.RLock()
    90  	defer fake.gatherFilesMutex.RUnlock()
    91  	return fake.gatherFilesArgsForCall[i].appDir, fake.gatherFilesArgsForCall[i].uploadDir
    92  }
    93  
    94  func (fake *FakePushActor) GatherFilesReturns(result1 []resources.AppFileResource, result2 error) {
    95  	fake.gatherFilesReturns = struct {
    96  		result1 []resources.AppFileResource
    97  		result2 error
    98  	}{result1, result2}
    99  }
   100  
   101  var _ PushActor = new(FakePushActor)