Documentation
¶
Index ¶
- Constants
- Variables
- func AddMBeans(ctx context.Context, container testcontainers.Container, ...) ([]byte, error)
- func AddMBeansBatch(ctx context.Context, container testcontainers.Container, ...) ([]byte, error)
- func AddMBeansWithException(ctx context.Context, container testcontainers.Container, ...) ([]byte, error)
- func AddMCompositeDataBeans(ctx context.Context, container testcontainers.Container, ...) ([]byte, error)
- func CleanMBeans(ctx context.Context, container testcontainers.Container) ([]byte, error)
- func CopyFileFromContainer(ctx context.Context, container testcontainers.Container, ...) error
- func DoHttpRequest(method, url string, body []byte) ([]byte, error)
- func GetContainerMappedPort(ctx context.Context, container testcontainers.Container, targetPort nat.Port) (host string, port nat.Port, err error)
- func GetContainerServiceURL(ctx context.Context, container testcontainers.Container, port nat.Port, ...) (string, error)
- func NrJMXAsSubprocess(ctx context.Context, host, port string) *exec.Cmd
- func RunJMXServiceContainer(ctx context.Context) (testcontainers.Container, error)
- func RunJMXServiceContainerSSL(ctx context.Context) (testcontainers.Container, error)
- func RunJbossStandaloneJMXContainer(ctx context.Context) (testcontainers.Container, error)
- type TestLogConsumer
Constants ¶
const ( TestServerPort = "4567" TestServerJMXPort = "7199" JbossJMXPort = "9990" JbossJMXUsername = "admin1234" JbossJMXPassword = "Password1!" TestServerAddDataEndpoint = "/cat" TestServerAddDataWithExceptionEndpoint = "/exceptional_cat" TestServerAddDataBatchEndpoint = "/cat_batch" TestServerAddCompositeDataEndpoint = "/composite_data_cat" TestServerCleanDataEndpoint = "/clear" KeystorePassword = "password" TruststorePassword = "password" JmxUsername = "testuser" JmxPassword = "testpassword" DefaultTimeoutMs = 10000 )
Variables ¶
var ( PrjDir string KeystorePath string TruststorePath string )
Functions ¶
func AddMBeans ¶
func AddMBeans(ctx context.Context, container testcontainers.Container, body map[string]interface{}) ([]byte, error)
AddMBeans will add new MBeans to the test-server.
func AddMBeansBatch ¶
func AddMBeansBatch(ctx context.Context, container testcontainers.Container, body []map[string]interface{}) ([]byte, error)
AddMBeansBatch will add new MBeans to the test-server.
func AddMBeansWithException ¶
func AddMBeansWithException(ctx context.Context, container testcontainers.Container, body map[string]interface{}) ([]byte, error)
AddMBeans will add new MBeans to the test-server.
func AddMCompositeDataBeans ¶
func AddMCompositeDataBeans(ctx context.Context, container testcontainers.Container, body map[string]interface{}) ([]byte, error)
AddMBeans will add new MBeans to the test-server.
func CleanMBeans ¶
CleanMBeans will remove all new added MBeans from test-server.
func CopyFileFromContainer ¶
func CopyFileFromContainer(ctx context.Context, container testcontainers.Container, srcPath, dstPath string) error
CopyFileFromContainer will copy a file from a given docker container.
func DoHttpRequest ¶
DoHttpRequest will perform the http request.
func GetContainerMappedPort ¶
func GetContainerMappedPort(ctx context.Context, container testcontainers.Container, targetPort nat.Port) (host string, port nat.Port, err error)
GetContainerMappedPort returns the hostname and the port for a given container.
func GetContainerServiceURL ¶
func GetContainerServiceURL(ctx context.Context, container testcontainers.Container, port nat.Port, endpoint string) (string, error)
GetContainerServiceURL will return the url to the test-server running inside the container.
func NrJMXAsSubprocess ¶
NrJMXAsSubprocess will return an exec.Cmd that will be configured to run the main function from testutils.
func RunJMXServiceContainer ¶
RunJMXServiceContainer will start a container running test-server with JMX.
func RunJMXServiceContainerSSL ¶
RunJMXServiceContainerSSL will start a container running test-server configured with SSL JMX.
func RunJbossStandaloneJMXContainer ¶
RunJbossStandaloneJMXContainer will start a container running a jboss instace with JMX.
Types ¶
type TestLogConsumer ¶
type TestLogConsumer struct { }
TestLogConsumer is used to print container logs to stdout.
func (*TestLogConsumer) Accept ¶
func (g *TestLogConsumer) Accept(l testcontainers.Log)