Documentation ¶
Overview ¶
Package utils provides various utilities for testing the coherence-go-client.
Index ¶
- func AssertPersonResult(g *gomega.WithT, result Person, expectedValue Person)
- func AssertSize[K comparable, V any](g *gomega.WithT, namedMap coherence.NamedMap[K, V], expectedSize int)
- func ClearNamedMap[K comparable, V any](g *gomega.WithT, namedCache coherence.NamedMap[K, V])
- func CollectDockerLogs() error
- func CreateTempDirectory(pattern string) string
- func DockerComposeDown(composeFile string) (string, error)
- func DockerComposeUp(composeFile string) (string, error)
- func ExecuteHostCommand(name string, arg ...string) (string, error)
- func FileExistsInDirectory(dir string, file string) bool
- func GetFilePath(fileName string) string
- func GetGrpcURL(hostname string, port int) string
- func GetManagementURL(httpPort int) string
- func GetNamedCache[K comparable, V any](g *gomega.WithT, session *coherence.Session, cacheName string) coherence.NamedCache[K, V]
- func GetNamedCacheWithScope[K comparable, V any](g *gomega.WithT, session *coherence.Session, cacheName, _ string) coherence.NamedCache[K, V]
- func GetNamedMap[K comparable, V any](g *gomega.WithT, session *coherence.Session, cacheName string) coherence.NamedMap[K, V]
- func GetNamedMapWithScope[K comparable, V any](g *gomega.WithT, session *coherence.Session, cacheName, _ string) coherence.NamedMap[K, V]
- func GetRestURL(restPort int) string
- func GetSession(options ...func(session *coherence.SessionOptions)) (*coherence.Session, error)
- func IssueGetRequest(url string) ([]byte, error)
- func IssuePostRequest(url string) ([]byte, error)
- func RunKeyValueTest[K comparable, V any](g *gomega.WithT, cache coherence.NamedMap[K, V], key K, value V)
- func RunKeyValueTestNamedCache[K comparable, V any](g *gomega.WithT, cache coherence.NamedCache[K, V], key K, value V)
- func SetTestContext(context *TestContext)
- func Sleep(seconds int)
- func StartCoherenceCluster(fileName, url string) error
- func WaitForHTTPBalancedServices(url string, timeout int) error
- func WaitForHTTPReady(url string, timeout int) error
- type Address
- type BooleanTest
- type Person
- type TestContext
- type VersionedPerson
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertPersonResult ¶
func AssertSize ¶
func ClearNamedMap ¶
func CreateTempDirectory ¶
CreateTempDirectory creates a temporary directory
func DockerComposeDown ¶
DockerComposeDown runs docker-compose down on a given file
func DockerComposeUp ¶
DockerComposeUp runs docker-compose up on a given file
func ExecuteHostCommand ¶
ExecuteHostCommand executes a host command
func FileExistsInDirectory ¶
FileExistsInDirectory returns true if a file exists in a directory
func GetFilePath ¶
GetFilePath returns the file path of a file
func GetGrpcURL ¶
GetGrpcURL returns the gRPC URL given a host and port
func GetManagementURL ¶
GetManagementURL returns the management URL given a management port
func GetNamedCache ¶
func GetNamedCache[K comparable, V any](g *gomega.WithT, session *coherence.Session, cacheName string) coherence.NamedCache[K, V]
func GetNamedCacheWithScope ¶
func GetNamedCacheWithScope[K comparable, V any](g *gomega.WithT, session *coherence.Session, cacheName, _ string) coherence.NamedCache[K, V]
func GetNamedMap ¶
func GetNamedMapWithScope ¶
func GetSession ¶
func GetSession(options ...func(session *coherence.SessionOptions)) (*coherence.Session, error)
GetSession returns a coherence session for testing
func IssueGetRequest ¶
IssueGetRequest issues a HTTP GET request using the URL
func IssuePostRequest ¶
IssuePostRequest issues a HTTP POST request using the URL
func RunKeyValueTest ¶
func RunKeyValueTest[K comparable, V any](g *gomega.WithT, cache coherence.NamedMap[K, V], key K, value V)
RunKeyValueTest runs a basic Put/Get test against various key/ values
func RunKeyValueTestNamedCache ¶
func RunKeyValueTestNamedCache[K comparable, V any](g *gomega.WithT, cache coherence.NamedCache[K, V], key K, value V)
RunKeyValueTestNamedCache runs a basic Put/Get test against various key/ values
func SetTestContext ¶
func SetTestContext(context *TestContext)
SetTestContext sets the current context
func StartCoherenceCluster ¶
StartCoherenceCluster starts a Coherence cluster
func WaitForHTTPBalancedServices ¶
WaitForHTTPBalancedServices waits for all services to be balanced
func WaitForHTTPReady ¶
WaitForHTTPReady waits for the HTTP endpoint to be ready
Types ¶
type BooleanTest ¶
type TestContext ¶
type TestContext struct { ClusterName string HostName string GrpcPort int HTTPPort int URL string RestURL string ExpectedServers int Username string Password string SecureMode string // value of "env" means read from environment and "options" for options to NewSession() ClientCertPath string ClientKeyPath string CaCertPath string }
TestContext is a context to pass to tests