testutil

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 1 module, 1 package

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

Functions

func NewFakeConn

func NewFakeConn(c *C) (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 {
	C *C
	// 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)

Jump to

Keyboard shortcuts

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