stomp: github.com/go-stomp/stomp/testutil Index | Files

package testutil

import "github.com/go-stomp/stomp/testutil"

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

Index

Package Files

fake_conn.go testutil.go

Variables

var (
    ErrClosing = errors.New("use of closed network connection")
)

type FakeAddr Uses

type FakeAddr struct {
    Value string
}

func (*FakeAddr) Network Uses

func (addr *FakeAddr) Network() string

func (*FakeAddr) String Uses

func (addr *FakeAddr) String() string

type FakeConn Uses

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 NewFakeConn Uses

func NewFakeConn(c *C) (client *FakeConn, server *FakeConn)

NewFakeConn returns a pair of fake connections suitable for testing.

func (*FakeConn) Close Uses

func (fc *FakeConn) Close() error

func (*FakeConn) LocalAddr Uses

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

func (*FakeConn) Read Uses

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

func (*FakeConn) RemoteAddr Uses

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

func (*FakeConn) SetDeadline Uses

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

func (*FakeConn) SetLocalAddr Uses

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

func (*FakeConn) SetReadDeadline Uses

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

func (*FakeConn) SetRemoteAddr Uses

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

func (*FakeConn) SetWriteDeadline Uses

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

func (*FakeConn) Write Uses

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

Package testutil imports 5 packages (graph). Updated 2018-02-15. Refresh now. Tools for package owners.