test_util

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(method, host, rawPath string, body io.Reader) *http.Request

func NewResponse

func NewResponse(status int) *http.Response

func NextAvailPort

func NextAvailPort() uint16

func SpecConfig

func SpecConfig(statusPort uint16, natsPorts ...uint16) *config.Config

Types

type FakeFile

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

func (*FakeFile) Read

func (f *FakeFile) Read(data *[]byte) (int, error)

func (*FakeFile) Write

func (f *FakeFile) Write(data []byte) (int, error)

type HttpConn

type HttpConn struct {
	net.Conn

	Reader *bufio.Reader
	Writer *bufio.Writer
}

func NewHttpConn

func NewHttpConn(x net.Conn) *HttpConn

func (*HttpConn) CheckLine

func (x *HttpConn) CheckLine(expected string)

func (*HttpConn) CheckLines

func (x *HttpConn) CheckLines(expected []string)

func (*HttpConn) ReadRequest

func (x *HttpConn) ReadRequest() (*http.Request, string)

func (*HttpConn) ReadResponse

func (x *HttpConn) ReadResponse() (*http.Response, string)

func (*HttpConn) WriteLine

func (x *HttpConn) WriteLine(line string)

func (*HttpConn) WriteLines

func (x *HttpConn) WriteLines(lines []string)

func (*HttpConn) WriteRequest

func (x *HttpConn) WriteRequest(req *http.Request)

func (*HttpConn) WriteResponse

func (x *HttpConn) WriteResponse(resp *http.Response)

type NATSRunner

type NATSRunner struct {
	MessageBus *nats.Conn
	// contains filtered or unexported fields
}

func NewNATSRunner

func NewNATSRunner(port int) *NATSRunner

func (*NATSRunner) KillWithFire

func (runner *NATSRunner) KillWithFire()

func (*NATSRunner) Start

func (runner *NATSRunner) Start()

func (*NATSRunner) Stop

func (runner *NATSRunner) Stop()

type Nats

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

func NewNats

func NewNats(port uint16) *Nats

func NewNatsOnRandomPort

func NewNatsOnRandomPort() *Nats

func (*Nats) Port

func (n *Nats) Port() uint16

func (*Nats) Start

func (n *Nats) Start()

func (*Nats) Stop

func (n *Nats) Stop()

type TestZapLogger

type TestZapLogger struct {
	logger.Logger
	*TestZapSink
}

TestZapLogger implements a zap logger that can be used with Ginkgo tests

func NewTestZapLogger

func NewTestZapLogger(component string) *TestZapLogger

NewTestZapLogger returns a new test logger using zap

func (*TestZapLogger) Buffer

func (z *TestZapLogger) Buffer() *gbytes.Buffer

Buffer returns the gbytes buffer that was used as the sink

type TestZapSink

type TestZapSink struct {
	*gbytes.Buffer
}

Taken from github.com/uber-go/zap

func (*TestZapSink) Lines

func (s *TestZapSink) Lines() []string

func (*TestZapSink) Sync

func (s *TestZapSink) Sync() error

Jump to

Keyboard shortcuts

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