github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/old/rootfs_provider/fake_rootfs_provider/fake_rootfs_provider.go (about)

     1  // This file was generated by counterfeiter
     2  package fake_rootfs_provider
     3  
     4  import (
     5  	"net/url"
     6  	"sync"
     7  
     8  	"github.com/cloudfoundry-incubator/garden-linux/old/rootfs_provider"
     9  	"github.com/cloudfoundry-incubator/garden-linux/process"
    10  	"github.com/pivotal-golang/lager"
    11  )
    12  
    13  type FakeRootFSProvider struct {
    14  	ProvideRootFSStub        func(logger lager.Logger, id string, rootfs *url.URL, namespaced bool) (mountpoint string, envvar process.Env, err error)
    15  	provideRootFSMutex       sync.RWMutex
    16  	provideRootFSArgsForCall []struct {
    17  		logger     lager.Logger
    18  		id         string
    19  		rootfs     *url.URL
    20  		namespaced bool
    21  	}
    22  	provideRootFSReturns struct {
    23  		result1 string
    24  		result2 process.Env
    25  		result3 error
    26  	}
    27  	CleanupRootFSStub        func(logger lager.Logger, id string) error
    28  	cleanupRootFSMutex       sync.RWMutex
    29  	cleanupRootFSArgsForCall []struct {
    30  		logger lager.Logger
    31  		id     string
    32  	}
    33  	cleanupRootFSReturns struct {
    34  		result1 error
    35  	}
    36  }
    37  
    38  func (fake *FakeRootFSProvider) ProvideRootFS(logger lager.Logger, id string, rootfs *url.URL, namespaced bool) (mountpoint string, envvar process.Env, err error) {
    39  	fake.provideRootFSMutex.Lock()
    40  	fake.provideRootFSArgsForCall = append(fake.provideRootFSArgsForCall, struct {
    41  		logger     lager.Logger
    42  		id         string
    43  		rootfs     *url.URL
    44  		namespaced bool
    45  	}{logger, id, rootfs, namespaced})
    46  	fake.provideRootFSMutex.Unlock()
    47  	if fake.ProvideRootFSStub != nil {
    48  		return fake.ProvideRootFSStub(logger, id, rootfs, namespaced)
    49  	} else {
    50  		return fake.provideRootFSReturns.result1, fake.provideRootFSReturns.result2, fake.provideRootFSReturns.result3
    51  	}
    52  }
    53  
    54  func (fake *FakeRootFSProvider) ProvideRootFSCallCount() int {
    55  	fake.provideRootFSMutex.RLock()
    56  	defer fake.provideRootFSMutex.RUnlock()
    57  	return len(fake.provideRootFSArgsForCall)
    58  }
    59  
    60  func (fake *FakeRootFSProvider) ProvideRootFSArgsForCall(i int) (lager.Logger, string, *url.URL, bool) {
    61  	fake.provideRootFSMutex.RLock()
    62  	defer fake.provideRootFSMutex.RUnlock()
    63  	return fake.provideRootFSArgsForCall[i].logger, fake.provideRootFSArgsForCall[i].id, fake.provideRootFSArgsForCall[i].rootfs, fake.provideRootFSArgsForCall[i].namespaced
    64  }
    65  
    66  func (fake *FakeRootFSProvider) ProvideRootFSReturns(result1 string, result2 process.Env, result3 error) {
    67  	fake.ProvideRootFSStub = nil
    68  	fake.provideRootFSReturns = struct {
    69  		result1 string
    70  		result2 process.Env
    71  		result3 error
    72  	}{result1, result2, result3}
    73  }
    74  
    75  func (fake *FakeRootFSProvider) CleanupRootFS(logger lager.Logger, id string) error {
    76  	fake.cleanupRootFSMutex.Lock()
    77  	fake.cleanupRootFSArgsForCall = append(fake.cleanupRootFSArgsForCall, struct {
    78  		logger lager.Logger
    79  		id     string
    80  	}{logger, id})
    81  	fake.cleanupRootFSMutex.Unlock()
    82  	if fake.CleanupRootFSStub != nil {
    83  		return fake.CleanupRootFSStub(logger, id)
    84  	} else {
    85  		return fake.cleanupRootFSReturns.result1
    86  	}
    87  }
    88  
    89  func (fake *FakeRootFSProvider) CleanupRootFSCallCount() int {
    90  	fake.cleanupRootFSMutex.RLock()
    91  	defer fake.cleanupRootFSMutex.RUnlock()
    92  	return len(fake.cleanupRootFSArgsForCall)
    93  }
    94  
    95  func (fake *FakeRootFSProvider) CleanupRootFSArgsForCall(i int) (lager.Logger, string) {
    96  	fake.cleanupRootFSMutex.RLock()
    97  	defer fake.cleanupRootFSMutex.RUnlock()
    98  	return fake.cleanupRootFSArgsForCall[i].logger, fake.cleanupRootFSArgsForCall[i].id
    99  }
   100  
   101  func (fake *FakeRootFSProvider) CleanupRootFSReturns(result1 error) {
   102  	fake.CleanupRootFSStub = nil
   103  	fake.cleanupRootFSReturns = struct {
   104  		result1 error
   105  	}{result1}
   106  }
   107  
   108  var _ rootfs_provider.RootFSProvider = new(FakeRootFSProvider)