github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/actor/pushaction/pushactionfakes/fake_shared_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package pushactionfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/pushaction"
     8  	"code.cloudfoundry.org/cli/actor/sharedaction"
     9  )
    10  
    11  type FakeSharedActor struct {
    12  	GatherArchiveResourcesStub        func(archivePath string) ([]sharedaction.Resource, error)
    13  	gatherArchiveResourcesMutex       sync.RWMutex
    14  	gatherArchiveResourcesArgsForCall []struct {
    15  		archivePath string
    16  	}
    17  	gatherArchiveResourcesReturns struct {
    18  		result1 []sharedaction.Resource
    19  		result2 error
    20  	}
    21  	gatherArchiveResourcesReturnsOnCall map[int]struct {
    22  		result1 []sharedaction.Resource
    23  		result2 error
    24  	}
    25  	GatherDirectoryResourcesStub        func(sourceDir string) ([]sharedaction.Resource, error)
    26  	gatherDirectoryResourcesMutex       sync.RWMutex
    27  	gatherDirectoryResourcesArgsForCall []struct {
    28  		sourceDir string
    29  	}
    30  	gatherDirectoryResourcesReturns struct {
    31  		result1 []sharedaction.Resource
    32  		result2 error
    33  	}
    34  	gatherDirectoryResourcesReturnsOnCall map[int]struct {
    35  		result1 []sharedaction.Resource
    36  		result2 error
    37  	}
    38  	ZipArchiveResourcesStub        func(sourceArchivePath string, filesToInclude []sharedaction.Resource) (string, error)
    39  	zipArchiveResourcesMutex       sync.RWMutex
    40  	zipArchiveResourcesArgsForCall []struct {
    41  		sourceArchivePath string
    42  		filesToInclude    []sharedaction.Resource
    43  	}
    44  	zipArchiveResourcesReturns struct {
    45  		result1 string
    46  		result2 error
    47  	}
    48  	zipArchiveResourcesReturnsOnCall map[int]struct {
    49  		result1 string
    50  		result2 error
    51  	}
    52  	ZipDirectoryResourcesStub        func(sourceDir string, filesToInclude []sharedaction.Resource) (string, error)
    53  	zipDirectoryResourcesMutex       sync.RWMutex
    54  	zipDirectoryResourcesArgsForCall []struct {
    55  		sourceDir      string
    56  		filesToInclude []sharedaction.Resource
    57  	}
    58  	zipDirectoryResourcesReturns struct {
    59  		result1 string
    60  		result2 error
    61  	}
    62  	zipDirectoryResourcesReturnsOnCall map[int]struct {
    63  		result1 string
    64  		result2 error
    65  	}
    66  	invocations      map[string][][]interface{}
    67  	invocationsMutex sync.RWMutex
    68  }
    69  
    70  func (fake *FakeSharedActor) GatherArchiveResources(archivePath string) ([]sharedaction.Resource, error) {
    71  	fake.gatherArchiveResourcesMutex.Lock()
    72  	ret, specificReturn := fake.gatherArchiveResourcesReturnsOnCall[len(fake.gatherArchiveResourcesArgsForCall)]
    73  	fake.gatherArchiveResourcesArgsForCall = append(fake.gatherArchiveResourcesArgsForCall, struct {
    74  		archivePath string
    75  	}{archivePath})
    76  	fake.recordInvocation("GatherArchiveResources", []interface{}{archivePath})
    77  	fake.gatherArchiveResourcesMutex.Unlock()
    78  	if fake.GatherArchiveResourcesStub != nil {
    79  		return fake.GatherArchiveResourcesStub(archivePath)
    80  	}
    81  	if specificReturn {
    82  		return ret.result1, ret.result2
    83  	}
    84  	return fake.gatherArchiveResourcesReturns.result1, fake.gatherArchiveResourcesReturns.result2
    85  }
    86  
    87  func (fake *FakeSharedActor) GatherArchiveResourcesCallCount() int {
    88  	fake.gatherArchiveResourcesMutex.RLock()
    89  	defer fake.gatherArchiveResourcesMutex.RUnlock()
    90  	return len(fake.gatherArchiveResourcesArgsForCall)
    91  }
    92  
    93  func (fake *FakeSharedActor) GatherArchiveResourcesArgsForCall(i int) string {
    94  	fake.gatherArchiveResourcesMutex.RLock()
    95  	defer fake.gatherArchiveResourcesMutex.RUnlock()
    96  	return fake.gatherArchiveResourcesArgsForCall[i].archivePath
    97  }
    98  
    99  func (fake *FakeSharedActor) GatherArchiveResourcesReturns(result1 []sharedaction.Resource, result2 error) {
   100  	fake.GatherArchiveResourcesStub = nil
   101  	fake.gatherArchiveResourcesReturns = struct {
   102  		result1 []sharedaction.Resource
   103  		result2 error
   104  	}{result1, result2}
   105  }
   106  
   107  func (fake *FakeSharedActor) GatherArchiveResourcesReturnsOnCall(i int, result1 []sharedaction.Resource, result2 error) {
   108  	fake.GatherArchiveResourcesStub = nil
   109  	if fake.gatherArchiveResourcesReturnsOnCall == nil {
   110  		fake.gatherArchiveResourcesReturnsOnCall = make(map[int]struct {
   111  			result1 []sharedaction.Resource
   112  			result2 error
   113  		})
   114  	}
   115  	fake.gatherArchiveResourcesReturnsOnCall[i] = struct {
   116  		result1 []sharedaction.Resource
   117  		result2 error
   118  	}{result1, result2}
   119  }
   120  
   121  func (fake *FakeSharedActor) GatherDirectoryResources(sourceDir string) ([]sharedaction.Resource, error) {
   122  	fake.gatherDirectoryResourcesMutex.Lock()
   123  	ret, specificReturn := fake.gatherDirectoryResourcesReturnsOnCall[len(fake.gatherDirectoryResourcesArgsForCall)]
   124  	fake.gatherDirectoryResourcesArgsForCall = append(fake.gatherDirectoryResourcesArgsForCall, struct {
   125  		sourceDir string
   126  	}{sourceDir})
   127  	fake.recordInvocation("GatherDirectoryResources", []interface{}{sourceDir})
   128  	fake.gatherDirectoryResourcesMutex.Unlock()
   129  	if fake.GatherDirectoryResourcesStub != nil {
   130  		return fake.GatherDirectoryResourcesStub(sourceDir)
   131  	}
   132  	if specificReturn {
   133  		return ret.result1, ret.result2
   134  	}
   135  	return fake.gatherDirectoryResourcesReturns.result1, fake.gatherDirectoryResourcesReturns.result2
   136  }
   137  
   138  func (fake *FakeSharedActor) GatherDirectoryResourcesCallCount() int {
   139  	fake.gatherDirectoryResourcesMutex.RLock()
   140  	defer fake.gatherDirectoryResourcesMutex.RUnlock()
   141  	return len(fake.gatherDirectoryResourcesArgsForCall)
   142  }
   143  
   144  func (fake *FakeSharedActor) GatherDirectoryResourcesArgsForCall(i int) string {
   145  	fake.gatherDirectoryResourcesMutex.RLock()
   146  	defer fake.gatherDirectoryResourcesMutex.RUnlock()
   147  	return fake.gatherDirectoryResourcesArgsForCall[i].sourceDir
   148  }
   149  
   150  func (fake *FakeSharedActor) GatherDirectoryResourcesReturns(result1 []sharedaction.Resource, result2 error) {
   151  	fake.GatherDirectoryResourcesStub = nil
   152  	fake.gatherDirectoryResourcesReturns = struct {
   153  		result1 []sharedaction.Resource
   154  		result2 error
   155  	}{result1, result2}
   156  }
   157  
   158  func (fake *FakeSharedActor) GatherDirectoryResourcesReturnsOnCall(i int, result1 []sharedaction.Resource, result2 error) {
   159  	fake.GatherDirectoryResourcesStub = nil
   160  	if fake.gatherDirectoryResourcesReturnsOnCall == nil {
   161  		fake.gatherDirectoryResourcesReturnsOnCall = make(map[int]struct {
   162  			result1 []sharedaction.Resource
   163  			result2 error
   164  		})
   165  	}
   166  	fake.gatherDirectoryResourcesReturnsOnCall[i] = struct {
   167  		result1 []sharedaction.Resource
   168  		result2 error
   169  	}{result1, result2}
   170  }
   171  
   172  func (fake *FakeSharedActor) ZipArchiveResources(sourceArchivePath string, filesToInclude []sharedaction.Resource) (string, error) {
   173  	var filesToIncludeCopy []sharedaction.Resource
   174  	if filesToInclude != nil {
   175  		filesToIncludeCopy = make([]sharedaction.Resource, len(filesToInclude))
   176  		copy(filesToIncludeCopy, filesToInclude)
   177  	}
   178  	fake.zipArchiveResourcesMutex.Lock()
   179  	ret, specificReturn := fake.zipArchiveResourcesReturnsOnCall[len(fake.zipArchiveResourcesArgsForCall)]
   180  	fake.zipArchiveResourcesArgsForCall = append(fake.zipArchiveResourcesArgsForCall, struct {
   181  		sourceArchivePath string
   182  		filesToInclude    []sharedaction.Resource
   183  	}{sourceArchivePath, filesToIncludeCopy})
   184  	fake.recordInvocation("ZipArchiveResources", []interface{}{sourceArchivePath, filesToIncludeCopy})
   185  	fake.zipArchiveResourcesMutex.Unlock()
   186  	if fake.ZipArchiveResourcesStub != nil {
   187  		return fake.ZipArchiveResourcesStub(sourceArchivePath, filesToInclude)
   188  	}
   189  	if specificReturn {
   190  		return ret.result1, ret.result2
   191  	}
   192  	return fake.zipArchiveResourcesReturns.result1, fake.zipArchiveResourcesReturns.result2
   193  }
   194  
   195  func (fake *FakeSharedActor) ZipArchiveResourcesCallCount() int {
   196  	fake.zipArchiveResourcesMutex.RLock()
   197  	defer fake.zipArchiveResourcesMutex.RUnlock()
   198  	return len(fake.zipArchiveResourcesArgsForCall)
   199  }
   200  
   201  func (fake *FakeSharedActor) ZipArchiveResourcesArgsForCall(i int) (string, []sharedaction.Resource) {
   202  	fake.zipArchiveResourcesMutex.RLock()
   203  	defer fake.zipArchiveResourcesMutex.RUnlock()
   204  	return fake.zipArchiveResourcesArgsForCall[i].sourceArchivePath, fake.zipArchiveResourcesArgsForCall[i].filesToInclude
   205  }
   206  
   207  func (fake *FakeSharedActor) ZipArchiveResourcesReturns(result1 string, result2 error) {
   208  	fake.ZipArchiveResourcesStub = nil
   209  	fake.zipArchiveResourcesReturns = struct {
   210  		result1 string
   211  		result2 error
   212  	}{result1, result2}
   213  }
   214  
   215  func (fake *FakeSharedActor) ZipArchiveResourcesReturnsOnCall(i int, result1 string, result2 error) {
   216  	fake.ZipArchiveResourcesStub = nil
   217  	if fake.zipArchiveResourcesReturnsOnCall == nil {
   218  		fake.zipArchiveResourcesReturnsOnCall = make(map[int]struct {
   219  			result1 string
   220  			result2 error
   221  		})
   222  	}
   223  	fake.zipArchiveResourcesReturnsOnCall[i] = struct {
   224  		result1 string
   225  		result2 error
   226  	}{result1, result2}
   227  }
   228  
   229  func (fake *FakeSharedActor) ZipDirectoryResources(sourceDir string, filesToInclude []sharedaction.Resource) (string, error) {
   230  	var filesToIncludeCopy []sharedaction.Resource
   231  	if filesToInclude != nil {
   232  		filesToIncludeCopy = make([]sharedaction.Resource, len(filesToInclude))
   233  		copy(filesToIncludeCopy, filesToInclude)
   234  	}
   235  	fake.zipDirectoryResourcesMutex.Lock()
   236  	ret, specificReturn := fake.zipDirectoryResourcesReturnsOnCall[len(fake.zipDirectoryResourcesArgsForCall)]
   237  	fake.zipDirectoryResourcesArgsForCall = append(fake.zipDirectoryResourcesArgsForCall, struct {
   238  		sourceDir      string
   239  		filesToInclude []sharedaction.Resource
   240  	}{sourceDir, filesToIncludeCopy})
   241  	fake.recordInvocation("ZipDirectoryResources", []interface{}{sourceDir, filesToIncludeCopy})
   242  	fake.zipDirectoryResourcesMutex.Unlock()
   243  	if fake.ZipDirectoryResourcesStub != nil {
   244  		return fake.ZipDirectoryResourcesStub(sourceDir, filesToInclude)
   245  	}
   246  	if specificReturn {
   247  		return ret.result1, ret.result2
   248  	}
   249  	return fake.zipDirectoryResourcesReturns.result1, fake.zipDirectoryResourcesReturns.result2
   250  }
   251  
   252  func (fake *FakeSharedActor) ZipDirectoryResourcesCallCount() int {
   253  	fake.zipDirectoryResourcesMutex.RLock()
   254  	defer fake.zipDirectoryResourcesMutex.RUnlock()
   255  	return len(fake.zipDirectoryResourcesArgsForCall)
   256  }
   257  
   258  func (fake *FakeSharedActor) ZipDirectoryResourcesArgsForCall(i int) (string, []sharedaction.Resource) {
   259  	fake.zipDirectoryResourcesMutex.RLock()
   260  	defer fake.zipDirectoryResourcesMutex.RUnlock()
   261  	return fake.zipDirectoryResourcesArgsForCall[i].sourceDir, fake.zipDirectoryResourcesArgsForCall[i].filesToInclude
   262  }
   263  
   264  func (fake *FakeSharedActor) ZipDirectoryResourcesReturns(result1 string, result2 error) {
   265  	fake.ZipDirectoryResourcesStub = nil
   266  	fake.zipDirectoryResourcesReturns = struct {
   267  		result1 string
   268  		result2 error
   269  	}{result1, result2}
   270  }
   271  
   272  func (fake *FakeSharedActor) ZipDirectoryResourcesReturnsOnCall(i int, result1 string, result2 error) {
   273  	fake.ZipDirectoryResourcesStub = nil
   274  	if fake.zipDirectoryResourcesReturnsOnCall == nil {
   275  		fake.zipDirectoryResourcesReturnsOnCall = make(map[int]struct {
   276  			result1 string
   277  			result2 error
   278  		})
   279  	}
   280  	fake.zipDirectoryResourcesReturnsOnCall[i] = struct {
   281  		result1 string
   282  		result2 error
   283  	}{result1, result2}
   284  }
   285  
   286  func (fake *FakeSharedActor) Invocations() map[string][][]interface{} {
   287  	fake.invocationsMutex.RLock()
   288  	defer fake.invocationsMutex.RUnlock()
   289  	fake.gatherArchiveResourcesMutex.RLock()
   290  	defer fake.gatherArchiveResourcesMutex.RUnlock()
   291  	fake.gatherDirectoryResourcesMutex.RLock()
   292  	defer fake.gatherDirectoryResourcesMutex.RUnlock()
   293  	fake.zipArchiveResourcesMutex.RLock()
   294  	defer fake.zipArchiveResourcesMutex.RUnlock()
   295  	fake.zipDirectoryResourcesMutex.RLock()
   296  	defer fake.zipDirectoryResourcesMutex.RUnlock()
   297  	copiedInvocations := map[string][][]interface{}{}
   298  	for key, value := range fake.invocations {
   299  		copiedInvocations[key] = value
   300  	}
   301  	return copiedInvocations
   302  }
   303  
   304  func (fake *FakeSharedActor) recordInvocation(key string, args []interface{}) {
   305  	fake.invocationsMutex.Lock()
   306  	defer fake.invocationsMutex.Unlock()
   307  	if fake.invocations == nil {
   308  		fake.invocations = map[string][][]interface{}{}
   309  	}
   310  	if fake.invocations[key] == nil {
   311  		fake.invocations[key] = [][]interface{}{}
   312  	}
   313  	fake.invocations[key] = append(fake.invocations[key], args)
   314  }
   315  
   316  var _ pushaction.SharedActor = new(FakeSharedActor)