testsupport

package
v0.0.0-...-6637ac4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XaviTestContainer       = "xavi"
	MountebankTestContainer = "mountebank"
)
View Source
const RoundRobin3000Config = `` /* 529-byte string literal not displayed */

roundRobin3000Config is the mountebank imposter definition for the test server running on port 3000 that xavi proxies

View Source
const RoundRobin3100Config = `` /* 528-byte string literal not displayed */

roundRobin3100Config is the mountebank imposter definition for the test server running on port 3000 that xavi proxies

Variables

View Source
var (
	XaviAgentRESTEnpointBaseURI         string
	XaviAcceptanceTestEndpointBaseURL   string
	StandaloneMountebackEndpointBaseURL string
	CohostedMountebankEndpointBaseURL   string
)

Functions

func CountRequestFrom

func CountRequestFrom(s string) int

CountRequestFrom returns the number of occurances of "requestFrom:" is the given string. This is useful when looking at imposter stats obtained from a mountebank server.

func DeleteMountebankImposter

func DeleteMountebankImposter(url string)

DeleteMountebankImposter is used to delete a Mountebank imposter via a delete to an imposter resource

func GetPortFromURL

func GetPortFromURL(urlString string) (int, error)

func GetTestEndpoint

func GetTestEndpoint(endpoint string) int

GetTestEndpoint returns the HTTP status code obtained from doing an HTTP get on the supplied endpoint

func GetTestEndpointOutput

func GetTestEndpointOutput(endpoint string) (string, error)

GetTestEndpointOutput returns the response obtained via an HTTP Get on endpoint

func GetTestEndpointWithHeader

func GetTestEndpointWithHeader(endpoint string, header string, value string) int

func KillSpawnedProcess

func KillSpawnedProcess(pid int, port int, agentURL string) error

KillSpawnedProcess uses the spawn-killer endpoint in the xavi agent to kill a spawned process. This is useful in cleaning up processes that were spawned to execute a test case.

func MountebankSetup

func MountebankSetup(endpoint string, config string) error

MountebankSetup is used to post mountebank setup configuration to a mountebank endpoint.

func PutDefinition

func PutDefinition(serviceURI string, payload string, agentURL string) (int, error)

PutDefinition is used to put an entity to an HTTP endpoint. This is used to put XAVI setup definitions to an endpoint.

func PutDefinitionOk

func PutDefinitionOk(serviceURI string, payload string, agentURL string) error

PutDefinitionOk calls PutDefinition, returning an error if PutDefinition returns and error or a status code other than StatusOk

func Spawn

func Spawn(name string, port int, agentURL string) (int, error)

Spawn used the XAVI spawn-listener endpoint to start an instance of XAVI for testing. The spawned process uses the definitions associated with the named listener.

func SpawnTestContainers

func SpawnTestContainers() map[string]string

SpawnTestContainers checks the status of the required test containers that must be running in able for the acceptance tests to execute successfully. If the containers are not running then they are started. The map that is returned containers container name to container id mapping.

func StopAndRemoveContainers

func StopAndRemoveContainers(containers map[string]string)

StopAndRemoveContainers stops and removes the containers in the given map

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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