Documentation ¶
Overview ¶
Package pulsartestutil - test utils for pulsar package
Package pulsartestutil - test utils for pulsar package ¶
Package pulsartestutil - test utils for pulsar package ¶
Package pulsartestutil - test utils for pulsar package
Index ¶
- Variables
- type CustomRPCWrapperMock
- func (*CustomRPCWrapperMock) Close() error
- func (impl *CustomRPCWrapperMock) CreateConnection(connectionType configuration.ConnectionType, connectionAddress string) error
- func (impl *CustomRPCWrapperMock) Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call
- func (impl *CustomRPCWrapperMock) IsInitialised() bool
- func (*CustomRPCWrapperMock) Lock()
- func (impl *CustomRPCWrapperMock) ResetClient()
- func (*CustomRPCWrapperMock) SetRPCClient(client *rpc.Client)
- func (*CustomRPCWrapperMock) Unlock()
- type MockEntropyGenerator
- type MockListener
- type MockRPCClientWrapper
- func (mock *MockRPCClientWrapper) Close() error
- func (mock *MockRPCClientWrapper) CreateConnection(connectionType configuration.ConnectionType, connectionAddress string) error
- func (mock *MockRPCClientWrapper) Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call
- func (mock *MockRPCClientWrapper) IsInitialised() bool
- func (mock *MockRPCClientWrapper) Lock()
- func (mock *MockRPCClientWrapper) ResetClient()
- func (mock *MockRPCClientWrapper) SetRPCClient(client *rpc.Client)
- func (mock *MockRPCClientWrapper) Unlock()
- type PulsarStorageMock
- func (m *PulsarStorageMock) AllMocksCalled() bool
- func (m *PulsarStorageMock) CheckMocksCalled()
- func (m *PulsarStorageMock) Close() (r error)
- func (m *PulsarStorageMock) CloseMinimockCounter() uint64
- func (m *PulsarStorageMock) CloseMinimockPreCounter() uint64
- func (m *PulsarStorageMock) Finish()
- func (m *PulsarStorageMock) GetLastPulse() (r *core.Pulse, r1 error)
- func (m *PulsarStorageMock) GetLastPulseMinimockCounter() uint64
- func (m *PulsarStorageMock) GetLastPulseMinimockPreCounter() uint64
- func (m *PulsarStorageMock) MinimockFinish()
- func (m *PulsarStorageMock) MinimockWait(timeout time.Duration)
- func (m *PulsarStorageMock) SavePulse(p *core.Pulse) (r error)
- func (m *PulsarStorageMock) SavePulseMinimockCounter() uint64
- func (m *PulsarStorageMock) SavePulseMinimockPreCounter() uint64
- func (m *PulsarStorageMock) SetLastPulse(p *core.Pulse) (r error)
- func (m *PulsarStorageMock) SetLastPulseMinimockCounter() uint64
- func (m *PulsarStorageMock) SetLastPulseMinimockPreCounter() uint64
- func (m *PulsarStorageMock) ValidateCallCounters()
- func (m *PulsarStorageMock) Wait(timeout time.Duration)
- type PulsarStorageMockSavePulseParams
- type PulsarStorageMockSetLastPulseParams
Constants ¶
This section is empty.
Variables ¶
var MockEntropy = [64]byte{1, 2, 3, 4, 5, 6, 7, 8}
MockEntropy for pulsar's tests
Functions ¶
This section is empty.
Types ¶
type CustomRPCWrapperMock ¶
type CustomRPCWrapperMock struct { Done *rpc.Call IsInitFunc func() bool CreateConnectionFunc func() error }
CustomRPCWrapperMock is a mock of RPCClientWrapper interface It uses hand-created mocks
func (*CustomRPCWrapperMock) Close ¶
func (*CustomRPCWrapperMock) Close() error
func (*CustomRPCWrapperMock) CreateConnection ¶
func (impl *CustomRPCWrapperMock) CreateConnection(connectionType configuration.ConnectionType, connectionAddress string) error
func (*CustomRPCWrapperMock) IsInitialised ¶
func (impl *CustomRPCWrapperMock) IsInitialised() bool
func (*CustomRPCWrapperMock) Lock ¶
func (*CustomRPCWrapperMock) Lock()
func (*CustomRPCWrapperMock) ResetClient ¶
func (impl *CustomRPCWrapperMock) ResetClient()
func (*CustomRPCWrapperMock) SetRPCClient ¶
func (*CustomRPCWrapperMock) SetRPCClient(client *rpc.Client)
func (*CustomRPCWrapperMock) Unlock ¶
func (*CustomRPCWrapperMock) Unlock()
type MockEntropyGenerator ¶
type MockEntropyGenerator struct { }
MockEntropyGenerator implements EntropyGenerator and is being used for tests
func (MockEntropyGenerator) GenerateEntropy ¶
func (MockEntropyGenerator) GenerateEntropy() core.Entropy
GenerateEntropy returns mocked entropy
type MockListener ¶
MockListener mocks net.Listener interface
func (*MockListener) Addr ¶
func (mock *MockListener) Addr() net.Addr
func (*MockListener) Close ¶
func (mock *MockListener) Close() error
type MockRPCClientWrapper ¶
MockRPCClientWrapper is a mock of RPCClientWrapper interface It uses testify.mock
func (*MockRPCClientWrapper) Close ¶
func (mock *MockRPCClientWrapper) Close() error
func (*MockRPCClientWrapper) CreateConnection ¶
func (mock *MockRPCClientWrapper) CreateConnection(connectionType configuration.ConnectionType, connectionAddress string) error
func (*MockRPCClientWrapper) IsInitialised ¶
func (mock *MockRPCClientWrapper) IsInitialised() bool
func (*MockRPCClientWrapper) Lock ¶
func (mock *MockRPCClientWrapper) Lock()
func (*MockRPCClientWrapper) ResetClient ¶
func (mock *MockRPCClientWrapper) ResetClient()
func (*MockRPCClientWrapper) SetRPCClient ¶
func (mock *MockRPCClientWrapper) SetRPCClient(client *rpc.Client)
func (*MockRPCClientWrapper) Unlock ¶
func (mock *MockRPCClientWrapper) Unlock()
type PulsarStorageMock ¶ added in v0.6.1
type PulsarStorageMock struct { CloseFunc func() (r error) CloseCounter uint64 ClosePreCounter uint64 CloseMock mPulsarStorageMockClose GetLastPulseFunc func() (r *core.Pulse, r1 error) GetLastPulseCounter uint64 GetLastPulsePreCounter uint64 GetLastPulseMock mPulsarStorageMockGetLastPulse SavePulseFunc func(p *core.Pulse) (r error) SavePulseCounter uint64 SavePulsePreCounter uint64 SavePulseMock mPulsarStorageMockSavePulse SetLastPulseFunc func(p *core.Pulse) (r error) SetLastPulseCounter uint64 SetLastPulsePreCounter uint64 SetLastPulseMock mPulsarStorageMockSetLastPulse // contains filtered or unexported fields }
PulsarStorageMock implements github.com/insolar/insolar/pulsar/storage.PulsarStorage
func NewPulsarStorageMock ¶ added in v0.6.1
func NewPulsarStorageMock(t minimock.Tester) *PulsarStorageMock
NewPulsarStorageMock returns a mock for github.com/insolar/insolar/pulsar/storage.PulsarStorage
func (*PulsarStorageMock) AllMocksCalled ¶ added in v0.6.1
func (m *PulsarStorageMock) AllMocksCalled() bool
AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. require.True(mock.AllMocksCalled())
func (*PulsarStorageMock) CheckMocksCalled ¶ added in v0.6.1
func (m *PulsarStorageMock) CheckMocksCalled()
CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller noinspection GoDeprecation
func (*PulsarStorageMock) Close ¶ added in v0.6.1
func (m *PulsarStorageMock) Close() (r error)
Close implements github.com/insolar/insolar/pulsar/storage.PulsarStorage interface
func (*PulsarStorageMock) CloseMinimockCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) CloseMinimockCounter() uint64
CloseMinimockCounter returns a count of PulsarStorageMock.CloseFunc invocations
func (*PulsarStorageMock) CloseMinimockPreCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) CloseMinimockPreCounter() uint64
CloseMinimockPreCounter returns the value of PulsarStorageMock.Close invocations
func (*PulsarStorageMock) Finish ¶ added in v0.6.1
func (m *PulsarStorageMock) Finish()
Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller
func (*PulsarStorageMock) GetLastPulse ¶ added in v0.6.1
func (m *PulsarStorageMock) GetLastPulse() (r *core.Pulse, r1 error)
GetLastPulse implements github.com/insolar/insolar/pulsar/storage.PulsarStorage interface
func (*PulsarStorageMock) GetLastPulseMinimockCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) GetLastPulseMinimockCounter() uint64
GetLastPulseMinimockCounter returns a count of PulsarStorageMock.GetLastPulseFunc invocations
func (*PulsarStorageMock) GetLastPulseMinimockPreCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) GetLastPulseMinimockPreCounter() uint64
GetLastPulseMinimockPreCounter returns the value of PulsarStorageMock.GetLastPulse invocations
func (*PulsarStorageMock) MinimockFinish ¶ added in v0.6.1
func (m *PulsarStorageMock) MinimockFinish()
MinimockFinish checks that all mocked methods of the interface have been called at least once
func (*PulsarStorageMock) MinimockWait ¶ added in v0.6.1
func (m *PulsarStorageMock) MinimockWait(timeout time.Duration)
MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller
func (*PulsarStorageMock) SavePulse ¶ added in v0.6.1
func (m *PulsarStorageMock) SavePulse(p *core.Pulse) (r error)
SavePulse implements github.com/insolar/insolar/pulsar/storage.PulsarStorage interface
func (*PulsarStorageMock) SavePulseMinimockCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) SavePulseMinimockCounter() uint64
SavePulseMinimockCounter returns a count of PulsarStorageMock.SavePulseFunc invocations
func (*PulsarStorageMock) SavePulseMinimockPreCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) SavePulseMinimockPreCounter() uint64
SavePulseMinimockPreCounter returns the value of PulsarStorageMock.SavePulse invocations
func (*PulsarStorageMock) SetLastPulse ¶ added in v0.6.1
func (m *PulsarStorageMock) SetLastPulse(p *core.Pulse) (r error)
SetLastPulse implements github.com/insolar/insolar/pulsar/storage.PulsarStorage interface
func (*PulsarStorageMock) SetLastPulseMinimockCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) SetLastPulseMinimockCounter() uint64
SetLastPulseMinimockCounter returns a count of PulsarStorageMock.SetLastPulseFunc invocations
func (*PulsarStorageMock) SetLastPulseMinimockPreCounter ¶ added in v0.6.1
func (m *PulsarStorageMock) SetLastPulseMinimockPreCounter() uint64
SetLastPulseMinimockPreCounter returns the value of PulsarStorageMock.SetLastPulse invocations
func (*PulsarStorageMock) ValidateCallCounters ¶ added in v0.6.1
func (m *PulsarStorageMock) ValidateCallCounters()
ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller
func (*PulsarStorageMock) Wait ¶ added in v0.6.1
func (m *PulsarStorageMock) Wait(timeout time.Duration)
Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller
type PulsarStorageMockSavePulseParams ¶ added in v0.6.1
type PulsarStorageMockSavePulseParams struct {
// contains filtered or unexported fields
}
PulsarStorageMockSavePulseParams represents input parameters of the PulsarStorage.SavePulse
type PulsarStorageMockSetLastPulseParams ¶ added in v0.6.1
type PulsarStorageMockSetLastPulseParams struct {
// contains filtered or unexported fields
}
PulsarStorageMockSetLastPulseParams represents input parameters of the PulsarStorage.SetLastPulse