test

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package test has test functions for the surveyor

Index

Constants

This section is empty.

Variables

View Source
var (
	SystemCreds = "../test/SYS.creds"
)

Test variables

Functions

func ConnectAndVerify

func ConnectAndVerify(t *testing.T, url string, options ...nats.Option) *nats.Conn

ConnectAndVerify connects to a server a verifies it is ready to process messages.

func NewJetStreamServer added in v0.2.2

func NewJetStreamServer(t *testing.T) *server.Server

NewJetStreamServer creates a single NATS server with JetStream enabled globally

func NewServerFromConfig added in v0.5.1

func NewServerFromConfig(t *testing.T, configFile string) *server.Server

NewServerFromConfig creates a single NATS server using provided config file

func NewSingleServer

func NewSingleServer(t *testing.T) *server.Server

NewSingleServer creates a single NATS server with a system account

func StartBasicServer

func StartBasicServer() *server.Server

StartBasicServer runs the NATS server with a monitor port in a go routine

func StartJetStreamServerFromConfig added in v0.5.1

func StartJetStreamServerFromConfig(t *testing.T, confFile string) *server.Server

StartJetStreamServerFromConfig starts a JetStream server using the provided configuration StoreDir from config will not be used - instead, a tmp directory will be created for the test

func StartServer

func StartServer(t *testing.T, confFile string) *server.Server

StartServer starts a a NATS server

Types

type SuperCluster

type SuperCluster struct {
	Servers []*server.Server
	Clients []*nats.Conn
}

SuperCluster holds client connections and NATS servers

func NewJetStreamCluster added in v0.5.1

func NewJetStreamCluster(t *testing.T) *SuperCluster

func NewSuperCluster

func NewSuperCluster(t *testing.T) *SuperCluster

NewSuperCluster creates a small supercluster for testing, with one client per server.

func (*SuperCluster) Shutdown

func (sc *SuperCluster) Shutdown()

Shutdown shuts the supercluster down

Jump to

Keyboard shortcuts

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