pulsartestutils

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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) Go

func (impl *CustomRPCWrapperMock) Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call

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

type MockListener struct {
	mock.Mock
}

MockListener mocks net.Listener interface

func (*MockListener) Accept

func (mock *MockListener) Accept() (net.Conn, error)

func (*MockListener) Addr

func (mock *MockListener) Addr() net.Addr

func (*MockListener) Close

func (mock *MockListener) Close() error

type MockRPCClientWrapper

type MockRPCClientWrapper struct {
	mock.Mock
}

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) Go

func (mock *MockRPCClientWrapper) Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL