testutil

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testutil is a generated GoMock package.

Package testutil contains operations useful for testing. In particular, it provides fake connections useful for testing client/server interactions.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosing   = errors.New("use of closed network connection")
	ErrIOTimeout = errors.New("io timeout")
)

Functions

func NewFakeConn

func NewFakeConn(t testing.TB) (client *FakeConn, server *FakeConn)

NewFakeConn returns a pair of fake connections suitable for testing.

Types

type FakeAddr

type FakeAddr struct {
	Value string
}

func (*FakeAddr) Network

func (addr *FakeAddr) Network() string

func (*FakeAddr) String

func (addr *FakeAddr) String() string

type FakeConn

type FakeConn struct {
	T testing.TB
	// contains filtered or unexported fields
}

FakeConn is a fake connection used for testing. It implements the net.Conn interface and is useful for simulating I/O between STOMP clients and a STOMP server.

func (*FakeConn) Close

func (fc *FakeConn) Close() error

func (*FakeConn) LocalAddr

func (fc *FakeConn) LocalAddr() net.Addr

func (*FakeConn) Read

func (fc *FakeConn) Read(p []byte) (n int, err error)

func (*FakeConn) RemoteAddr

func (fc *FakeConn) RemoteAddr() net.Addr

func (*FakeConn) SetDeadline

func (fc *FakeConn) SetDeadline(t time.Time) error

func (*FakeConn) SetLocalAddr

func (fc *FakeConn) SetLocalAddr(addr net.Addr)

func (*FakeConn) SetReadDeadline

func (fc *FakeConn) SetReadDeadline(t time.Time) error

func (*FakeConn) SetRemoteAddr

func (fc *FakeConn) SetRemoteAddr(addr net.Addr)

func (*FakeConn) SetWriteDeadline

func (fc *FakeConn) SetWriteDeadline(t time.Time) error

func (*FakeConn) Write

func (fc *FakeConn) Write(p []byte) (n int, err error)

type MockLogger added in v3.0.4

type MockLogger struct {
	// contains filtered or unexported fields
}

MockLogger is a mock of Logger interface.

func NewMockLogger added in v3.0.4

func NewMockLogger(ctrl *gomock.Controller) *MockLogger

NewMockLogger creates a new mock instance.

func (*MockLogger) Debug added in v3.0.4

func (m *MockLogger) Debug(message string)

Debug mocks base method.

func (*MockLogger) Debugf added in v3.0.4

func (m *MockLogger) Debugf(format string, value ...interface{})

Debugf mocks base method.

func (*MockLogger) EXPECT added in v3.0.4

func (m *MockLogger) EXPECT() *MockLoggerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockLogger) Error added in v3.0.4

func (m *MockLogger) Error(message string)

Error mocks base method.

func (*MockLogger) Errorf added in v3.0.4

func (m *MockLogger) Errorf(format string, value ...interface{})

Errorf mocks base method.

func (*MockLogger) Info added in v3.0.4

func (m *MockLogger) Info(message string)

Info mocks base method.

func (*MockLogger) Infof added in v3.0.4

func (m *MockLogger) Infof(format string, value ...interface{})

Infof mocks base method.

func (*MockLogger) Warning added in v3.0.4

func (m *MockLogger) Warning(message string)

Warning mocks base method.

func (*MockLogger) Warningf added in v3.0.4

func (m *MockLogger) Warningf(format string, value ...interface{})

Warningf mocks base method.

type MockLoggerMockRecorder added in v3.0.4

type MockLoggerMockRecorder struct {
	// contains filtered or unexported fields
}

MockLoggerMockRecorder is the mock recorder for MockLogger.

func (*MockLoggerMockRecorder) Debug added in v3.0.4

func (mr *MockLoggerMockRecorder) Debug(message interface{}) *gomock.Call

Debug indicates an expected call of Debug.

func (*MockLoggerMockRecorder) Debugf added in v3.0.4

func (mr *MockLoggerMockRecorder) Debugf(format interface{}, value ...interface{}) *gomock.Call

Debugf indicates an expected call of Debugf.

func (*MockLoggerMockRecorder) Error added in v3.0.4

func (mr *MockLoggerMockRecorder) Error(message interface{}) *gomock.Call

Error indicates an expected call of Error.

func (*MockLoggerMockRecorder) Errorf added in v3.0.4

func (mr *MockLoggerMockRecorder) Errorf(format interface{}, value ...interface{}) *gomock.Call

Errorf indicates an expected call of Errorf.

func (*MockLoggerMockRecorder) Info added in v3.0.4

func (mr *MockLoggerMockRecorder) Info(message interface{}) *gomock.Call

Info indicates an expected call of Info.

func (*MockLoggerMockRecorder) Infof added in v3.0.4

func (mr *MockLoggerMockRecorder) Infof(format interface{}, value ...interface{}) *gomock.Call

Infof indicates an expected call of Infof.

func (*MockLoggerMockRecorder) Warning added in v3.0.4

func (mr *MockLoggerMockRecorder) Warning(message interface{}) *gomock.Call

Warning indicates an expected call of Warning.

func (*MockLoggerMockRecorder) Warningf added in v3.0.4

func (mr *MockLoggerMockRecorder) Warningf(format interface{}, value ...interface{}) *gomock.Call

Warningf indicates an expected call of Warningf.

Jump to

Keyboard shortcuts

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